Issue 8605: test_gdb can fail with compiler opts (original) (raw)
I now get the following failures in test_gdb:
====================================================================== FAIL: test_pyup_command (test.test_gdb.StackNavigationTests) Verify that the "py-up" command works
Traceback (most recent call last): File "/home/antoine/cpython/svn/Lib/test/test_gdb.py", line 599, in test_pyup_command $''') File "/home/antoine/cpython/svn/Lib/test/test_gdb.py", line 163, in assertMultilineMatches msg='%r did not match %r' % (actual, pattern)) AssertionError: 'Breakpoint 1 at 0x4508a0: file Objects/object.c, line 330.\n\nBreakpoint 1, PyObject_Print (op=42, fp=0x7ffff7535780, flags=1) at Objects/object.c:330\n330\t\treturn internal_print(op, fp, flags, 0);\n#7 (unable to read python frame information)\n' did not match '^.*\n#[0-9]+ Frame 0x[0-9a-f]+, for file .*gdb_sample.py, line 7, in bar \(a=1, b=2, c=3\)\n baz\(a, b, c\)\n$'
====================================================================== FAIL: test_up_at_top (test.test_gdb.StackNavigationTests) Verify handling of "py-up" at the top of the stack
Traceback (most recent call last): File "/home/antoine/cpython/svn/Lib/test/test_gdb.py", line 613, in test_up_at_top cmds_after_breakpoint=['py-up'] * 4) File "/home/antoine/cpython/svn/Lib/test/test_gdb.py", line 129, in get_stack_trace self.assertEquals(err, '') AssertionError: 'Error occurred in Python command.\nError occurred in Python command.\n' != ''
====================================================================== FAIL: test_up_then_down (test.test_gdb.StackNavigationTests) Verify "py-up" followed by "py-down"
Traceback (most recent call last): File "/home/antoine/cpython/svn/Lib/test/test_gdb.py", line 628, in test_up_then_down $''') File "/home/antoine/cpython/svn/Lib/test/test_gdb.py", line 163, in assertMultilineMatches msg='%r did not match %r' % (actual, pattern)) AssertionError: 'Breakpoint 1 at 0x4508a0: file Objects/object.c, line 330.\n\nBreakpoint 1, PyObject_Print (op=42, fp=0x7ffff7535780, flags=1) at Objects/object.c:330\n330\t\treturn internal_print(op, fp, flags, 0);\n#7 (unable to read python frame information)\n#3 Frame 0x805700, for file /home/antoine/cpython/svn/Lib/test/gdb_sample.py, line 10, in baz (args=(1, 2, 3))\n print(42)\n' did not match '^.*\n#[0-9]+ Frame 0x[0-9a-f]+, for file .*gdb_sample.py, line 7, in bar \(a=1, b=2, c=3\)\n baz\(a, b, c\)\n#[0-9]+ Frame 0x[0-9a-f]+, for file .*gdb_sample.py, line 10, in baz \(args=\(1, 2, 3\)\)\n print\(42\)\n$'
====================================================================== FAIL: test_basic_command (test.test_gdb.PyBtTests) Verify that the "py-bt" command works
Traceback (most recent call last): File "/home/antoine/cpython/svn/Lib/test/test_gdb.py", line 634, in test_basic_command cmds_after_breakpoint=['py-bt']) File "/home/antoine/cpython/svn/Lib/test/test_gdb.py", line 129, in get_stack_trace self.assertEquals(err, '') AssertionError: 'Error occurred in Python command.\n' != ''
====================================================================== FAIL: test_print_after_up (test.test_gdb.PyPrintTests)
Traceback (most recent call last): File "/home/antoine/cpython/svn/Lib/test/test_gdb.py", line 658, in test_print_after_up r".\nlocal 'c' = 3\nlocal 'b' = 2\nlocal 'a' = 1\n.") File "/home/antoine/cpython/svn/Lib/test/test_gdb.py", line 163, in assertMultilineMatches msg='%r did not match %r' % (actual, pattern)) AssertionError: 'Breakpoint 1 at 0x4508a0: file Objects/object.c, line 330.\n\nBreakpoint 1, PyObject_Print (op=42, fp=0x7ffff7535780, flags=1) at Objects/object.c:330\n330\t\treturn internal_print(op, fp, flags, 0);\n#7 (unable to read python frame information)\nUnable to read information on python frame\nUnable to read information on python frame\nUnable to read information on python frame\n' did not match ".\nlocal 'c' = 3\nlocal 'b' = 2\nlocal 'a' = 1\n."
====================================================================== FAIL: test_locals_after_up (test.test_gdb.PyLocalsTests)
Traceback (most recent call last): File "/home/antoine/cpython/svn/Lib/test/test_gdb.py", line 684, in test_locals_after_up r".\na = 1\nb = 2\nc = 3\n.") File "/home/antoine/cpython/svn/Lib/test/test_gdb.py", line 163, in assertMultilineMatches msg='%r did not match %r' % (actual, pattern)) AssertionError: 'Breakpoint 1 at 0x4508a0: file Objects/object.c, line 330.\n\nBreakpoint 1, PyObject_Print (op=42, fp=0x7ffff7535780, flags=1) at Objects/object.c:330\n330\t\treturn internal_print(op, fp, flags, 0);\n#7 (unable to read python frame information)\nUnable to read information on python frame\n' did not match '.\na = 1\nb = 2\nc = 3\n.'
Basically, it seems the Python API for gdb is a bit unstable or changing. Here is what manually trying the new commands produces:
(gdb) py-bt #4 (unable to read python frame information) Traceback (most recent call last): File "/home/antoine/cpython/svn/python-gdb.py", line 1341, in invoke frame.print_summary() File "/home/antoine/cpython/svn/python-gdb.py", line 1195, in print_summary pyop = self.get_pyop() File "/home/antoine/cpython/svn/python-gdb.py", line 1168, in get_pyop return PyFrameObjectPtr.from_pyobject_ptr(f) File "/home/antoine/cpython/svn/python-gdb.py", line 349, in from_pyobject_ptr return cls(gdbval) TypeError: init() takes exactly 3 arguments (2 given) Error occurred in Python command.
(gdb) py-up Traceback (most recent call last): File "/home/antoine/cpython/svn/python-gdb.py", line 1309, in invoke move_in_stack(move_up=True) File "/home/antoine/cpython/svn/python-gdb.py", line 1289, in move_in_stack iter_frame.print_summary() File "/home/antoine/cpython/svn/python-gdb.py", line 1195, in print_summary pyop = self.get_pyop() File "/home/antoine/cpython/svn/python-gdb.py", line 1168, in get_pyop return PyFrameObjectPtr.from_pyobject_ptr(f) File "/home/antoine/cpython/svn/python-gdb.py", line 349, in from_pyobject_ptr return cls(gdbval) TypeError: init() takes exactly 3 arguments (2 given) Error occurred in Python command.
$ gdb --version GNU gdb (GDB) 7.1-1mdv2010.1 (Mandriva Linux release 2010.1) Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-mandriva-linux-gnu". For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>.