aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite/gdb.base')
-rw-r--r--gdb/testsuite/gdb.base/completion.exp4
-rw-r--r--gdb/testsuite/gdb.base/help.exp59
-rw-r--r--gdb/testsuite/gdb.base/maint.exp23
3 files changed, 11 insertions, 75 deletions
diff --git a/gdb/testsuite/gdb.base/completion.exp b/gdb/testsuite/gdb.base/completion.exp
index 40102fa..8295e31 100644
--- a/gdb/testsuite/gdb.base/completion.exp
+++ b/gdb/testsuite/gdb.base/completion.exp
@@ -313,7 +313,7 @@ gdb_expect {
-re "^info $"\
{ send_gdb "\n"
gdb_expect {
- -re "\"info\" must be followed by the name of an info command\\.\r\nList of info subcommands:\r\n\r\n.*info address.*info watchpoints.*\r\n\r\nType \"help info\" followed by info subcommand name for full documentation.\r\nCommand name abbreviations are allowed if unambiguous\\..*$gdb_prompt $"\
+ -re "\"info\" must be followed by the name of an info command\\.\r\nList of info subcommands.*$gdb_prompt $"\
{ pass "complete 'info'"}
-re ".*$gdb_prompt $" { fail "complete 'info'"}
timeout {fail "(timeout) complete 'info'"}
@@ -329,7 +329,7 @@ gdb_expect {
-re "^info \\\x07$"\
{ send_gdb "\n"
gdb_expect {
- -re "\"info\" must be followed by the name of an info command\\.\r\nList of info subcommands:\r\n\r\n.*info address.*Type \"help info\" followed by info subcommand name for full documentation.\r\nCommand name abbreviations are allowed if unambiguous\\..*$gdb_prompt $"\
+ -re "\"info\" must be followed by the name of an info command\\.\r\nList of info subcommands:\r\n\r\n.*$gdb_prompt $"\
{ pass "complete 'info '"}
-re ".*$gdb_prompt $" { fail "complete 'info '"}
timeout {fail "(timeout) complete 'info '"}
diff --git a/gdb/testsuite/gdb.base/help.exp b/gdb/testsuite/gdb.base/help.exp
index f74fbea..a76bec7 100644
--- a/gdb/testsuite/gdb.base/help.exp
+++ b/gdb/testsuite/gdb.base/help.exp
@@ -30,65 +30,6 @@ set bug_id 0
gdb_start
-# Test the output of GDB_COMMAND matches the pattern obtained
-# by concatenating all elements of EXPECTED_LINES. This makes
-# it possible to split otherwise very long string into pieces.
-# If third argument is not empty, it's used as the name of the
-# test to be printed on pass/fail.
-proc help_test_raw { gdb_command expected_lines args } {
- set message $gdb_command
- if [llength $args]>0 then {
- set message [lindex $args 0]
- }
- set expected_output [join $expected_lines ""]
- gdb_test "${gdb_command}" "${expected_output}" $message
-}
-
-# Test the output of "help COMMNAD_CLASS". EXPECTED_INITIAL_LINES
-# are regular expressions that should match the beginning of output,
-# before the list of commands in that class. The presence of
-# command list and standard epilogue will be tested automatically.
-proc test_class_help { command_class expected_initial_lines } {
- set l_stock_body {
- "List of commands\:.*\[\r\n\]+"
- "Type \"help\" followed by command name for full documentation\.\[\r\n\]+"
- "Type \"apropos word\" to search for commands related to \"word\"\.[\r\n\]+"
- "Command name abbreviations are allowed if unambiguous\."
- }
- set l_entire_body [concat $expected_initial_lines $l_stock_body]
- help_test_raw "help ${command_class}" $l_entire_body
-}
-
-# COMMAND_LIST should have either one element -- command to test, or
-# two elements -- abbreviated command to test, and full command the first
-# element is abbreviation of.
-# The command must be a prefix command. EXPECTED_INITIAL_LINES
-# are regular expressions that should match the beginning of output,
-# before the list of subcommands. The presence of
-# subcommand list and standard epilogue will be tested automatically.
-proc test_prefix_command_help { command_list expected_initial_lines args } {
- set command [lindex $command_list 0]
- if {[llength $command_list]>1} {
- set full_command [lindex $command_list 1]
- } else {
- set full_command $command
- }
- # Use 'list' and not just {} because we want variables to
- # be expanded in this list.
- set l_stock_body [list\
- "List of $full_command subcommands\:.*\[\r\n\]+"\
- "Type \"help $full_command\" followed by $full_command subcommand name for full documentation\.\[\r\n\]+"\
- "Type \"apropos word\" to search for commands related to \"word\"\.\[\r\n\]+"\
- "Command name abbreviations are allowed if unambiguous\."]
- set l_entire_body [concat $expected_initial_lines $l_stock_body]
- if {[llength $args]>0} {
- help_test_raw "help ${command}" $l_entire_body [lindex $args 0]
- } else {
- help_test_raw "help ${command}" $l_entire_body
- }
-}
-
-
# force the height of the debugger to be pretty large so no pagers getused
gdb_test "set height 400" "" "test set height"
diff --git a/gdb/testsuite/gdb.base/maint.exp b/gdb/testsuite/gdb.base/maint.exp
index bbbd262..f3fe9de 100644
--- a/gdb/testsuite/gdb.base/maint.exp
+++ b/gdb/testsuite/gdb.base/maint.exp
@@ -679,21 +679,16 @@ gdb_expect {
timeout { fail "(timeout) help maint info" }
}
-send_gdb "help maint print\n"
-gdb_expect {
- -re "Maintenance command for printing GDB internal state\\.\[\r\n\]+List of maintenance print subcommands:\[\r\n\]+maintenance print architecture -- Print the internal architecture configuration.*maintenance print msymbols -- Print dump of current minimal symbol definitions.*maintenance print objfiles -- Print dump of current object file definitions.*maintenance print psymbols -- Print dump of current partial symbol definitions.*maintenance print statistics -- Print statistics about internal gdb state.*maintenance print symbols -- Print dump of current symbol definitions.*maintenance print type -- Print a type chain for a given symbol.*Type .help maintenance print. followed by maintenance print subcommand name for full documentation\\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\\..*$gdb_prompt $"\
- { pass "help maint print" }
- -re ".*$gdb_prompt $" { fail "help maint print" }
- timeout { fail "(timeout) help maint print" }
- }
+test_prefix_command_help {"maint print" "maintenance print"} {
+ "Maintenance command for printing GDB internal state\\.\[\r\n\]+"
+}
-send_gdb "help maint\n"
-gdb_expect {
- -re "Commands for use by GDB maintainers\\.\[\r\n\]+Includes commands to dump specific internal GDB structures in\[\r\n\]+a human readable form, to cause GDB to deliberately dump core,\[\r\n\]+to test internal functions such as the C\\+\\+/ObjC demangler, etc\\..*Type.*help maintenance.*followed by maintenance subcommand name for full documentation\\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\\..*$gdb_prompt $"\
- { pass "help maint" }
- -re ".*$gdb_prompt $" { fail "help maint" }
- timeout { fail "(timeout) help maint" }
- }
+test_prefix_command_help {"maint" "maintenance"} {
+ "Commands for use by GDB maintainers\\.\[\r\n\]+"
+ "Includes commands to dump specific internal GDB structures in\[\r\n\]+"
+ "a human readable form, to cause GDB to deliberately dump core,\[\r\n\]+"
+ "to test internal functions such as the C\\+\\+/ObjC demangler, etc\\.\[\r\n\]+"
+}
#set oldtimeout $timeout
#set timeout [expr $timeout + 300]