diff options
Diffstat (limited to 'Lib/test/test_gdb.py')
-rw-r--r-- | Lib/test/test_gdb.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Lib/test/test_gdb.py b/Lib/test/test_gdb.py index 22c75bae987..7bdef25c763 100644 --- a/Lib/test/test_gdb.py +++ b/Lib/test/test_gdb.py @@ -666,15 +666,16 @@ id(a)''') def test_frames(self): gdb_output = self.get_stack_trace(''' +import sys def foo(a, b, c): - pass + return sys._getframe(0) -foo(3, 4, 5) -id(foo.__code__)''', +f = foo(3, 4, 5) +id(f)''', breakpoint='builtin_id', - cmds_after_breakpoint=['print (PyFrameObject*)(((PyCodeObject*)v)->co_zombieframe)'] + cmds_after_breakpoint=['print (PyFrameObject*)v'] ) - self.assertTrue(re.match(r'.*\s+\$1 =\s+Frame 0x-?[0-9a-f]+, for file <string>, line 3, in foo \(\)\s+.*', + self.assertTrue(re.match(r'.*\s+\$1 =\s+Frame 0x-?[0-9a-f]+, for file <string>, line 4, in foo \(a=3.*', gdb_output, re.DOTALL), 'Unexpected gdb representation: %r\n%s' % (gdb_output, gdb_output)) |