aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
authorDavid Carlton <carlton@bactrian.org>2003-06-30 16:21:16 +0000
committerDavid Carlton <carlton@bactrian.org>2003-06-30 16:21:16 +0000
commitb2a7f303a272232ff87fa82f7d1cd23377ef0b01 (patch)
tree3e0da34849df637f74037153079c4bbe690789ef /gdb/testsuite
parenta257b5bbf7a6dc411e3b2602e485e114f88d8203 (diff)
downloadgdb-b2a7f303a272232ff87fa82f7d1cd23377ef0b01.zip
gdb-b2a7f303a272232ff87fa82f7d1cd23377ef0b01.tar.gz
gdb-b2a7f303a272232ff87fa82f7d1cd23377ef0b01.tar.bz2
2003-06-30 David Carlton <carlton@kealia.com>
Band-aid for PR c++/1245. * Makefile.in (cp-support.o): Depend on complaints_h. * cp-support.c: Include complaints.h. Add declaration for find_last_component. (cp_find_first_component): Separate code into cp_find_first_component_aux. (cp_find_first_component_aux): Call demangled_name_complaint. (demangled_name_complaint): New. 2003-06-30 David Carlton <carlton@kealia.com> * gdb.c++/maint.exp (test_invalid_name): New. (test_first_component): Add tests for invalid names.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r--gdb/testsuite/ChangeLog5
-rw-r--r--gdb/testsuite/gdb.c++/maint.exp22
2 files changed, 27 insertions, 0 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index fbd9483..f33dbde 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2003-06-30 David Carlton <carlton@kealia.com>
+
+ * gdb.c++/maint.exp (test_invalid_name): New.
+ (test_first_component): Add tests for invalid names.
+
2003-06-29 Michael Chastain <mec@shout.net>
* gdb.c++/inherit.exp (test_print_svi_classes): Accept gdb
diff --git a/gdb/testsuite/gdb.c++/maint.exp b/gdb/testsuite/gdb.c++/maint.exp
index a0f15f9..1042c91 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<A>::bar" "C<A>"
gdb_test "maint cp first_component C<std::basic_streambuf<wchar_t,std::char_traits<wchar_t> > >::bar" "C<std::basic_streambuf<wchar_t,std::char_traits<wchar_t> > >"
+
+ # 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<<char>"
}
gdb_exit