Skip to content

Commit 313ee59

Browse files
Issue #23881: Only use entry-values with gdb 7.4 in tests.
Fixes a regression in issue #22765. Patch by Vinson Lee.
2 parents bb24087 + 17d337b commit 313ee59

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

Lib/test/test_gdb.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -124,14 +124,6 @@ def get_stack_trace(self, source=None, script=None,
124124
commands = ['set breakpoint pending yes',
125125
'break %s' % breakpoint,
126126

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-
135127
# The tests assume that the first frame of printed
136128
# backtrace will not contain program counter,
137129
# that is however not guaranteed by gdb
@@ -143,6 +135,16 @@ def get_stack_trace(self, source=None, script=None,
143135
'set print address off',
144136

145137
'run']
138+
139+
# GDB as of 7.4 onwards can distinguish between the
140+
# value of a variable at entry vs current value:
141+
# http://sourceware.org/gdb/onlinedocs/gdb/Variables.html
142+
# which leads to the selftests failing with errors like this:
143+
# AssertionError: 'v@entry=()' != '()'
144+
# Disable this:
145+
if (gdb_major_version, gdb_minor_version) >= (7, 4):
146+
commands += ['set print entry-values no']
147+
146148
if cmds_after_breakpoint:
147149
commands += cmds_after_breakpoint
148150
else:

0 commit comments

Comments
 (0)