mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issue #11996: libpython (gdb), replace "py-bt" command by "py-bt-full" and add
a smarter "py-bt" command printing a classic Python traceback.
This commit is contained in:
parent
23157e5ddc
commit
e670c889cc
3 changed files with 61 additions and 2 deletions
|
@ -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\)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue