]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Robustify inherit.exp and virtbase.exp.
authorAndrew Stubbs <ams@codesourcery.com>
Thu, 15 Oct 2015 15:54:37 +0000 (16:54 +0100)
committerAndrew Stubbs <ams@codesourcery.com>
Mon, 19 Oct 2015 10:15:21 +0000 (11:15 +0100)
2015-10-19  Andrew Stubbs  <ams@codesourcery.com>

gdb/testsuite/
* gdb.cp/inherit.exp (print g_vB, print g_vC, print g_vD,
print g_vE): Add new pass patterns.
* gdb.cp/virtbase.exp (print *this, print *(D *) e): Allow GDB to
print various symbol names for vptr fields.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.cp/inherit.exp
gdb/testsuite/gdb.cp/virtbase.exp

index 74aa6aeb3419510d5d192b5544641929c4b18e3b..bf3cac9af391cfc07c80a6bb4817ee30fa2efb36 100644 (file)
@@ -1,3 +1,10 @@
+2015-10-19  Andrew Stubbs  <ams@codesourcery.com>
+
+       * gdb.cp/inherit.exp (print g_vB, print g_vC, print g_vD,
+       print g_vE): Add new pass patterns.
+       * gdb.cp/virtbase.exp (print *this, print *(D *) e): Allow GDB to
+       print various symbol names for vptr fields.
+
 2015-10-12  Andrew Burgess  <andrew.burgess@embecosm.com>
 
        * gdb.base/dbx.exp (test_func): Remove xfails, update expected
index 2369a1e8418ef5df25214c7b13458eb6711f2d6c..d269a3bd489ddf15682daf85eda2e68fb2cc0932 100644 (file)
@@ -524,6 +524,12 @@ proc test_print_svi_classes { } {
            # gcc HEAD 2004-07-31 -gstabs+
            pass $name
        }
+       -re "$vhn = \{<vA> = \{va = 3, vx = 4\}, $re_vbptr_3 = ${hex}( <\[^>]*>)?, vb = 5, vx = 6\}$nl$gdb_prompt $" {
+           # gcc HEAD 2015?+
+           # the vptr is set to the address *after* the vtable,
+           # so the # symbol shown is unpredictable
+           pass "$name (symbols ignored)"
+       }
     }
 
     # Print all members of g_vC.
@@ -552,6 +558,12 @@ proc test_print_svi_classes { } {
            # gcc HEAD 2004-07-31 -gstabs+
            pass $name
        }
+       -re "$vhn = \{<vA> = \{va = 7, vx = 8\}, $re_vbptr_3 = ${hex}( <\[^>]*>)?, vc = 9, vx = 10\}$nl$gdb_prompt $" {
+           # gcc HEAD 2015?+
+           # the vptr is set to the address *after* the vtable,
+           # so the symbol shown is unpredictable
+           pass "$name (symbols ignored)"
+       }
     }
 }
 
@@ -623,6 +635,12 @@ proc test_print_mvi_classes { } {
            # gcc 3.3.2 -gstabs+
            pass "$name"
        }
+       -re "$vhn = \{<vB> = \{<vA> = \{va = 19, vx = 20\}, $re_vbptr_3_vB = ${hex}( <\[^>]*>)?, vb = 21, vx = 22\}, <vC> = \{$re_vbptr_3_vC = ${hex}( <\[^>]*>)?, vc = 23, vx = 24\}, $re_vbptr_3_vD = ${hex}( <\[^>]*>)?, vd = 25, vx = 26\}$nl$gdb_prompt $" {
+           # gcc HEAD 2015?+
+           # the vptr is set to the address *after* the vtable,
+           # so the symbol shown is unpredictable
+           pass "$name (symbols ignored)"
+       }
     }
 
     # Print all members of g_vE.
@@ -650,6 +668,12 @@ proc test_print_mvi_classes { } {
            # gcc HEAD 2004-07-31 -gstabs+
            pass $name
        }
+       -re "$vhn = \{<vD> = \{<vB> = \{<vA> = \{va = 0, vx = 0\}, $re_vbptr_3_vB = ${hex}( <\[^>]*>)?, vb = 0, vx = 0\}, <vC> = \{$re_vbptr_3_vC = ${hex}( <\[^>]*>)?, vc = 0, vx = 0\}, $re_vbptr_3_vD = ${hex}( <\[^>]*>)?, vd = 0, vx = 0\}, $re_vbptr_3_vE = ${hex}( <\[^>]*>)?, ve = 27, vx = 28\}$nl$gdb_prompt $" {
+           # gcc HEAD 2015?+
+           # the vptr is set to the address *after* the vtable,
+           # so the symbol shown is unpredictable
+           pass "$name (symbols ignored)"
+       }
     }
 }
 
index 2033d56f90d9bf447939f0b3d364ac9856029e47..0d1bfa2d536ff58fc22456015833f726a27056ba 100644 (file)
@@ -33,7 +33,7 @@ gdb_continue_to_breakpoint "first breakpoint"
 
 # In PR 11226, we failed to print x correctly in the "print *this"
 # case.
-gdb_test "print *this" " = {<mc::Base> = {x = 2}, _vptr.Middle = $hex, y = 3}"
+gdb_test "print *this" " = {<mc::Base> = {x = 2}, _vptr.Middle = ${hex}( <\[^>]*>)?, y = 3}"
 gdb_test "print x" " = 2" "print x in get_y"
 
 gdb_breakpoint [gdb_get_line_number "breakpoint 2"]
@@ -46,7 +46,7 @@ gdb_breakpoint [gdb_get_line_number "breakpoint 3"]
 gdb_continue_to_breakpoint "third breakpoint"
 
 # In PR 9629, we failed to print v correctly here.
-gdb_test "print *(D *) e" " = {<C> = {v = 11}, _vptr.D = $hex}"
+gdb_test "print *(D *) e" " = {<C> = {v = 11}, _vptr.D = ${hex}( <\[^>]*>)?}"
 
 # A regression test reported to Red Hat bugzilla, see:
 # https://bugzilla.redhat.com/show_bug.cgi?id=560741
@@ -70,5 +70,5 @@ gdb_test "print $" \
     " = \\(Virtual \\*\\) $hex <virtual_o>" \
     "print same pointer from history value"
 gdb_test "print *$$" \
-    " = \\(Virtual\\) {<VirtualMiddleA> = {<VirtualBase> = {_vptr.VirtualBase = ${hex}( <vtable for Virtual.*>)?, x = 0}, _vptr.VirtualMiddleA = ${hex}( <vtable for Virtual.*>)?, y = \\{0 <repeats 300 times>\\}}, <VirtualMiddleB> = {_vptr.VirtualMiddleB = ${hex}( <vtable for Virtual.*>)?, y = 0}, _vptr.Virtual = ${hex}( <vtable for Virtual.*>)?, z = 0}" \
+    " = \\(Virtual\\) {<VirtualMiddleA> = {<VirtualBase> = {_vptr.VirtualBase = ${hex}( <\[^>]*>)?, x = 0}, _vptr.VirtualMiddleA = ${hex}( <\[^>]*>)?, y = \\{0 <repeats 300 times>\\}}, <VirtualMiddleB> = {_vptr.VirtualMiddleB = ${hex}( <\[^>]*>)?, y = 0}, _vptr.Virtual = ${hex}( <\[^>]*>)?, z = 0}" \
     "print whole pointed-to object, starting from the virtual base pointer"