diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-05-13 17:53:22 +0200 |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-05-13 17:53:22 +0200 |
commit | c729c256153058ce94ebe3cd6d20fac11b2f2e06 (patch) | |
tree | 10a15d50ad40151ce86a4e167ccb1bd909b1f771 /Lib/test/test_gdb.py | |
parent | 252048c8a1c7f3e205338b401459e384d760873a (diff) | |
parent | e670c889ccf5ce7b27dedbc7d6d24e0679ca93bb (diff) | |
download | cpython-git-c729c256153058ce94ebe3cd6d20fac11b2f2e06.tar.gz |
(Merge 3.2) Issue #11996: libpython (gdb), replace "py-bt" command by
"py-bt-full" and add a smarter "py-bt" command printing a classic Python
traceback.
Diffstat (limited to 'Lib/test/test_gdb.py')
-rw-r--r-- | Lib/test/test_gdb.py | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/Lib/test/test_gdb.py b/Lib/test/test_gdb.py index 17b44ea354..d288d7944a 100644 --- a/Lib/test/test_gdb.py +++ b/Lib/test/test_gdb.py @@ -611,12 +611,29 @@ $''') $''') class PyBtTests(DebuggerTests): - def test_basic_command(self): + def test_bt(self): 'Verify that the "py-bt" command works' bt = self.get_stack_trace(script=self.get_sample_script(), cmds_after_breakpoint=['py-bt']) self.assertMultilineMatches(bt, r'''^.* +Traceback \(most recent call first\): + File ".*gdb_sample.py", line 10, in baz + id\(42\) + File ".*gdb_sample.py", line 7, in bar + baz\(a, b, c\) + File ".*gdb_sample.py", line 4, in foo + bar\(a, b, c\) + File ".*gdb_sample.py", line 12, in <module> + foo\(1, 2, 3\) +''') + + def test_bt_full(self): + 'Verify that the "py-bt-full" command works' + bt = self.get_stack_trace(script=self.get_sample_script(), + cmds_after_breakpoint=['py-bt-full']) + self.assertMultilineMatches(bt, + r'''^.* #[0-9]+ Frame 0x[0-9a-f]+, for file .*gdb_sample.py, line 7, in bar \(a=1, b=2, c=3\) baz\(a, b, c\) #[0-9]+ Frame 0x[0-9a-f]+, for file .*gdb_sample.py, line 4, in foo \(a=1, b=2, c=3\) |