+2019-11-02 Tom de Vries <tdevries@suse.de>
+
+ * gdb.cp/anon-union.exp: Drop superfluous 3rd argument to gdb_test.
+ * gdb.cp/cpexprs.exp: Same.
+ * gdb.cp/except-multi-location.exp: Same.
+ * gdb.cp/exceptprint.exp: Same.
+ * gdb.cp/gdb2384.exp: Same.
+ * gdb.cp/inherit.exp: Same.
+ * gdb.cp/m-static.exp: Same.
+ * gdb.cp/meth-typedefs.exp: Same.
+ * gdb.cp/misc.exp: Same.
+ * gdb.cp/namespace.exp: Same.
+ * gdb.cp/non-trivial-retval.exp: Same.
+ * gdb.cp/overload.exp: Same.
+ * gdb.cp/pr17132.exp: Same.
+ * gdb.cp/re-set-overloaded.exp: Same.
+ * gdb.cp/rvalue-ref-types.exp: Same.
+ * gdb.cp/templates.exp: Same.
+
2019-11-01 Luis Machado <luis.machado@linaro.org>
PR gdb/25124
"print foo 9"
# Step over next four assignments
-gdb_test "next 4" "53\[ \t\]*w = 45;" "next 4"
+gdb_test "next 4" "53\[ \t\]*w = 45;"
# Tests for anon unions that are not members of a class or struct
# "print METHOD"
foreach name [get_functions print] {
- gdb_test "print $name" [get $name print] "print $name"
+ gdb_test "print $name" [get $name print]
}
# "list METHOD"
foreach name [get_functions list] {
- gdb_test "list $name" [get $name list] "list $name"
+ gdb_test "list $name" [get $name list]
}
# Running to breakpoint -- use any function we can "list"
return 0
}
- gdb_test "catch catch" "Catchpoint \[0-9\]+ \\(catch\\)" \
- "catch catch"
- gdb_test "catch throw" "Catchpoint \[0-9\]+ \\(throw\\)" \
- "catch throw"
- gdb_test "catch rethrow" "Catchpoint \[0-9\]+ \\(rethrow\\)" \
- "catch rethrow"
+ gdb_test "catch catch" "Catchpoint \[0-9\]+ \\(catch\\)"
+ gdb_test "catch throw" "Catchpoint \[0-9\]+ \\(throw\\)"
+ gdb_test "catch rethrow" "Catchpoint \[0-9\]+ \\(rethrow\\)"
set ws "\[ \t\]*"
gdb_test "info breakpoints" \
}
}
-gdb_test "catch catch" "Catchpoint \[0-9\]+ \\(catch\\)" \
- "catch catch"
-gdb_test "catch throw" "Catchpoint \[0-9\]+ \\(throw\\)" \
- "catch throw"
-gdb_test "catch rethrow" "Catchpoint \[0-9\]+ \\(rethrow\\)" \
- "catch rethrow"
+gdb_test "catch catch" "Catchpoint \[0-9\]+ \\(catch\\)"
+gdb_test "catch throw" "Catchpoint \[0-9\]+ \\(throw\\)"
+gdb_test "catch rethrow" "Catchpoint \[0-9\]+ \\(rethrow\\)"
do_exceptprint_tests string "$hex \"hi bob\""
do_exceptprint_tests int 23
gdb_continue_to_breakpoint "set breakpoint here"
gdb_test "print d1.meth ()" \
- ".*42.*" \
- "print d1.meth ()"
+ ".*42.*"
# Now try again. gdb's without the fix will hopefully segv here
gdb_test "print g_vC.vC::vx" "$vhn = 10"
# Print members of g_vC using compact form.
- gdb_test "print g_vC.va" "$vhn = 7" "print g_vC.va"
- gdb_test "print g_vC.vc" "$vhn = 9" "print g_vC.vc"
- gdb_test "print g_vC.vx" "$vhn = 10" "print g_vC.vx"
+ gdb_test "print g_vC.va" "$vhn = 7"
+ gdb_test "print g_vC.vc" "$vhn = 9"
+ gdb_test "print g_vC.vx" "$vhn = 10"
}
# Single virtual inheritance, print complete classes.
# Also make sure static const members can be found via "info var".
if { $non_dwarf } { setup_xfail *-*-* }
-gdb_test "info variable everywhere" "File .*/m-static\[.\]h.*const int gnu_obj_4::everywhere;" "info variable everywhere"
+gdb_test "info variable everywhere" "File .*/m-static\[.\]h.*const int gnu_obj_4::everywhere;"
# Perhaps at some point test4 should also include a test for a static
# const int that was initialized in the header file. But I'm not sure
"file: \".*$srcfile\", line number: $line2, symbol: \"B::$func_re\"" \
"$line2${any}B::test${any}" \
"file: \".*$srcfile\", line number: $line3, symbol: \"$func_re\"" \
- "$line3${any}// test${any}"] \
- "list $f"
+ "$line3${any}// test${any}"]
delete_breakpoints
gdb_test "break $f" "\\(3 locations\\)"
"set a bool array elem"
# bool constants
-gdb_test "print true" "\\$\[0-9\]* = true" "print true"
-gdb_test "print false" "\\$\[0-9\]* = false" "print false"
+gdb_test "print true" "\\$\[0-9\]* = true"
+gdb_test "print false" "\\$\[0-9\]* = false"
# arithmetic conversions
gdb_test "print 1 + true" "\\$\[0-9\]* = 2" "1 + true"
# shouldn't work with quotes, I'm only including one version.
gdb_test "print 'AAA::c'" \
- "\\$\[0-9\]* = 0 '\\\\(0|000)'" \
- "print 'AAA::c'"
+ "\\$\[0-9\]* = 0 '\\\\(0|000)'"
gdb_test "print AAA::c" \
- "\\$\[0-9\]* = 0 '\\\\(0|000)'" \
- "print AAA::c"
+ "\\$\[0-9\]* = 0 '\\\\(0|000)'"
# An object declared using "using".
# Call a function in a namespace
gdb_test "print 'AAA::xyzq'('x')" \
- "\\$\[0-9\]* = 97 'a'" \
- "print 'AAA::xyzq'('x')"
+ "\\$\[0-9\]* = 97 'a'"
gdb_test "print AAA::xyzq('x')" \
- "\\$\[0-9\]* = 97 'a'" \
- "print AAA::xyzq('x')"
-
+ "\\$\[0-9\]* = 97 'a'"
+
# Break on a function in a namespace
gdb_test "break AAA::xyzq" \
# Call a function in a nested namespace
gdb_test "print 'BBB::CCC::xyzq'('x')" \
- "\\$\[0-9\]* = 122 'z'" \
- "print 'BBB::CCC::xyzq'('x')"
+ "\\$\[0-9\]* = 122 'z'"
gdb_test "print BBB::CCC::xyzq('x')" \
- "\\$\[0-9\]* = 122 'z'" \
- "print BBB::CCC::xyzq('x')"
+ "\\$\[0-9\]* = 122 'z'"
# Break on a function in a nested namespace
# Print address of a function in a class in a namespace
gdb_test "print 'BBB::Class::xyzq'" \
- "\\$\[0-9\]* = \{char \\((BBB::|)Class \\*( const|), (char|int)\\)\} $hex <BBB::Class::xyzq\\(char\\)>" \
- "print 'BBB::Class::xyzq'"
+ "\\$\[0-9\]* = \{char \\((BBB::|)Class \\*( const|), (char|int)\\)\} $hex <BBB::Class::xyzq\\(char\\)>"
gdb_test "print BBB::Class::xyzq" \
- "\\$\[0-9\]* = \{char \\((BBB::|)Class \\*( const|), (char|int)\\)\} $hex <BBB::Class::xyzq\\(char\\)>" \
- "print BBB::Class::xyzq"
+ "\\$\[0-9\]* = \{char \\((BBB::|)Class \\*( const|), (char|int)\\)\} $hex <BBB::Class::xyzq\\(char\\)>"
# Break on a function in a class in a namespace
gdb_breakpoint [gdb_get_line_number "Break here"]
gdb_continue_to_breakpoint "Break here"
-gdb_test "p f1 (i1, i2)" ".* = {a = 123}" "p f1 (i1, i2)"
-gdb_test "p f2 (i1, i2)" ".* = {b = 123}" "p f2 (i1, i2)"
-gdb_test "p f22 (i1, i2)" ".* = {b1 = 123}" "p f22 (i1, i2)"
-gdb_test "p f3 (i1, i2)" ".* = {.* c = 123}" "p f3 (i1, i2)"
-gdb_test "p f4 (i1, i2)" ".* = {.* e = 123}" "p f4 (i1, i2)"
+gdb_test "p f1 (i1, i2)" ".* = {a = 123}"
+gdb_test "p f2 (i1, i2)" ".* = {b = 123}"
+gdb_test "p f22 (i1, i2)" ".* = {b1 = 123}"
+gdb_test "p f3 (i1, i2)" ".* = {.* c = 123}"
+gdb_test "p f4 (i1, i2)" ".* = {.* e = 123}"
# Test expression evaluation with overloaded methods
gdb_test "print foo::overload1arg" \
- "non-unique member `overload1arg' requires type instantiation" \
- "print foo::overload1arg"
+ "non-unique member `overload1arg' requires type instantiation"
gdb_test "print foo::overload1arg(char***)" \
- "no member function matches that type instantiation" \
- "print foo::overload1arg(char***)"
+ "no member function matches that type instantiation"
gdb_test "print foo::overload1arg(void)" \
- "\\$$decimal = {int \\(foo \\*( const|)\\)} $hex <foo::overload1arg\\(\\)>" \
- "print foo::overload1arg(void)"
+ "\\$$decimal = {int \\(foo \\*( const|)\\)} $hex <foo::overload1arg\\(\\)>"
foreach t [list char "signed char" "unsigned char" "short" \
"unsigned short" int "unsigned int" long "unsigned long" \
float double] {
gdb_test "print foo::overload1arg($t)" \
- "\\$$decimal = {int \\(foo \\*( const|), $t\\)} $hex <foo::overload1arg\\($t\\)>" \
- "print foo::overload1arg($t)"
+ "\\$$decimal = {int \\(foo \\*( const|), $t\\)} $hex <foo::overload1arg\\($t\\)>"
}
gdb_breakpoint [gdb_get_line_number "Break here"]
gdb_continue_to_breakpoint "Break here"
-gdb_test "ptype a_ptr->func ()" ".* = int" "ptype a_ptr->func ()"
-gdb_test "ptype a->func ()" ".* = int" "ptype a->func ()"
+gdb_test "ptype a_ptr->func ()" ".* = int"
+gdb_test "ptype a->func ()" ".* = int"
gdb_test "p sizeof (a_ptr->func()) == sizeof (int)" ".* = true" \
"p sizeof (a_ptr->func())"
gdb_test "p sizeof (a->func()) == sizeof (int)" ".* = true" \
"p sizeof (a->func())"
-gdb_test "p 1 && a->func()" ".* = true" "p 1 && a->func()"
-gdb_test "p 0 || a->func()" ".* = true" "p 0 || a->func()"
+gdb_test "p 1 && a->func()" ".* = true"
+gdb_test "p 0 || a->func()" ".* = true"
gdb_load_shlib ${sofile}
gdb_test_no_output "set breakpoint pending yes"
-gdb_test "break C::C" {Breakpoint [0-9]+ \(C::C\) pending\.} "break C::C"
+gdb_test "break C::C" {Breakpoint [0-9]+ \(C::C\) pending\.}
gdb_test_no_output {set variable $brk = $bpnum}
# runto or runto_main would call delete_breakpoints.
gdb_test "print rrt" " = \\(short( int)? &&\\) @$hex: -1" "print value of rrt"
-gdb_test "ptype rrt" "type = short( int)? &&" "ptype rrt"
+gdb_test "ptype rrt" "type = short( int)? &&"
gdb_test "print *rrpt" ".$decimal = -1" "print value of *rrpt"
gdb_test "x /hd rrpt" "$hex:\[ \t\]*-1" "examine value at rrpt"
-gdb_test "ptype rrpt" "type = short( int)? \\*&&" "ptype rrpt"
+gdb_test "ptype rrpt" "type = short( int)? \\*&&"
gdb_test "print rrat\[0\]" ".$decimal = 0" "print value of rrat\[0\]"
-gdb_test "ptype rrat" "type = short( int)? \\\(&&\\\)\\\[4\\\]" "ptype rrat"
+gdb_test "ptype rrat" "type = short( int)? \\\(&&\\\)\\\[4\\\]"
gdb_test "print rrat\[1\]" ".$decimal = 1" "print value of rrat\[1\]"
gdb_test "print rrat\[2\]" ".$decimal = 2" "print value of rrat\[2\]"
gdb_test "ptype rrUC" "type = unsigned char &&"
-gdb_test "ptype rrS" "type = short( int)? &&" "ptype rrS"
+gdb_test "ptype rrS" "type = short( int)? &&"
-gdb_test "ptype rrUS" "type = unsigned short( int)? &&" "ptype rrUS"
+gdb_test "ptype rrUS" "type = unsigned short( int)? &&"
gdb_test "ptype rrI" "type = int &&"
gdb_test "ptype rrUI" "type = unsigned int &&"
-gdb_test "ptype rrL" "type = long( int)? &&" "ptype rrL"
+gdb_test "ptype rrL" "type = long( int)? &&"
-gdb_test "ptype rrUL" "type = unsigned long( int)? &&" "ptype rrUL"
+gdb_test "ptype rrUL" "type = unsigned long( int)? &&"
gdb_test "ptype rrF" "type = float &&"
# print out a function from a nested template name
gdb_test "print Garply<Garply<char> >::garply" \
- "\\$\[0-9\]* = \\{(class |)Garply<char> \\((class |)Garply<Garply<char> > \\*(| const), int, (class |)Garply<char>\\)\\} $hex <Garply<Garply<char>\[ \t\]*>::garply\\(int, (class |)Garply<char>\\)>" \
- "print Garply<Garply<char> >::garply"
+ "\\$\[0-9\]* = \\{(class |)Garply<char> \\((class |)Garply<Garply<char> > \\*(| const), int, (class |)Garply<char>\\)\\} $hex <Garply<Garply<char>\[ \t\]*>::garply\\(int, (class |)Garply<char>\\)>"
# djb - 06-03-2000
# Now should work fine