summaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
authorDavid Carlton <carlton@bactrian.org>2003-04-30 23:11:31 +0000
committerDavid Carlton <carlton@bactrian.org>2003-04-30 23:11:31 +0000
commite94aa4004a61c05e5da2e43b210c9fc44199d410 (patch)
tree1f6b0c4ba039cb024322f638160d92537dc10bfc /gdb/testsuite
parent5a2570e90db97164b8654ab8dc0f4e211a6deeff (diff)
downloadgdb-e94aa4004a61c05e5da2e43b210c9fc44199d410.tar.gz
2003-04-30 David Carlton <carlton@bactrian.org>
* Makefile.in (cp-namespace.o): Update dependencies. (cp-support.o): Ditto. * cp-support.h: Declare maint_cplus_cmd_list. * cp-namespace.c: Move variables namespace_block, possible_namespace_block, namespace_objfile here from cp-support.c. Move functions initialize_namespace_blocks, get_namespace_block, get_possible_namespace_block, free_namespace_blocks, check_one_possible_namespace_symbol, check_possible_namespace_symbols_loop, maintenance_print_namespace here from cp-support.c. Include objfiles.h, gdbtypes.h, dictionary.h, gdbcmd.h. * cp-namespace.c (_initialize_cp_namespace): New. (maintenance_cplus_namespace): Rename from maintenance_print_namespace. * cp-support.c (cp_find_first_component): Fix typo in comment. (_initialize_cp_support): Don't add 'maint print namespace'. Make maint_cplus_cmd_list extern. Prune includes. 2003-04-30 David Carlton <carlton@bactrian.org> * gdb.c++/maint.exp (test_help): Refactor, and add test for maint cp namespace. (test_namespace): New.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r--gdb/testsuite/ChangeLog6
-rw-r--r--gdb/testsuite/gdb.c++/maint.exp23
2 files changed, 25 insertions, 4 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 8776e7f57b8..9b31a200f2a 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2003-04-30 David Carlton <carlton@bactrian.org>
+
+ * gdb.c++/maint.exp (test_help): Refactor, and add test for maint
+ cp namespace.
+ (test_namespace): New.
+
2003-04-18 David Carlton <carlton@bactrian.org>
* gdb.c++/maint.exp (test_first_component): Add tests for
diff --git a/gdb/testsuite/gdb.c++/maint.exp b/gdb/testsuite/gdb.c++/maint.exp
index 3da1a5a6581..c61a790cdc4 100644
--- a/gdb/testsuite/gdb.c++/maint.exp
+++ b/gdb/testsuite/gdb.c++/maint.exp
@@ -29,13 +29,19 @@ if $tracelevel then {
# Test the help messages.
proc test_help {} {
- gdb_test "help maintenance cplus" "C\\+\\+ maintenance commands.\r\n\r\nList of maintenance cplus subcommands:\r\n\r\nmaintenance cplus first_component -- Print the first class/namespace component of NAME\r\n\r\nType \"help maintenance cplus\" followed by maintenance cplus subcommand name for full documentation.\r\nCommand name abbreviations are allowed if unambiguous."
+ set first_component_help "Print the first class/namespace component of NAME"
+ set namespace_help "Print the list of current known C\\+\\+ namespaces"
- gdb_test "help maint cp" "C\\+\\+ maintenance commands.\r\n\r\nList of maintenance cplus subcommands:\r\n\r\nmaintenance cplus first_component -- Print the first class/namespace component of NAME\r\n\r\nType \"help maintenance cplus\" followed by maintenance cplus subcommand name for full documentation.\r\nCommand name abbreviations are allowed if unambiguous."
+ set multiple_help_body "List of maintenance cplus subcommands:\r\n\r\nmaintenance cplus first_component -- ${first_component_help}\r\nmaintenance cplus namespace -- ${namespace_help}\r\n\r\nType \"help maintenance cplus\" followed by maintenance cplus subcommand name for full documentation.\r\nCommand name abbreviations are allowed if unambiguous."
- gdb_test "maint cp" "\"maintenance cplus\" must be followed by the name of a command.\r\nList of maintenance cplus subcommands:\r\n\r\nmaintenance cplus first_component -- Print the first class/namespace component of NAME\r\n\r\nType \"help maintenance cplus\" followed by maintenance cplus subcommand name for full documentation.\r\nCommand name abbreviations are allowed if unambiguous."
+ set help_maint_cp "C\\+\\+ maintenance commands.\r\n\r\n${multiple_help_body}"
- gdb_test "help maint cp first_component" "Print the first class/namespace component of NAME."
+ gdb_test "help maintenance cplus" "${help_maint_cp}"
+ gdb_test "help maint cp" "${help_maint_cp}"
+ gdb_test "maint cp" "\"maintenance cplus\" must be followed by the name of a command.\r\n${multiple_help_body}"
+
+ gdb_test "help maint cp first_component" "${first_component_help}."
+ gdb_test "help maint cp namespace" "${namespace_help}."
}
# This is used when NAME should contain only a single component. Be
@@ -74,11 +80,20 @@ proc test_first_component {} {
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> > >"
}
+proc test_namespace {} {
+ # FIXME: carlton/2003-04-28: I should think of more tests to add
+ # here. Unfortunately, it's hard to predict exactly what will be
+ # picked up from the library, or what order it will be in.
+
+ gdb_test "maint cp namespace" "Definite namespaces:\r\nPossible namespaces:"
+}
+
gdb_exit
gdb_start
test_help
test_first_component
+test_namespace
gdb_exit
return 0