diff options
Diffstat (limited to 'gdb/testsuite/gdb.cp')
-rw-r--r-- | gdb/testsuite/gdb.cp/incomplete-type-overload.exp | 2 | ||||
-rw-r--r-- | gdb/testsuite/gdb.cp/maint.exp | 8 | ||||
-rw-r--r-- | gdb/testsuite/gdb.cp/ovldbreak.exp | 14 | ||||
-rw-r--r-- | gdb/testsuite/gdb.cp/userdef.exp | 20 | ||||
-rw-r--r-- | gdb/testsuite/gdb.cp/virtfunc.exp | 23 |
5 files changed, 39 insertions, 28 deletions
diff --git a/gdb/testsuite/gdb.cp/incomplete-type-overload.exp b/gdb/testsuite/gdb.cp/incomplete-type-overload.exp index 050bd98cf56..01201ecd396 100644 --- a/gdb/testsuite/gdb.cp/incomplete-type-overload.exp +++ b/gdb/testsuite/gdb.cp/incomplete-type-overload.exp @@ -172,5 +172,5 @@ gdb_test "print foo(inc)"\ "The type. 'incomplete .' isn't fully known to GDB.*"\ "unsuccessful because declaration" gdb_test "print foo(ip)"\ - "Cannot resolve function foo to any overloaded instance."\ + "Cannot resolve function foo to any overloaded instance"\ "unsuccessful because incorrect" diff --git a/gdb/testsuite/gdb.cp/maint.exp b/gdb/testsuite/gdb.cp/maint.exp index 59dccfbb3bd..36a48e5637d 100644 --- a/gdb/testsuite/gdb.cp/maint.exp +++ b/gdb/testsuite/gdb.cp/maint.exp @@ -21,8 +21,8 @@ # Test the help messages. proc test_help {} { - set first_component_help "Print the first class/namespace component of NAME" - set namespace_help "Deprecated placeholder for removed functionality." + set first_component_help "Print the first class/namespace component of NAME\\." + set namespace_help "Deprecated placeholder for removed functionality\\." test_prefix_command_help {"maintenance cplus"} { "C\\+\\+ maintenance commands\.\[\r\n\]+" @@ -36,8 +36,8 @@ proc test_help {} { gdb_test "maint cp" $multiple_help_body - gdb_test "help maint cp first_component" "${first_component_help}." - gdb_test "help maint cp namespace" "${namespace_help}." + gdb_test "help maint cp first_component" "${first_component_help}" + gdb_test "help maint cp namespace" "${namespace_help}" } # This is used when NAME should contain only a single component. Be diff --git a/gdb/testsuite/gdb.cp/ovldbreak.exp b/gdb/testsuite/gdb.cp/ovldbreak.exp index 62e45f50d0e..fd8268a5791 100644 --- a/gdb/testsuite/gdb.cp/ovldbreak.exp +++ b/gdb/testsuite/gdb.cp/ovldbreak.exp @@ -241,11 +241,11 @@ for {set idx 0} {$idx < [llength $overloads]} {incr idx} { } # Verify the breakpoints. -set bptable "Num\[\t \]+Type\[\t \]+Disp Enb Address\[\t \]+What.*\[\r\n]+" -append bptable "\[0-9\]+\[\t \]+breakpoint\[\t \]+keep\[\t \]y\[\t \]+$hex\[\t \]+in main(\\((|void)\\))? at.*$srcfile:49\[\r\n\]+" -append bptable "\[\t \]+breakpoint already hit 1 time\[\r\n\]+." +set bptable "Num\[\t \]+Type\[\t \]+Disp Enb Address\[\t \]+What\\s*\r\n" +append bptable "\[0-9\]+\[\t \]+breakpoint\[\t \]+keep\[\t \]y\[\t \]+$hex\[\t \]+in main(\\((|void)\\))? at.*$srcfile:49\r\n" +append bptable "\[\t \]+breakpoint already hit 1 time" foreach ovld $overloads { - append bptable [format "\[0-9\]+\[\t \]+breakpoint\[\t \]+keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(%s\\) at.*$srcfile:%d\[\r\n\]+" $ovld \ + append bptable [format "\r\n\[0-9\]+\[\t \]+breakpoint\[\t \]+keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(%s\\) at.*$srcfile:%d" $ovld \ $line($type_map("$ovld"))] } gdb_test "info break" $bptable "breakpoint info (after setting one-by-one)" @@ -366,12 +366,12 @@ gdb_expect { } # Create the breakpoint table for "info breakpoint". -set bptable "Num\[\t \]+Type\[\t \]+Disp Enb Address\[\t \]+What.*\[\r\n]+" -append bptable "\[0-9\]+\[\t \]+breakpoint\[\t \]+keep\[\t \]y\[\t \]+<MULTIPLE>.*\[\r\n\]+" +set bptable "Num\[\t \]+Type\[\t \]+Disp Enb Address\[\t \]+What\\s*\r\n" +append bptable "\[0-9\]+\[\t \]+breakpoint\[\t \]+keep\[\t \]y\[\t \]+<MULTIPLE>\\s*" foreach ovld {void char signed_char unsigned_char short_int \ unsigned_short_int int unsigned_int long_int \ unsigned_long_int float double} { - append bptable [format "\[0-9\]+.\[0-9\]+\[\t \]+y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(%s\\) at.*$srcfile:%d\[\r\n\]+" \ + append bptable [format "\r\n\[0-9\]+.\[0-9\]+\[\t \]+y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(%s\\) at.*$srcfile:%d" \ $types($ovld) $line($ovld)] } diff --git a/gdb/testsuite/gdb.cp/userdef.exp b/gdb/testsuite/gdb.cp/userdef.exp index f04a441c54d..ac453179da2 100644 --- a/gdb/testsuite/gdb.cp/userdef.exp +++ b/gdb/testsuite/gdb.cp/userdef.exp @@ -67,9 +67,9 @@ gdb_test "print one / two" "\\\$\[0-9\]* = {x = 0, y = 0}" gdb_test "print one % two" "\\\$\[0-9\]* = {x = 2, y = 3}" -gdb_test "print one && two" "\\\$\[0-9\]* = 1\[\r\n\]" +gdb_test "print one && two" "\\\$\[0-9\]* = 1" -gdb_test "print one || two" "\\\$\[0-9\]* = 1\[\r\n\]" +gdb_test "print one || two" "\\\$\[0-9\]* = 1" gdb_test "print one & two" "\\\$\[0-9\]* = {x = 0, y = 1}" @@ -77,18 +77,18 @@ gdb_test "print one | two" "\\\$\[0-9\]* = {x = 6, y = 7}" gdb_test "print one ^ two" "\\\$\[0-9\]* = {x = 6, y = 6}" -gdb_test "print one < two" "\\\$\[0-9\]* = 1\[\r\n\]" +gdb_test "print one < two" "\\\$\[0-9\]* = 1" -gdb_test "print one <= two" "\\\$\[0-9\]* = 1\[\r\n\]" +gdb_test "print one <= two" "\\\$\[0-9\]* = 1" -gdb_test "print one > two" "\\\$\[0-9\]* = 0\[\r\n\]" +gdb_test "print one > two" "\\\$\[0-9\]* = 0" -gdb_test "print one >= two" "\\\$\[0-9\]* = 0\[\r\n\]" +gdb_test "print one >= two" "\\\$\[0-9\]* = 0" -gdb_test "print one == two" "\\\$\[0-9\]* = 0\[\r\n\]" -gdb_test "print one.operator== (two)" "\\\$\[0-9\]* = 0\[\r\n\]" +gdb_test "print one == two" "\\\$\[0-9\]* = 0" +gdb_test "print one.operator== (two)" "\\\$\[0-9\]* = 0" -gdb_test "print one != two" "\\\$\[0-9\]* = 1\[\r\n\]" +gdb_test "print one != two" "\\\$\[0-9\]* = 1" # Can't really check the output of this one without knowing # target integer width. Make sure we don't try to call @@ -98,7 +98,7 @@ gdb_test "print one << 31" "\\\$\[0-9\]* = {x = -?\[0-9\]*, y = -?\[0-9\]*}" # Should be fine even on < 32-bit targets. gdb_test "print one >> 31" "\\\$\[0-9\]* = {x = 0, y = 0}" -gdb_test "print !one" "\\\$\[0-9\]* = 0\[\r\n\]" +gdb_test "print !one" "\\\$\[0-9\]* = 0" # Assumes 2's complement. So does everything... gdb_test "print +one" "\\\$\[0-9\]* = {x = 2, y = 3}" diff --git a/gdb/testsuite/gdb.cp/virtfunc.exp b/gdb/testsuite/gdb.cp/virtfunc.exp index 445befddf28..908c969741b 100644 --- a/gdb/testsuite/gdb.cp/virtfunc.exp +++ b/gdb/testsuite/gdb.cp/virtfunc.exp @@ -228,7 +228,7 @@ proc test_virtual_calls {} { proc make_one_vtable_result {name args} { global hex - set nls "\[\r\n\]+" + set nls "\r\n" set result "vtable for '${name}' @ $hex .subobject @ $hex.:$nls" set count 0 @@ -237,9 +237,20 @@ proc make_one_vtable_result {name args} { incr count } + # Remove the last instance of $nls. + if {$count > 0} { + set result [string range $result 0 end-[string length $nls]] + } + + verbose -log "APB: result: '$result'" + return $result } +proc vtable_seq { args } { + return [join "\r\n\r\n" $args] +} + # Test "info vtbl". proc test_info_vtbl {} { @@ -255,12 +266,12 @@ proc test_info_vtbl {} { set vt_D2 [make_one_vtable_result D "non-virtual thunk to E::vg" D::vd] set vt_E [make_one_vtable_result E E::f E::vg E::vv] - gdb_test "info vtbl a" "${vt_A}${vt_V}" - gdb_test "info vtbl b" "${vt_B}${vt_V}" + gdb_test "info vtbl a" [vtable_seq ${vt_A} ${vt_V}] + gdb_test "info vtbl b" [vtable_seq ${vt_B} ${vt_V}] gdb_test "info vtbl c" "${vt_V}" - gdb_test "info vtbl d" "${vt_D}${vt_V}" - gdb_test "info vtbl e" "${vt_E}${vt_D2}${vt_V2}" - gdb_test "info vtbl pEe" "${vt_E}${vt_D2}${vt_V2}" + gdb_test "info vtbl d" [vtable_seq ${vt_D} ${vt_V}] + gdb_test "info vtbl e" [vtable_seq ${vt_E} ${vt_D2} ${vt_V2}] + gdb_test "info vtbl pEe" [vtable_seq ${vt_E} ${vt_D2} ${vt_V2}] gdb_test "info vtbl" "Argument required.*" gdb_test "info vtbl va" \ |