diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-05-13 15:40:15 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-05-13 15:40:15 (GMT) |
commit | e670c889ccf5ce7b27dedbc7d6d24e0679ca93bb (patch) | |
tree | cb4b3580e50d47c6451752c75a4949580e629c3d /Lib/test/test_gdb.py | |
parent | 23157e5ddcbca17b1c83fefa058e66058de787c9 (diff) | |
download | cpython-e670c889ccf5ce7b27dedbc7d6d24e0679ca93bb.zip cpython-e670c889ccf5ce7b27dedbc7d6d24e0679ca93bb.tar.gz cpython-e670c889ccf5ce7b27dedbc7d6d24e0679ca93bb.tar.bz2 |
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 17b44ea..d288d79 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\) |