From eae06beb6db690f1ea741c390eb6a5bd71f5f816 Mon Sep 17 00:00:00 2001 From: Joel Brobecker Date: Thu, 3 Apr 2008 21:42:33 +0000 Subject: [PATCH] * 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. --- gdb/testsuite/ChangeLog | 9 +++++++++ gdb/testsuite/gdb.cp/method2.exp | 5 +++++ gdb/testsuite/gdb.cp/ovldbreak.cc | 7 +++++++ gdb/testsuite/gdb.cp/ovldbreak.exp | 16 ++++++++++++++-- gdb/testsuite/gdb.cp/templates.exp | 4 ++++ 5 files changed, 39 insertions(+), 2 deletions(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index d510e16c91c..7e991468b0c 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 ea8e7f61be6..11c06717938 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 9a5b5cbf7c7..7aa1f2f53ee 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 5f66c6efea3..88231fc232e 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 7fe2698c24c..8734fdc2e91 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 -- 2.30.2