]> granicus.if.org Git - python/commitdiff
Issue #23881: Only use entry-values with gdb 7.4 in tests.
authorSerhiy Storchaka <storchaka@gmail.com>
Fri, 6 Feb 2015 06:35:20 +0000 (08:35 +0200)
committerSerhiy Storchaka <storchaka@gmail.com>
Fri, 6 Feb 2015 06:35:20 +0000 (08:35 +0200)
Fixes a regression in issue #22765.  Patch by Vinson Lee.

Lib/test/test_gdb.py

index 2db9cd59f9287ec9ac15e6d284dc10eef9b6598f..aaa5c69d49caaa84a312090a608c0719a52ca0ae 100644 (file)
@@ -124,14 +124,6 @@ class DebuggerTests(unittest.TestCase):
         commands = ['set breakpoint pending yes',
                     'break %s' % breakpoint,
 
-                    # GDB as of 7.4 (?) onwards can distinguish between the
-                    # value of a variable at entry vs current value:
-                    #   http://sourceware.org/gdb/onlinedocs/gdb/Variables.html
-                    # which leads to the selftests failing with errors like this:
-                    #   AssertionError: 'v@entry=()' != '()'
-                    # Disable this:
-                    'set print entry-values no',
-
                     # The tests assume that the first frame of printed
                     #  backtrace will not contain program counter,
                     #  that is however not guaranteed by gdb
@@ -143,6 +135,16 @@ class DebuggerTests(unittest.TestCase):
                     'set print address off',
 
                     'run']
+
+        # GDB as of 7.4 onwards can distinguish between the
+        # value of a variable at entry vs current value:
+        #   http://sourceware.org/gdb/onlinedocs/gdb/Variables.html
+        # which leads to the selftests failing with errors like this:
+        #   AssertionError: 'v@entry=()' != '()'
+        # Disable this:
+        if (gdb_major_version, gdb_minor_version) >= (7, 4):
+            commands += ['set print entry-values no']
+
         if cmds_after_breakpoint:
             commands += cmds_after_breakpoint
         else: