From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28158 invoked by alias); 6 Nov 2006 07:34:40 -0000 Received: (qmail 28131 invoked by uid 22791); 6 Nov 2006 07:34:36 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 06 Nov 2006 07:34:30 +0000 Received: (qmail 32106 invoked from network); 6 Nov 2006 07:34:25 -0000 Received: from unknown (HELO ?172.16.64.38?) (vladimir@127.0.0.2) by mail.codesourcery.com with ESMTPA; 6 Nov 2006 07:34:25 -0000 From: Vladimir Prus To: gdb-patches@sources.redhat.com Subject: Fix help.exp User-Agent: KMail/1.9.1 MIME-Version: 1.0 X-Length: 42311 X-UID: 13081 Date: Mon, 06 Nov 2006 07:34:00 -0000 Content-Type: Multipart/Mixed; boundary="Boundary-00=_3VuTFT8ZwYRcMKD" Message-Id: <200611061034.15861.vladimir@codesourcery.com> Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-11/txt/msg00026.txt.bz2 --Boundary-00=_3VuTFT8ZwYRcMKD Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Content-length: 585 As I've said before, my changes to the "help" command has broken help.exp tests and some others. This patch fixes help.exp failrues. It also introduces some new functions to help make the tests readable and remove duplication. The taken approach is the one outlined in: http://sources.redhat.com/ml/gdb/2006-11/msg00001.html namely that we should not bother to test the explicit list of subcommands, because that does not help anything. OK? - Volodya * gdb.base/help.exp (help_test_raw): New. (test_class_help): New. (test_prefix_command_help): New. Adjust testcases. --Boundary-00=_3VuTFT8ZwYRcMKD Content-Type: text/x-diff; charset="us-ascii"; name="help.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="help.diff" Content-length: 39767 Index: help.exp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/src/gdb/testsuite/gdb.base/help.exp,v retrieving revision 1.22 diff -u -r1.22 help.exp --- help.exp 21 Jul 2006 14:46:56 -0000 1.22 +++ help.exp 6 Nov 2006 07:31:57 -0000 @@ -30,6 +30,65 @@ =20 gdb_start =20 +# 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] + }=20 + 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=20 +# 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\."=20 + } + 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=20 +# 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]=20=20=20 + if [llength $command_list]>1 then {=20=20=20=20=20=20=20=20 + 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 then { + 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" =20 @@ -39,7 +98,8 @@ # test help advance gdb_test "help advance" "Continue the program up to the given location \\(= same form as args for break command\\)\.\[\r\n]+Execution will also stop up= on exit from the current stack frame\." "help advance" # test help aliases -gdb_test "help aliases" "Aliases of other commands\.\[\r\n\]+List of comma= nds\:.*\[\r\n\]+Type \"help\" followed by command name for full documentati= on\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\." "help= aliases" +test_class_help "aliases" {"Aliases of other commands\.\[\r\n\]+"} + # test help append gdb_test "help append" "Append target code/data to a local file\.\[\r\n\]+= List of append subcommands:.*"=20 gdb_test "help append binary" "Append target code/data to a raw binary fil= e\.\[\r\n\]+List of append binary subcommands:.*"=20 @@ -60,7 +120,7 @@ # test help breakpoint "break" abbreviation gdb_test "help break" "Set breakpoint at specified line or function\.\[\r\= n\]+break \\\[LOCATION\] \\\[thread THREADNUM\] \\\[if CONDITION\]\[\r\n\]+= LOCATION may be a line number, function name, or \"\[*\]\" and an address\.= \[\r\n\]+If a line number is specified, break at start of code for that lin= e\.\[\r\n\]+If a function is specified, break at start of code for that fun= ction\.\[\r\n\]+If an address is specified, break at that exact address\.\[= \r\n\]+With no LOCATION, uses current execution address of selected stack f= rame\.\[\r\n\]+This is useful for breaking on return to a stack frame\.\[\r= \n\]+THREADNUM is the number from \"info threads\"\.\[\r\n\]+CONDITION is a= boolean expression\.\[\r\n\]+Multiple breakpoints at one place are permitt= ed, and useful if conditional\.\[\r\n\]+Do \"help breakpoints\" for info on= other commands dealing with breakpoints\." "help breakpoint \"break\" abbr= eviation" # test help breakpoints -gdb_test "help breakpoints" "Making program stop at certain points\.\[\r\n= \]+List of commands:\[\r\n\]+awatch -- Set a watchpoint for an expression\[= \r\n\]+break -- Set breakpoint at specified line or function\[\r\n\]+catch = -- Set catchpoints to catch events\[\r\n\]+clear -- Clear breakpoint at spe= cified line or function\[\r\n\]+commands -- Set commands to be executed whe= n a breakpoint is hit\[\r\n\]+condition -- Specify breakpoint number N to b= reak only if COND is true\[\r\n\]+delete -- Delete some breakpoints or auto= -display expressions\[\r\n\]+disable -- Disable some breakpoints\[\r\n\]+en= able -- Enable some breakpoints\[\r\n\]+hbreak -- Set a hardware assisted = breakpoint\[\r\n\]+ignore -- Set ignore-count of breakpoint number N to COU= NT\[\r\n\]+rbreak -- Set a breakpoint for all functions matching REGEXP\[\r= \n\]+rwatch -- Set a read watchpoint for an expression\[\r\n\]+tbreak -- Se= t a temporary breakpoint\[\r\n\]+tcatch -- Set temporary catchpoints to cat= ch events\[\r\n\]+thbreak -- Set a temporary hardware assisted breakpoint\[= \r\n\]+watch -- Set a watchpoint for an expression\[\r\n\]+Type \"help\" fo= llowed by command name for full documentation\.\[\r\n\]+Command name abbrev= iations are allowed if unambiguous\." "help breakpoints" +test_class_help "breakpoints" {"Making program stop at certain points\.\[\= r\n\]+"} # test help backtrace "bt" abbreviation gdb_test "help bt" "Print backtrace of all stack frames, or innermost COUN= T frames\.\[\r\n\]+With a negative argument, print outermost -COUNT frames\= .\[\r\n\]+Use of the 'full' qualifier also prints the values of the local v= ariables\." "help backtrace \"bt\" abbreviation" # test help backtrace @@ -84,11 +144,18 @@ # test help core-file gdb_test "help core-file" "Use FILE as core dump for examining memory and = registers\.\[\r\n\]+No arg means have no core file\. This command has been= superseded by the\[\r\n\]+`target core' and `detach' commands\." "help cor= e-file" # test help delete "d" abbreviation -gdb_test "help d" "Delete some breakpoints or auto-display expressions\.\[= \r\n\]+Arguments are breakpoint numbers with spaces in between\.\[\r\n\]+To= delete all breakpoints, give no argument\.\[\r\n\]+Also a prefix command f= or deletion of other GDB objects\.\[\r\n\]+The \"unset\" command is also an= alias for \"delete\"\.\[\r\n\]+List of delete subcommands:\[\r\n\]+delete = breakpoints -- Delete some breakpoints or auto-display expressions\[\r\n\]+= (delete checkpoint -- Delete a fork/checkpoint \\(experimental\\)\[\r\n\]+)= ?delete display -- Cancel some expressions to be displayed when program sto= ps\[\r\n\]+delete mem -- Delete memory region\[\r\n\]+delete tracepoints --= Delete specified tracepoints\[\r\n\]+Type \"help delete\" followed by dele= te subcommand name for full documentation\.\[\r\n\]+Command name abbreviati= ons are allowed if unambiguous\." "help delete \"d\" abbreviation" +set expected_help_delete { + "Delete some breakpoints or auto-display expressions\.\[\r\n\]+" + "Arguments are breakpoint numbers with spaces in between\.\[\r\n\]+" + "To delete all breakpoints, give no argument\.\[\r\n\]+" + "Also a prefix command for deletion of other GDB objects\.\[\r\n\]+" + "The \"unset\" command is also an alias for \"delete\"\.\[\r\n\]+" +} +test_prefix_command_help {"d" "delete"} $expected_help_delete "help delete= \"d\" abbreviation" # test help delete -gdb_test "help delete" "Delete some breakpoints or auto-display expression= s\.\[\r\n\]+Arguments are breakpoint numbers with spaces in between\.\[\r\n= \]+To delete all breakpoints, give no argument\.\[\r\n\]+Also a prefix comm= and for deletion of other GDB objects\.\[\r\n\]+The \"unset\" command is al= so an alias for \"delete\"\.\[\r\n\]+List of delete subcommands:\[\r\n\]+de= lete breakpoints -- Delete some breakpoints or auto-display expressions\[\r= \n\]+(delete checkpoint -- Delete a fork/checkpoint \\(experimental\\)\[\r\= n\]+)?delete display -- Cancel some expressions to be displayed when progra= m stops\[\r\n\]+delete mem -- Delete memory region\[\r\n\]+delete tracepoin= ts -- Delete specified tracepoints\[\r\n\]+Type \"help delete\" followed by= delete subcommand name for full documentation\.\[\r\n\]+Command name abbre= viations are allowed if unambiguous\." "help delete" +test_prefix_command_help "delete" $expected_help_delete # test help data -gdb_test "help data" "Examining data\.\[\r\n\]+List of commands:.*\[\r\n\]= +Type \"help\" followed by command name for full documentation\.\[\r\n\]+Co= mmand name abbreviations are allowed if unambiguous\." "help data" +test_class_help "data" {"Examining data\.\[\r\n\]+"} # test help define gdb_test "help define" "Define a new command.*" "help define" # test help delete breakpoints @@ -96,15 +163,25 @@ # test help delete display gdb_test "help delete display" "Cancel some expressions to be displayed wh= en program stops\.\[\r\n\]+Arguments are the code numbers of the expression= s to stop displaying\.\[\r\n\]+No argument means cancel all automatic-displ= ay expressions\.\[\r\n\]+Do \"info display\" to see current list of code nu= mbers\." "help delete display" # test help detach -gdb_test "help detach" "Detach a process or file previously attached\.\[\r= \n\]+If a process, it is no longer traced, and it continues its execution\.= \[ \r\n\]+If\[ \r\n\]+you were debugging a file, the file is closed and gdb= no longer accesses it\." "help detach" +test_prefix_command_help "detach" { + "Detach a process or file previously attached\.\[\r\n\]+" + "If a process, it is no longer traced, and it continues its execution\= .\[ \r\n\]+If\[ \r\n\]+" + "you were debugging a file, the file is closed and gdb no longer acces= ses it\.\[ \r\n\]+" +} # test help directory gdb_test "help directory" "Add directory DIR to beginning of search path f= or source files\.\[\r\n\]+Forget cached info on source file locations and l= ine positions\.\[\r\n\]+DIR can also be \\\$cwd for the current working dir= ectory, or \\\$cdir for the\[\r\n\]+directory in which the source file was = compiled into object code\.\[\r\n\]+With no argument, reset the search path= to \\\$cdir:\\\$cwd, the default\." "help directory" # test help disable "dis" abbreviation -gdb_test "help dis" "Disable some breakpoints\.\[\r\n\]+Arguments are brea= kpoint numbers with spaces in between\.\[\r\n\]+To disable all breakpoints,= give no argument\.\[\r\n\]+A disabled breakpoint is not forgotten, but has= no effect until reenabled\.\[\r\n\]+List of disable subcommands:\[\r\n\]+d= isable breakpoints -- Disable some breakpoints\[\r\n\]+disable display -- D= isable some expressions to be displayed when program stops\[\r\n\]+disable = mem -- Disable memory region\[\r\n\]+disable tracepoints -- Disable specifi= ed tracepoints\[\r\n\]+Type \"help disable\" followed by disable subcommand= name for full documentation\.\[\r\n\]+Command name abbreviations are allow= ed if unambiguous\." "help disable \"dis\" abbreviation" +set expected_help_disable { + "Disable some breakpoints\.\[\r\n\]+" + "Arguments are breakpoint numbers with spaces in between\.\[\r\n\]+" + "To disable all breakpoints, give no argument\.\[\r\n\]+" + "A disabled breakpoint is not forgotten, but has no effect until reena= bled\.\[\r\n\]+" +} +test_prefix_command_help {"dis" "disable"} $expected_help_disable "help di= sable \"dis\" abbreviation" # test help disable "disa" abbreviation -gdb_test "help disa" "Disable some breakpoints\.\[\r\n\]+Arguments are bre= akpoint numbers with spaces in between\.\[\r\n\]+To disable all breakpoints= , give no argument\.\[\r\n\]+A disabled breakpoint is not forgotten, but ha= s no effect until reenabled\.\[\r\n\]+List of disable subcommands:\[\r\n\]+= disable breakpoints -- Disable some breakpoints\[\r\n\]+disable display -- = Disable some expressions to be displayed when program stops\[\r\n\]+disable= mem -- Disable memory region\[\r\n\]+disable tracepoints -- Disable specif= ied tracepoints\[\r\n\]+Type \"help disable\" followed by disable subcomman= d name for full documentation\.\[\r\n\]+Command name abbreviations are allo= wed if unambiguous\." "help disable \"disa\" abbreviation" +test_prefix_command_help {"disa" "disable"} $expected_help_disable "help d= isable \"disa\" abbreviation" # test help disable -gdb_test "help disable" "Disable some breakpoints\.\[\r\n\]+Arguments are = breakpoint numbers with spaces in between\.\[\r\n\]+To disable all breakpoi= nts, give no argument\.\[\r\n\]+A disabled breakpoint is not forgotten, but= has no effect until reenabled\.\[\r\n\]+List of disable subcommands:\[\r\n= \]+disable breakpoints -- Disable some breakpoints\[\r\n\]+disable display = -- Disable some expressions to be displayed when program stops\[\r\n\]+disa= ble mem -- Disable memory region\[\r\n\]+disable tracepoints -- Disable spe= cified tracepoints\[\r\n\]+Type \"help disable\" followed by disable subcom= mand name for full documentation\.\[\r\n\]+Command name abbreviations are a= llowed if unambiguous\." "help disable" +test_prefix_command_help "disable" $expected_help_disable # test help disable breakpoints gdb_test "help disable breakpoints" "Disable some breakpoints\.\[\r\n\]+Ar= guments are breakpoint numbers with spaces in between\.\[\r\n\]+To disable = all breakpoints, give no argument\.\[\r\n\]+A disabled breakpoint is not fo= rgotten, but has no effect until reenabled\.\[\r\n\]+This command may be ab= breviated \"disable\"." "help disable breakpoints" # test help disable display @@ -150,7 +227,12 @@ # test help enable breakpoints once gdb_test "help enable breakpoints once" "Enable breakpoints for one hit.*"= "help enable breakpoints once" # test help enable breakpoints -gdb_test "help enable breakpoints" "Enable some breakpoints\.\[\r\n\]+Give= breakpoint numbers \\(separated by spaces\\) as arguments\.\[\r\n\]+This i= s used to cancel the effect of the \"disable\" command\.\[\r\n\]+May be abb= reviated to simply \"enable\"\.\[\r\n\]+List of enable breakpoints subcomma= nds:\[\r\n\]+enable breakpoints delete -- Enable breakpoints and delete whe= n hit\[\r\n\]+enable breakpoints once -- Enable breakpoints for one hit\[\r= \n\]+Type \"help enable breakpoints\" followed by enable breakpoints subcom= mand name for full documentation\.\[\r\n\]+Command name abbreviations are a= llowed if unambiguous\." "help enable breakpoints" +test_prefix_command_help {"enable breakpoints"} { + "Enable some breakpoints\.\[\r\n\]+" + "Give breakpoint numbers \\(separated by spaces\\) as arguments\.\[\r\= n\]+" + "This is used to cancel the effect of the \"disable\" command\.\[\r\n\= ]+" + "May be abbreviated to simply \"enable\"\.\[\r\n\]+" +} # test help enable delete gdb_test "help enable delete" "Enable breakpoints and delete when hit\. G= ive breakpoint numbers\.\[\r\n\]+If a breakpoint is hit while enabled in th= is fashion, it is deleted\." "help enable delete" # test help enable display @@ -158,7 +240,13 @@ # test help enable once gdb_test "help enable once" "Enable breakpoints for one hit.*" "help enabl= e once" # test help enable -gdb_test "help enable" "Enable some breakpoints\.\[\r\n\]+Give breakpoint = numbers \\(separated by spaces\\) as arguments\.\[\r\n\]+With no subcommand= , breakpoints are enabled until you command otherwise\.\[\r\n\]+This is use= d to cancel the effect of the \"disable\" command\.\[\r\n\]+With a subcomma= nd you can enable temporarily\.\[\r\n\]+List of enable subcommands:\[\r\n\]= +enable delete -- Enable breakpoints and delete when hit\[\r\n\]+enable dis= play -- Enable some expressions to be displayed when program stops\[\r\n\]+= enable mem -- Enable memory region\[\r\n\]+enable once -- Enable breakpoint= s for one hit\[\r\n\]+enable tracepoints -- Enable specified tracepoints\[\= r\n\]+Type \"help enable\" followed by enable subcommand name for full docu= mentation\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\.= " "help enable" +test_prefix_command_help "enable" { + "Enable some breakpoints\.\[\r\n\]+" + "Give breakpoint numbers \\(separated by spaces\\) as arguments\.\[\r\= n\]+" + "With no subcommand, breakpoints are enabled until you command otherwi= se.\.\[\r\n\]+" + "This is used to cancel the effect of the \"disable\" command\.\[\r\n\= ]+" + "With a subcommand you can enable temporarily\.\[\r\n\]+" +} # test help exec-file gdb_test "help exec-file" "Use FILE as program for getting contents of pur= e memory\.\[\r\n\]+If FILE cannot be found as specified, your execution dir= ectory path\[\r\n\]+is searched for a command of that name\.\[\r\n\]+No arg= means have no executable file\." "help exec-file" # test help frame "f" abbreviation @@ -203,9 +291,13 @@ # test help handle gdb_test "help handle" "Specify how to handle a signal\..*" "help handle" # test help info "i" abbreviation -gdb_test "help i" "Generic command for showing things about the program be= ing debugged\.\[\r\n\]+List of info subcommands:.*\[\r\n\]+Type \"help info= \" followed by info subcommand name for full documentation\.\[\r\n\]+Comman= d name abbreviations are allowed if unambiguous\." "help info \"i\" abbrevi= ation" +test_prefix_command_help {"i" "info"} { + "Generic command for showing things about the program being debugged\.= \[\r\n\]+" +} "help info \"i\" abbreviation" # test help info -gdb_test "help info" "Generic command for showing things about the program= being debugged\.\[\r\n\]+List of info subcommands:.*\[\r\n\]+Type \"help i= nfo\" followed by info subcommand name for full documentation\.\[\r\n\]+Com= mand name abbreviations are allowed if unambiguous\." "help info" +test_prefix_command_help "info" { + "Generic command for showing things about the program being debugged\.= \[\r\n\]+" +} # test help ignore gdb_test "help ignore" "Set ignore-count of breakpoint number N to COUNT\.= \[\r\n\]+Usage is `ignore N COUNT'\." "help ignore" # test help info address @@ -288,7 +380,9 @@ gdb_test "help ni" "Step one instruction, but proceed through subroutine c= alls\.\[\r\n\]+Argument N means do this N times \\(or till program stops fo= r another reason\\)\." "help nexti" # all the commands that used to be here are now in "maintainance" instead # test help obscure -gdb_test "help obscure" "Obscure features\.\[\r\n\]+List of commands:.*\[\= r\n\]+Type \"help\" followed by command name for full documentation\.\[\r\n= \]+Command name abbreviations are allowed if unambiguous\." "help obscure" +test_class_help "obscure" { + "Obscure features\.\[\r\n\]+" +} # test help output gdb_test "help output" "Like \"print\" but don't put in value history and = don't print newline\.\[\r\n\]+This is useful in user-defined commands\." "h= elp output" # test help overlay @@ -331,7 +425,9 @@ # test help reverse-search gdb_test "help reverse-search" "Search backward for regular expression \\(= see regex\\(3\\)\\) from last line listed\..*" "help reverse-search" # test help running -gdb_test "help running" "Running the program\.\[\r\n\]+List of commands:.*= \[\r\n\]+Type \"help\" followed by command name for full documentation\.\[\= r\n\]+Command name abbreviations are allowed if unambiguous\." "help runnin= g" +test_class_help "running" { + "Running the program\.\[\r\n\]+" +} # test help step "s" abbreviation gdb_test "help s" "Step program until it reaches a different source line\.= \[\r\n\]+Argument N means do this N times \\(or till program stops for anot= her reason\\)\." "help step \"s\" abbreviation" # test help step @@ -345,11 +441,17 @@ # test help set args gdb_test "help set args" "Set argument list to give program being debugged= when it is started\.\[\r\n\]+Follow this command with any number of args, = to be passed to the program\." # test help set check "c" abbreviation -gdb_test "help set c" "Set the status of the type/range checker\.\[\r\n\]+= List of set check subcommands:\[\r\n\]+set check range -- Set range checkin= g\[\r\n\]+set check type -- Set type checking\[\r\n\]+Type \"help set check= \" followed by set check subcommand name for full documentation\.\[\r\n\]+C= ommand name abbreviations are allowed if unambiguous\." "help set check \"c= \" abbreviation" +test_prefix_command_help {"set c" "set check"} { + "Set the status of the type/range checker\.\[\r\n\]+" +} "help set check \"c\" abbreviation" # test help set check "ch" abbreviation -gdb_test "help set ch" "Set the status of the type/range checker\.\[\r\n\]= +List of set check subcommands:\[\r\n\]+set check range -- Set range checki= ng\[\r\n\]+set check type -- Set type checking\[\r\n\]+Type \"help set chec= k\" followed by set check subcommand name for full documentation\.\[\r\n\]+= Command name abbreviations are allowed if unambiguous\." "help set check \"= ch\" abbreviation" +test_prefix_command_help {"set ch" "set check"} { + "Set the status of the type/range checker\.\[\r\n\]+" +} "help set check \"ch\" abbreviation" # test help set check -gdb_test "help set check" "Set the status of the type/range checker\.\[\r\= n\]+List of set check subcommands:\[\r\n\]+set check range -- Set range che= cking\[\r\n\]+set check type -- Set type checking\[\r\n\]+Type \"help set c= heck\" followed by set check subcommand name for full documentation\.\[\r\n= \]+Command name abbreviations are allowed if unambiguous\." "help set check" +test_prefix_command_help {"set check"} { + "Set the status of the type/range checker\.\[\r\n\]+" +} # test help set check range gdb_test "help set check range" "Set range checking\. \\(on/warn/off/auto= \\)" "help set check range" # test help set check type @@ -373,7 +475,9 @@ # test help set history size gdb_test "help set history size" "Set the size of the command history,\[\r= \n\]+ie\. the number of previous commands to keep a record of\." "help set = history size" # test help set history -gdb_test "help set history" "Generic command for setting command history p= arameters\.\[\r\n\]+List of set history subcommands:\[\r\n\]+set history ex= pansion -- Set history expansion on command input\[\r\n\]+set history filen= ame -- Set the filename in which to record the command history\[\r\n\]+set = history save -- Set saving of the history record on exit\[\r\n\]+set histor= y size -- Set the size of the command history\[\r\n\]+Type \"help set histo= ry\" followed by set history subcommand name for full documentation\.\[\r\n= \]+Command name abbreviations are allowed if unambiguous\." "help set histo= ry" +test_prefix_command_help {"set history"} { + "Generic command for setting command history parameters\.\[\r\n\]+" +} # test help set language gdb_test "help set language" "Set the current source language\." "help set= language" # test help set listsize @@ -382,11 +486,17 @@ # FIXME -- Ultrix hangs randomly on this very long output from gdb and # continues with its output only if something is sent to gdb. # Also, if the system is slow, it may time out because the output is large. -gdb_test "help set p" "Generic command for setting how things print\.\[\r\= n\]+List of set print subcommands:.*\[\r\n\]+Type \"help set print\" follow= ed by set print subcommand name for full documentation\.\[\r\n\]+Command na= me abbreviations are allowed if unambiguous\." "help set print \"p\" abbrev= iation" +test_prefix_command_help {"set p" "set print"} { + "Generic command for setting how things print\.\[\r\n\]+" +} "help set print \"p\" abbreviation" # test help set print "pr" abbreviation -gdb_test "help set pr" "Generic command for setting how things print\.\[\r= \n\]+List of set print subcommands:.*\[\r\n\]+Type \"help set print\" follo= wed by set print subcommand name for full documentation\.\[\r\n\]+Command n= ame abbreviations are allowed if unambiguous\." "help set print \"pr\" abbr= eviation" +test_prefix_command_help {"set pr" "set print"} { + "Generic command for setting how things print\.\[\r\n\]+" +} "help set print \"pr\" abbreviation" # test help set print -gdb_test "help set print" "Generic command for setting how things print\.\= [\r\n\]+List of set print subcommands:.*\[\r\n\]+Type \"help set print\" fo= llowed by set print subcommand name for full documentation\.\[\r\n\]+Comman= d name abbreviations are allowed if unambiguous\." "help set print" +test_prefix_command_help {"set print"} { + "Generic command for setting how things print\.\[\r\n\]+" +} # test help set print address gdb_test "help set print address" "Set printing of addresses\." "help set = print address" # test help set print array @@ -426,7 +536,16 @@ # FIXME -- Ultrix hangs randomly on this very long output from gdb and # continues with its output only if something is sent to gdb. # Also, if the system is slow, it may time out because the output is large. -gdb_test "help set" "Evaluate expression EXP and assign result to variable= VAR, using assignment\[\r\n\]+syntax appropriate for the current language = \\(VAR =3D EXP or VAR :=3D EXP for\[\r\n\]+example\\)\. VAR may be a debug= ger \"convenience\" variable \\(names starting\[\r\n\]+with \\\$\\), a regi= ster \\(a few standard names starting with \\\$\\), or an actual\[\r\n\]+va= riable in the program being debugged\. EXP is any valid expression.*\[\r\n= \]+set listsize -- Set number of source lines gdb will list by default.*\[\= r\n\]+Type \"help set\" followed by set subcommand name for full documentat= ion\.\[\r\n\]+Command name abbreviations are allowed if unambiguous..*\[\r\= n\]+" "help set" +test_prefix_command_help "set" { + "Evaluate expression EXP and assign result to variable VAR, using assi= gnment\[\r\n\]+" + "syntax appropriate for the current language \\(VAR =3D EXP or VAR := =3D EXP for\[\r\n\]+" + "example\\)\. VAR may be a debugger \"convenience\" variable \\(names= starting\[\r\n\]+" + "with \\\$\\), a register \\(a few standard names starting with \\\$\\= ), or an actual\[\r\n\]+" + "variable in the program being debugged\. EXP is any valid expression= .*\[\r\n\]+" + "Use \"set variable\" for variables with names identical to set subcom= mands\.\[\r\n\]+" + "With a subcommand, this command modifies parts of the gdb environment= \.\[\r\n\]+" + "You can see these environment settings with the \"show\" command\.\[\= r\n\]+" +} # test help shell gdb_test "help shell" "Execute the rest of the line as a shell command\.\[= \r\n\]+With no arguments, run an inferior shell\." "help shell" #test help show annotate @@ -434,9 +553,13 @@ # test help show args gdb_test "help show args" "Show argument list to give program being debugg= ed when it is started\.\[\r\n\]+Follow this command with any number of args= , to be passed to the program\." # test help show check "c" abbreviation -gdb_test "help show c" "Show the status of the type/range checker\.\[\r\n\= ]+List of show check subcommands:\[\r\n\]+show check range -- Show range ch= ecking\[\r\n\]+show check type -- Show type checking\[\r\n\]+Type \"help sh= ow check\" followed by show check subcommand name for full documentation\.\= [\r\n\]+Command name abbreviations are allowed if unambiguous\." "help show= check \"c\" abbreviation" +test_prefix_command_help {"show c" "show check"} { + "Show the status of the type/range checker\.\[\r\n\]+" +} "help show check \"c\" abbreviation" # test help show check -gdb_test "help show check" "Show the status of the type/range checker\.\[\= r\n\]+List of show check subcommands:\[\r\n\]+show check range -- Show rang= e checking\[\r\n\]+show check type -- Show type checking\[\r\n\]+Type \"hel= p show check\" followed by show check subcommand name for full documentatio= n\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\." "help = show check" +test_prefix_command_help {"show check"} { + "Show the status of the type/range checker\.\[\r\n\]+" +} # test help show check range gdb_test "help show check range" "Show range checking\. \\(on/warn/off/au= to\\)" "help show check range" # test help show check type @@ -466,17 +589,25 @@ # test help show history size gdb_test "help show history size" "Show the size of the command history,\[= \r\n\]+ie\. the number of previous commands to keep a record of\." "help sh= ow history size" # test help show history -gdb_test "help show history" "Generic command for showing command history = parameters\.\[\r\n\]+List of show history subcommands:\[\r\n\]+show history= expansion -- Show history expansion on command input\[\r\n\]+show history = filename -- Show the filename in which to record the command history\[\r\n\= ]+show history save -- Show saving of the history record on exit\[\r\n\]+sh= ow history size -- Show the size of the command history\[\r\n\]+Type \"help= show history\" followed by show history subcommand name for full documenta= tion\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\." "he= lp show history" +test_prefix_command_help {"show history"} { + "Generic command for showing command history parameters\.\[\r\n\]+" +} # test help show language gdb_test "help show language" "Show the current source language\." "help s= how language" # test help show listsize gdb_test "help show listsize" "Show number of source lines gdb will list b= y default\." "help show listsize" # test help show print "p" abbreviation -gdb_test "help show p" "Generic command for showing print settings\.\[\r\n= \]+List of show print subcommands:.*\[\r\n\]+Type \"help show print\" follo= wed by show print subcommand name for full documentation\.\[\r\n\]+Command = name abbreviations are allowed if unambiguous\." "help show print \"p\" abb= reviation" +test_prefix_command_help {"show p" "show print"} { + "Generic command for showing print settings\.\[\r\n\]+" +} "help show print \"p\" abbreviation" # test help show print "pr" abbreviation -gdb_test "help show pr" "Generic command for showing print settings\.\[\r\= n\]+List of show print subcommands:.*\[\r\n\]+Type \"help show print\" foll= owed by show print subcommand name for full documentation\.\[\r\n\]+Command= name abbreviations are allowed if unambiguous\." "help show print \"pr\" a= bbreviation" +test_prefix_command_help {"show pr" "show print"} { + "Generic command for showing print settings\.\[\r\n\]+" +} "help show print \"pr\" abbreviation" # test help show print -gdb_test "help show print" "Generic command for showing print settings\.\[= \r\n\]+List of show print subcommands:.*\[\r\n\]+Type \"help show print\" f= ollowed by show print subcommand name for full documentation\.\[\r\n\]+Comm= and name abbreviations are allowed if unambiguous\." "help show print" +test_prefix_command_help {"show print"} { + "Generic command for showing print settings\.\[\r\n\]+" +} "help show print \"p\" abbreviation" # test help show paths gdb_test "help show paths" "Current search path for finding object files\.= \[\r\n\]+\\\$cwd in the path means the current working directory\.\[\r\n\]+= This path is equivalent to the \\\$PATH shell variable\. It is a list of\[= \r\n\]+directories, separated by colons\. These directories are searched t= o find\[\r\n\]+fully linked executable files and separately compiled object= files as needed\." "help show paths" # test help show print address @@ -522,7 +653,9 @@ # FIXME -- Ultrix hangs randomly on this very long output from gdb and # continues with its output only if something is sent to gdb. # Also, if the system is slow, it may time out because the output is large. -gdb_test "help show" "Generic command for showing things about the debugge= r\.\[\r\n\]+List of show subcommands:.*\[\r\n\]+show directories -- Current= search path for finding source files.*\[\r\n\]+show listsize -- Show numbe= r of source lines gdb will list by default.*\[\r\n\]+Type \"help show\" fol= lowed by show subcommand name for full documentation\.\[\r\n\]+Command name= abbreviations are allowed if unambiguous\." "help show" +test_prefix_command_help "show" { + "Generic command for showing things about the debugger\.\[\r\n\]+" +} # test help step gdb_test "help step" "Step program until it reaches a different source lin= e\.\[\r\n\]+Argument N means do this N times \\(or till program stops for a= nother reason\\)\." "help step #2" # test help stepi "si" abbreviation @@ -535,15 +668,23 @@ # vxgdb reads .vxgdbinit gdb_test "help source" "Read commands from a file named FILE\.\[\r\n\]+Opt= ional -v switch \\(before the filename\\) causes each command in\[\r\n\]+FI= LE to be echoed as it is executed\.\[\r\n\]+Note that the file \"\[^\"\]*\"= is read automatically in this way\[\r\n\]+when GDB is started\." "help sou= rce" # test help stack -gdb_test "help stack" "Examining the stack\..*\[\r\n\]+When the program be= ing debugged stops, gdb selects the innermost frame\.\[\r\n\]+The commands = below can be used to select other frames by number or address\.\[\r\n\]+Lis= t of commands:\[\r\n\]+backtrace -- Print backtrace of all stack frames\[\r= \n\]+bt -- Print backtrace of all stack frames\[\r\n\]+down -- Select and p= rint stack frame called by this one\[\r\n\]+frame -- Select and print a sta= ck frame\[\r\n\]+return -- Make selected stack frame return to its caller\[= \r\n\]+select-frame -- Select a stack frame without printing anything\[\r\n= \]+up -- Select and print stack frame that called this one\[\r\n\]+Type \"h= elp\" followed by command name for full documentation\.\[\r\n\]+Command nam= e abbreviations are allowed if unambiguous\." "help stack" +test_class_help "stack" { + "Examining the stack\..*\[\r\n\]+" + "When the program being debugged stops, gdb selects the innermost fram= e\.\[\r\n\]+" + "The commands below can be used to select other frames by number or ad= dress\.\[\r\n\]+" +} # test help status -gdb_test "help status" "Status inquiries\.\[\r\n\]+List of commands:\[\r\n= \]+info -- Generic command for showing things about the program being debug= ged.*\[\r\n\]+show -- Generic command for showing things about the debugger= \[\r\n\]+Type \"help\" followed by command name for full documentation\.\[\= r\n\]+Command name abbreviations are allowed if unambiguous\." "help status" +test_class_help "status" { + "Status inquiries\.\[\r\n\]+" +} =20 # test help support # FIXME -- Ultrix hangs randomly on this very long output from gdb and # continues with its output only if something is sent to gdb. # Also, if the system is slow, it may time out because the output is large. -gdb_test "help support" "Support facilities\.\[\r\n\]+List of commands:.*\= [\r\n\]+show confirm -- Show whether to confirm potentially dangerous opera= tions.*\[\r\n\]+show history -- Generic command for showing command history= parameters.*\[\r\n\]+Type \"help\" followed by command name for full docum= entation\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\."= "help support" +test_class_help "support" { + "Support facilities\.\[\r\n\]+" +} # test help symbol-file gdb_test "help symbol-file" "Load symbol table from executable file FILE\.= \[\r\n\]+The `file' command can also load symbol tables, as well as setting= the file\[\r\n\]+to execute\." "help symbol-file" # test help target child @@ -558,7 +699,13 @@ gdb_test "help target remote" "Use a remote computer via a serial line, us= ing a gdb-specific protocol\.\[\r\n\]+Specify the serial device it is conne= cted to\[\r\n\]+\\(e.g. .*" "help target remote" # test help target # the child process target may be "target child" or "target procfs" -gdb_test "help target" "Connect to a target machine or process\.\[\r\n\]+T= he first argument is the type or protocol of the target machine\.\[\r\n\]+R= emaining arguments are interpreted by the target protocol\. For more\[\r\n= \]+information on the arguments for a particular protocol, type\[\r\n\]+`he= lp target ' followed by the protocol name\.\[\r\n\]+List of target subcomma= nds:.*\[\r\n\]+target exec -- Use an executable file as a target.*\[\r\n\]+= Type \"help target\" followed by target subcommand name for full documentat= ion\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\." "hel= p target" +test_prefix_command_help "target" { + "Connect to a target machine or process\.\[\r\n\]+" + "The first argument is the type or protocol of the target machine\.\[\= r\n\]+" + "Remaining arguments are interpreted by the target protocol\. For mor= e\[\r\n\]+" + "information on the arguments for a particular protocol, type\[\r\n\]+" + "`help target ' followed by the protocol name\.\[\r\n\]+" +} # test help tbreak gdb_test "help tbreak" "Set a temporary breakpoint.*" "help tbreak" # test help tty @@ -572,13 +719,19 @@ # test help unset environment gdb_test "help unset environment" "Cancel environment variable VAR for the= program\.\[\r\n\]+This does not affect the program until the next \"run\" = command\." "help unset environment" # test help unset -gdb_test "help unset" "Complement to certain \"set\" commands\.\[\r\n\]+Li= st of unset subcommands:\[\r\n\]+.*Type \"help unset\" followed by unset su= bcommand name for full documentation\.\[\r\n\]+Command name abbreviations a= re allowed if unambiguous\." "help unset" +test_prefix_command_help "unset" { + "Complement to certain \"set\" commands\.\[\r\n\]+" +} # test help up gdb_test "help up" "Select and print stack frame that called this one\.\[\= r\n\]+An argument says how many frames up to go\." "help up" # test help up-silently gdb_test "help up-silently" "Same as the `up' command, but does not print = anything\.\[\r\n\]+This is useful in command scripts\." "help up-silently" # test help user-defined -gdb_test "help user-defined" "User-defined commands\.\[\r\n\]+The commands= in this class are those defined by the user\.\[\r\n\]+Use the \"define\" c= ommand to define a command\.\[\r\n\]+List of commands:.*\[\r\n\]+Type \"hel= p\" followed by command name for full documentation\.\[\r\n\]+Command name = abbreviations are allowed if unambiguous\." "help user-defined" +test_class_help "user-defined" { + "User-defined commands\.\[\r\n\]+" + "The commands in this class are those defined by the user\.\[\r\n\]+" + "Use the \"define\" command to define a command\.\[\r\n\]+" +} # test help watch gdb_test "help watch" "Set a watchpoint for an expression\.\[\r\n\]+A watc= hpoint stops execution of your program whenever the value of\[\r\n\]+an exp= ression changes\." "help watch" # test help whatis --Boundary-00=_3VuTFT8ZwYRcMKD--