Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fdc9953

Browse files
Issue #22765: Fixed test_gdb failures. Supressed unexpected gdb output.
Patch by Bohuslav Kabrda.
1 parent 756f0b1 commit fdc9953

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

Lib/test/test_gdb.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,25 @@ def get_stack_trace(self, source=None, script=None,
123123
# Generate a list of commands in gdb's language:
124124
commands = ['set breakpoint pending yes',
125125
'break %s' % breakpoint,
126+
127+
# GDB as of 7.4 (?) onwards can distinguish between the
128+
# value of a variable at entry vs current value:
129+
# http://sourceware.org/gdb/onlinedocs/gdb/Variables.html
130+
# which leads to the selftests failing with errors like this:
131+
# AssertionError: 'v@entry=()' != '()'
132+
# Disable this:
133+
'set print entry-values no',
134+
135+
# The tests assume that the first frame of printed
136+
# backtrace will not contain program counter,
137+
# that is however not guaranteed by gdb
138+
# therefore we need to use 'set print address off' to
139+
# make sure the counter is not there. For example:
140+
# #0 in PyObject_Print ...
141+
# is assumed, but sometimes this can be e.g.
142+
# #0 0x00003fffb7dd1798 in PyObject_Print ...
143+
'set print address off',
144+
126145
'run']
127146
if cmds_after_breakpoint:
128147
commands += cmds_after_breakpoint

0 commit comments

Comments
 (0)