diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index d510e16c91..7e991468b0 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,12 @@ +2008-04-03 Joel Brobecker + + * gdb.cp/ovldbreak.cc: Add missing bodies for methods foo::foofunc. + * gdb.cp/ovldbreak.exp: Set multiple-symbols to "ask". + Add a couple of tests that verify the behavior when the new setting + is set to "cancel" and "all". + * gdb.cp/method2.exp, gdb.cp/templates.exp: Set multiple-symbols to + "ask" before we start the testing. + 2008-04-01 Aleksandar Ristovski * gdb.cp/casts.cc: Add class reference variables. diff --git a/gdb/testsuite/gdb.cp/method2.exp b/gdb/testsuite/gdb.cp/method2.exp index ea8e7f61be..11c0671793 100644 --- a/gdb/testsuite/gdb.cp/method2.exp +++ b/gdb/testsuite/gdb.cp/method2.exp @@ -62,6 +62,11 @@ proc test_break { lang } { } } +# We want in this test to double-check the contents of the multiple-choice +# menu that's printed when a breakpoint location is ambiguous. So we need +# to set multiple-symbols to "ask" first. +gdb_test "set multiple-symbols ask" "" + test_break "c" test_break "c++" diff --git a/gdb/testsuite/gdb.cp/ovldbreak.cc b/gdb/testsuite/gdb.cp/ovldbreak.cc index 9a5b5cbf7c..7aa1f2f53e 100644 --- a/gdb/testsuite/gdb.cp/ovldbreak.cc +++ b/gdb/testsuite/gdb.cp/ovldbreak.cc @@ -174,4 +174,11 @@ int foo::overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7, a10 = a11 = 0; return 11;} +void foo::foofunc (int a) +{ +} + +void foo::foofunc (int b, signed char *c) +{ +} diff --git a/gdb/testsuite/gdb.cp/ovldbreak.exp b/gdb/testsuite/gdb.cp/ovldbreak.exp index 5f66c6efea..88231fc232 100644 --- a/gdb/testsuite/gdb.cp/ovldbreak.exp +++ b/gdb/testsuite/gdb.cp/ovldbreak.exp @@ -132,7 +132,9 @@ proc set_bp_overloaded {name expectedmenu mychoice bpnumber linenumber} { set menu_overload1arg "\\\[0\\\] cancel\r\n\\\[1\\\] all\r\n\\\[2\\\] foo::overload1arg\\(double\\) at.*$srcfile:121\r\n\\\[3\\\] foo::overload1arg\\(float\\) at.*$srcfile:120\r\n\\\[4\\\] foo::overload1arg\\(unsigned long\\) at.*$srcfile:119\r\n\\\[5\\\] foo::overload1arg\\(long\\) at.*$srcfile:118\r\n\\\[6\\\] foo::overload1arg\\((unsigned int|unsigned)\\) at.*$srcfile:117\r\n\\\[7\\\] foo::overload1arg\\(int\\) at.*$srcfile:116\r\n\\\[8\\\] foo::overload1arg\\(unsigned short\\) at.*$srcfile:115\r\n\\\[9\\\] foo::overload1arg\\(short\\) at.*$srcfile:114\r\n\\\[10\\\] foo::overload1arg\\(unsigned char\\) at.*$srcfile:113\r\n\\\[11\\\] foo::overload1arg\\(signed char\\) at.*$srcfile:112\r\n\\\[12\\\] foo::overload1arg\\(char\\) at.*$srcfile:111\r\n\\\[13\\\] foo::overload1arg\\((void|)\\) at.*$srcfile:110\r\n> $" - +# Set multiple-symbols to "ask", to allow us to test the use +# of the multiple-choice menu when breaking on an overloaded method. +gdb_test "set multiple-symbols ask" "" # Set breakpoints on foo::overload1arg, one by one. @@ -351,7 +353,17 @@ continue_to_bp_overloaded 0 16 "unsigned long" "arg=10" continue_to_bp_overloaded 0 15 "float" "arg=100" continue_to_bp_overloaded 1 14 "double" "arg=200" +# Test breaking on an overloaded function when multiple-symbols +# is set to "cancel" +gdb_test "set multiple-symbols cancel" "" +gdb_test "break foo::foofunc" \ + "canceled.*" +# Test breaking on an overloaded function when multiple-symbols +# is set to "all" +gdb_test "set multiple-symbols all" "" +gdb_test "break foo::foofunc" \ + "Breakpoint \[0-9\]+ at ${hex}: file .*ovldbreak\\.cc, line \[0-9\]+\\.\r\nBreakpoint \[0-9\]+ at ${hex}: file .*ovldbreak\\.cc, line \[0-9\]+\\.\r\nwarning: Multiple breakpoints were set\\.\r\nUse the \"delete\" command to delete unwanted breakpoints\\." # That's all, folks. diff --git a/gdb/testsuite/gdb.cp/templates.exp b/gdb/testsuite/gdb.cp/templates.exp index 7fe2698c24..8734fdc2e9 100644 --- a/gdb/testsuite/gdb.cp/templates.exp +++ b/gdb/testsuite/gdb.cp/templates.exp @@ -210,6 +210,10 @@ proc do_tests {} { gdb_reinitialize_dir $srcdir/$subdir gdb_load $binfile + # Change multiple-symbols to "ask" in order to get the multiple-choice + # menu when breaking on overloaded methods. + gdb_test "set multiple-symbols ask" "" + runto_main test_ptype_of_templates