Fix/improve 'apropos' output
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / help.exp
index 9316a705b1a5529f3001a39ce5266bad03183516..8ed0be45dbc3a62f3decf06a5c823bb000382b95 100644 (file)
@@ -21,7 +21,7 @@
 
 gdb_start
 
-# disable pagination
+# Disable pagination.
 gdb_test_no_output "set height 0" "disable pagination"
 
 # Test all the help classes.
@@ -61,30 +61,30 @@ with_read1_timeout_factor 10 {
 
     # Test help of an abbreviated command.  "break" is picked at random.
     set help_breakpoint_text "Set breakpoint at specified location\..*"
-    # test help breakpoint "b" abbreviation
+    # Test help breakpoint "b" abbreviation.
     gdb_test "help b" $help_breakpoint_text "help breakpoint \"b\" abbreviation"
-    # test help breakpoint "br" abbreviation
+    # Test help breakpoint "br" abbreviation.
     gdb_test "help br" $help_breakpoint_text "help breakpoint \"br\" abbreviation"
-    # test help breakpoint "bre" abbreviation
+    # Test help breakpoint "bre" abbreviation;
     gdb_test "help bre" $help_breakpoint_text "help breakpoint \"bre\" abbreviation"
-    # test help breakpoint "brea" abbreviation
+    # Test help breakpoint "brea" abbreviation.
 }
 gdb_test "help brea" $help_breakpoint_text "help breakpoint \"brea\" abbreviation"
-# test help breakpoint "break" abbreviation
+# Test help breakpoint "break" abbreviation.
 gdb_test "help break" $help_breakpoint_text "help breakpoint \"break\" abbreviation"
 
 # Test help of an aliased command.  "bt" is picked at random.
 set help_backtrace_text "Print backtrace of all stack frames, or innermost COUNT frames\..*"
-# test help backtrace "bt" abbreviation
+# Test help backtrace "bt" abbreviation.
 gdb_test "help bt" $help_backtrace_text "help backtrace \"bt\" abbreviation"
-# test help backtrace
+# Test help backtrace.
 gdb_test "help backtrace" $help_backtrace_text
 
-# test help commands
+# Test help commands.
 gdb_test "help commands" "Set commands to be executed when the given breakpoints are hit\.\[\r\n\]+Give a space-separated breakpoint list as argument after \"commands\"\.\[\r\n\]+A list element can be a breakpoint number \\(e.g. `5'\\) or a range of numbers\[\r\n\]+\\(e.g. `5-7'\\)\.\[\r\n\]+With no argument, the targeted breakpoint is the last one set\.\[\r\n\]+The commands themselves follow starting on the next line\.\[\r\n\]+Type a line containing \"end\" to indicate the end of them\.\[\r\n\]+Give \"silent\" as the first line to make the breakpoint silent;\[\r\n\]+then no output is printed when it is hit, except what the commands print\."
 
 # Test a prefix command.  "delete" is picked at random.
-# test help delete "d" abbreviation
+# Test help delete "d" abbreviation.
 set expected_help_delete {
     "Delete all or some breakpoints\.\[\r\n\]+"
     "Usage: delete \\\[BREAKPOINTNUM\\\]...\[\r\n\]+"
@@ -93,36 +93,43 @@ set expected_help_delete {
     "Also a prefix command for deletion of other GDB objects\.\[\r\n\]+"
 }
 test_prefix_command_help {"d" "delete"} $expected_help_delete "help delete \"d\" abbreviation"
-# test help delete
+# Test help delete.
 test_prefix_command_help "delete" $expected_help_delete
 
 # Make sure help for help itself is present.
-# test help help "h" abbreviation 
+# Test help help "h" abbreviation.
 gdb_test "help h" "Print list of commands\." "help help \"h\" abbreviation"
-# test help help
+# Test help help.
 gdb_test "help help" "Print list of commands\."
 
 # The startup banner refers to "show copying" and "show warranty",
 # might as well test for them.
-# test help info copying
+# Test help info copying.
 gdb_test "help show copying" "Conditions for redistributing copies of GDB\."
-# test help info warranty
+# Test help info warranty.
 gdb_test "help show warranty" "Various kinds of warranty you do not have\."
 
 # Test a few other random "help show" commands.
-# test help show commands
+# Test help show commands.
 gdb_test "help show commands" "Show the history of commands you typed\.\[\r\n\]+You can supply a command number to start with, or a `\[+\]' to start after\[\r\n\]+the previous command number shown\."
-# test help show confirm
+# Test help show confirm.
 gdb_test "help show confirm" "Show whether to confirm potentially dangerous operations\."
 
-# test help info bogus-gdb-command
+# Test help info bogus-gdb-command.
 gdb_test "help info bogus-gdb-command" "Undefined info command: \"bogus-gdb-command\"\.  Try \"help info\"\."
-# test help gotcha
+# Test help gotcha.
 gdb_test "help gotcha" "Undefined command: \"gotcha\"\.  Try \"help\"\."
 
-# test apropos regex
+# Test apropos regex.
 gdb_test "apropos \\\(print\[\^\[ bsiedf\\\".-\]\\\)" "handle -- Specify how to handle signals\."
-# test apropos >1 word string
+# Test apropos >1 word string.
 gdb_test "apropos handle signal" "handle -- Specify how to handle signals\."
-# test apropos apropos
+# Test apropos apropos.
 gdb_test "apropos apropos" "apropos -- Search for commands matching a REGEXP.*"
+
+# Test apropos for commands having aliases.
+gdb_test "apropos Print backtrace of all stack frames, or innermost COUNT frames\." \
+    "backtrace, where, bt -- Print backtrace of all stack frames, or innermost COUNT frames\."
+
+# Test help for commands having aliases.
+gdb_test "help bt" "backtrace, where, bt\[\r\n\]+Print backtrace of all stack frames, or innermost COUNT frames\..*"
This page took 0.025681 seconds and 4 git commands to generate.