X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=gdb%2Ftestsuite%2Fgdb.c%2B%2B%2Fmaint.exp;h=1042c913ceb76057149f7510b99f6a950c30e18f;hb=b2a7f303a272232ff87fa82f7d1cd23377ef0b01;hp=a0f15f96bc5f65143d5aee2786e1041e1c736d76;hpb=a257b5bbf7a6dc411e3b2602e485e114f88d8203;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/testsuite/gdb.c++/maint.exp b/gdb/testsuite/gdb.c++/maint.exp index a0f15f96bc..1042c913ce 100644 --- a/gdb/testsuite/gdb.c++/maint.exp +++ b/gdb/testsuite/gdb.c++/maint.exp @@ -45,7 +45,19 @@ proc test_single_component {name} { gdb_test "maint cp first_component $name" "$matchname" } +# This is used when NAME is invalid. +proc test_invalid_name {name} { + set matchname [string_to_regexp "$name"] + gdb_test "maint cp first_component $name" \ + "During symbol reading, unexpected demangled name '$matchname'.\r\n$matchname" +} + proc test_first_component {} { + # The function in question might complain; make sure that we see + # all complaints. + + gdb_test "set complaints -1" "" + test_single_component "foo" test_single_component "operator<<" test_single_component "operator>>" @@ -79,6 +91,16 @@ proc test_first_component {} { gdb_test "maint cp first_component foo::bar::baz" "foo" gdb_test "maint cp first_component C::bar" "C" gdb_test "maint cp first_component C > >::bar" "C > >" + + # Make sure we behave appropriately on invalid input. + + # NOTE: carlton/2003-06-25: As of today, the demangler can in fact + # produce examples like the third case below: there really should + # be a space between the two <'s. See PR gdb/1245. + + test_invalid_name "foo<" + test_invalid_name "foo(" + test_invalid_name "bool operator<" } gdb_exit