home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / gnu / gdb-4.9 / gdb / testsuite / gdb.t00 / help.exp < prev    next >
Encoding:
Text File  |  1993-05-12  |  105.2 KB  |  3,122 lines

  1. #   Copyright (C) 1988, 1990, 1991, 1992 Free Software Foundation, Inc.
  2.  
  3. # This program is free software; you can redistribute it and/or modify
  4. # it under the terms of the GNU General Public License as published by
  5. # the Free Software Foundation; either version 2 of the License, or
  6. # (at your option) any later version.
  7. # This program is distributed in the hope that it will be useful,
  8. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  10. # GNU General Public License for more details.
  11. # You should have received a copy of the GNU General Public License
  12. # along with this program; if not, write to the Free Software
  13. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  14.  
  15. # Please email any bugs, comments, and/or additions to this file to:
  16. # bug-gdb@prep.ai.mit.edu
  17.  
  18. # This file was written by Rob Savoye. (rob@cygnus.com)
  19.  
  20. #
  21. # test gdb help commands
  22. #
  23.  
  24. set prms_id 0
  25. set bug_id 0
  26.  
  27. # force the height of the debugger to be pretty large so no pagers getused
  28. send "set height 400\n"
  29. expect -re "$prompt $"
  30.  
  31. # test help add-symbol-file
  32. send "help add-symbol-file\n"
  33. expect     {
  34.     -re "Load the symbols from FILE, assuming FILE has been dynamically loaded..*\
  35. The second argument provides the starting address of the file\'s text..*$prompt $"\
  36.              { pass "help add-symbol-file" }
  37.     -re ".*$prompt $"    { fail "help add-symbol-file" }
  38.     timeout        { fail "(timeout) help add-symbol-file" }
  39.     }
  40.  
  41.  
  42. # test help aliases
  43. send "help aliases\n"
  44. expect {
  45.     -re "Aliases of other commands..*\
  46. List of commands\:.*\
  47. where -- Print backtrace of all stack frames.*\
  48. ni -- Step one instruction.*\
  49. si -- Step one instruction exactly.*\
  50. delete breakpoints -- Delete some breakpoints or auto-display expressions.*\
  51. disable breakpoints -- Disable some breakpoints.*\
  52. Type \"help\" followed by command name for full documentation..*\
  53. Command name abbreviations are allowed if unambiguous..*$prompt $"\
  54.             { pass "help aliases" }
  55.     -re "$prompt $" { fail "help aliases" }
  56.     timeout        { fail "(timeout) help aliases" }
  57.     }
  58.  
  59.  
  60. send "help attach\n"
  61. expect {
  62.     -re "Attach to a process or file outside of GDB..*\
  63. This command attaches to another target, of the same type as your last.*\
  64. `target' command \(`info files' will show your target stack\)..*\
  65. The command may take as argument a process id or a device file..*\
  66. For a process id, you must have permission to send the process a signal,.*\
  67. and it must have the same effective uid as the debugger..*\
  68. When using \"attach\", you should use the \"file\" command to specify.*\
  69. the program running in the process, and to load its symbol table..*$prompt $"\
  70.             { pass "help attach" }
  71.     -re "$prompt $"    { fail "help attach" }
  72.     timeout        { fail "(timeout) help attach" }
  73.     } 
  74.  
  75. #    -re "$prompt $"    { fail "help attach" }
  76.  
  77. # test help breakpoint "b" abbreviation
  78. send "help b\n"
  79. expect {
  80.     -re "Set breakpoint at specified line or function..*\
  81. Argument may be line number, function name, or \"\*\" and an address..*\
  82. If line number is specified, break at start of code for that line..*\
  83. If function is specified, break at start of code for that function..*\
  84. If an address is specified, break at that exact address..*\
  85. With no arg, uses current execution address of selected stack frame..*\
  86. This is useful for breaking on return to a stack frame..*\
  87. Multiple breakpoints at one place are permitted, and useful if conditional..*\
  88. Do \"help breakpoints\" for info on other commands dealing with breakpoints..*$prompt $"\
  89.             { pass "help breakpoint \"b\" abbreviation" }
  90.     -re "$prompt $"    { fail "help breakpoint \"b\" abbreviation" }
  91.     timeout        { fail "(timeout) help breakpoint \"b\" abbreviation" }
  92.     }
  93.  
  94.  
  95. # test help breakpoint "br" abbreviation
  96. send "help br\n"
  97. expect {
  98.     -re "Set breakpoint at specified line or function..*\
  99. Argument may be line number, function name, or \"\*\" and an address..*\
  100. If line number is specified, break at start of code for that line..*\
  101. If function is specified, break at start of code for that function..*\
  102. If an address is specified, break at that exact address..*\
  103. With no arg, uses current execution address of selected stack frame..*\
  104. This is useful for breaking on return to a stack frame..*\
  105. Multiple breakpoints at one place are permitted, and useful if conditional..*\
  106. Do \"help breakpoints\" for info on other commands dealing with breakpoints..*$prompt $"\
  107.             { pass "help breakpoint \"br\" abbreviation" }
  108.     -re "$prompt $"    { fail "help breakpoint \"br\" abbreviation" }
  109.     timeout        { fail "(timeout) help breakpoint \"br\" abbreviation" }
  110.     }
  111.  
  112.  
  113. # test help breakpoint "bre" abbreviation
  114. send "help bre\n"
  115. expect {
  116.     -re "Set breakpoint at specified line or function..*\
  117. Argument may be line number, function name, or \"\*\" and an address..*\
  118. If line number is specified, break at start of code for that line..*\
  119. If function is specified, break at start of code for that function..*\
  120. If an address is specified, break at that exact address..*\
  121. With no arg, uses current execution address of selected stack frame..*\
  122. This is useful for breaking on return to a stack frame..*\
  123. Multiple breakpoints at one place are permitted, and useful if conditional..*\
  124. Do \"help breakpoints\" for info on other commands dealing with breakpoints..*$prompt $"\
  125.             { pass "help breakpoint \"bre\" abbreviation" }
  126.     -re "$prompt $"    { fail "help breakpoint \"bre\" abbreviation" }
  127.     timeout        { fail "(timeout) help breakpoint \"bre\" abbreviation" }
  128.     }
  129.  
  130.  
  131. # test help breakpoint "brea" abbreviation
  132. send "help brea\n"
  133. expect {
  134.     -re "Set breakpoint at specified line or function..*\
  135. Argument may be line number, function name, or \"\*\" and an address..*\
  136. If line number is specified, break at start of code for that line..*\
  137. If function is specified, break at start of code for that function..*\
  138. If an address is specified, break at that exact address..*\
  139. With no arg, uses current execution address of selected stack frame..*\
  140. This is useful for breaking on return to a stack frame..*\
  141. Multiple breakpoints at one place are permitted, and useful if conditional..*\
  142. Do \"help breakpoints\" for info on other commands dealing with breakpoints..*$prompt $"\
  143.             { pass "help breakpoint \"brea\" abbreviation" }
  144.     -re "$prompt $"    { fail "help breakpoint \"brea\" abbreviation" }
  145.     timeout        { fail "(timeout) help breakpoint \"brea\" abbreviation" }
  146.     }
  147.  
  148.  
  149. # test help breakpoint "break" abbreviation
  150. send "help break\n"
  151. expect {
  152.     -re "Set breakpoint at specified line or function..*\
  153. Argument may be line number, function name, or \"\*\" and an address..*\
  154. If line number is specified, break at start of code for that line..*\
  155. If function is specified, break at start of code for that function..*\
  156. If an address is specified, break at that exact address..*\
  157. With no arg, uses current execution address of selected stack frame..*\
  158. This is useful for breaking on return to a stack frame..*\
  159. Multiple breakpoints at one place are permitted, and useful if conditional..*\
  160. Do \"help breakpoints\" for info on other commands dealing with breakpoints..*$prompt $"\
  161.             { pass "help breakpoint \"break\" abbreviation" }
  162.     -re "$prompt $"    { fail "help breakpoint \"break\" abbreviation" }
  163.     timeout        { fail "(timeout) help breakpoint \"break\" abbreviation" }
  164.     }
  165.  
  166.  
  167. # test help breakpoints
  168. send "help breakpoints\n"
  169. expect {
  170.     -re "Making program stop at certain points..*\
  171. List of commands\:.*\
  172. watch -- Set a watchpoint for an expression.*\
  173. catch -- Set breakpoints to catch exceptions that are raised.*\
  174. break -- Set breakpoint at specified line or function.*\
  175. clear -- Clear breakpoint at specified line or function.*\
  176. delete -- Delete some breakpoints or auto-display expressions.*\
  177. disable -- Disable some breakpoints.*\
  178. enable -- Enable some breakpoints.*\
  179. tbreak -- Set a temporary breakpoint.*\
  180. condition -- Specify breakpoint number N to break only if COND is true.*\
  181. commands -- Set commands to be executed when a breakpoint is hit.*\
  182. ignore -- Set ignore-count of breakpoint number N to COUNT.*\
  183. Type \"help\" followed by command name for full documentation..*\
  184. Command name abbreviations are allowed if unambiguous..*$prompt $"\
  185.             { pass "help breakpoints" }
  186.     -re "$prompt $"    { fail "help breakpoints" }
  187.     timeout        { fail "(timeout) help breakpoints" }
  188.     }
  189.  
  190.  
  191. # test help backtrace "bt" abbreviation
  192. send "help bt\n"
  193. expect {
  194.     -re "Print backtrace of all stack frames, or innermost COUNT frames..*\
  195. With a negative argument, print outermost -COUNT frames..*$prompt $"\
  196.             { pass "help backtrace \"bt\" abbreviation" }
  197.     -re "$prompt $"    { fail "help backtrace \"bt\" abbreviation" }
  198.     timeout        { fail "(timeout) help backtrace \"bt\" abbreviation" }
  199.     }
  200.  
  201.  
  202. # test help backtrace
  203. send "help backtrace\n"
  204. expect {
  205.     -re "Print backtrace of all stack frames, or innermost COUNT frames..*\
  206. With a negative argument, print outermost -COUNT frames..*$prompt $"\
  207.             { pass "help backtrace" }
  208.     -re "$prompt $"    { fail "help backtrace" }
  209.     timeout        { fail "(timeout) help backtrace" }
  210.     }
  211.  
  212.  
  213. # test help continue "c" abbreviation
  214. send "help c\n"
  215. expect {
  216.     -re "Continue program being debugged, after signal or breakpoint..*\
  217. If proceeding from breakpoint, a number N may be used as an argument:.*\
  218. then the same breakpoint won't break until the Nth time it is reached..*$prompt $"\
  219.             { pass "help continue \"c\" abbreviation" }
  220.     -re "$prompt $"    { fail "help continue \"c\" abbreviation" }
  221.     timeout        { fail "(timeout) help continue \"c\" abbreviation" }
  222.     }
  223.  
  224.  
  225. # test help continue
  226. send "help continue\n"
  227. expect {
  228.     -re "Continue program being debugged, after signal or breakpoint..*\
  229. If proceeding from breakpoint, a number N may be used as an argument:.*\
  230. then the same breakpoint won't break until the Nth time it is reached..*$prompt $"\
  231.             { pass "help continue" }
  232.     -re "$prompt $"    { fail "help continue" }
  233.     timeout        { fail "(timeout) help continue" }
  234.     }
  235.  
  236.  
  237. # test help call
  238. send "help call\n"
  239. expect {
  240.     -re "Call a function in the inferior process..*\
  241. The argument is the function name and arguments, in the notation of the.*\
  242. current working language.  The result is printed and saved in the value.*\
  243. history, if it is not void..*$prompt $"\
  244.             { pass "help call" }
  245.     -re "$prompt $"    { fail "help call" }
  246.     timeout        { fail "(timeout) help call" }
  247.     }
  248.  
  249.  
  250. # test help catch
  251. send "help catch\n"
  252. expect {
  253.     -re "Set breakpoints to catch exceptions that are raised..*\
  254. Argument may be a single exception to catch, multiple exceptions.*\
  255. to catch, or the default exception \"default\".  If no arguments.*\
  256. are given, breakpoints are set at all exception handlers catch clauses.*\
  257. within the current scope..*\
  258. A condition specified for the catch applies to all breakpoints set.*\
  259. with this command.*\
  260. Do \"help breakpoints\" for info on other commands dealing with breakpoints..*$prompt $"\
  261.             { pass "help catch" }
  262.     -re "$prompt $"    { fail "help catch" }
  263.     timeout        { fail "(timeout) help catch" }
  264.     }
  265.  
  266.  
  267. # test help cd
  268. send "help cd\n"
  269. expect {
  270.     -re "Set working directory to DIR for debugger and program being debugged..*\
  271. The change does not take effect for the program being debugged.*\
  272. until the next time it is started..*$prompt $"\
  273.             { pass "help cd" }
  274.     -re "$prompt $"    { fail "help cd" }
  275.     timeout        { fail "(timeout) help cd" }
  276.     }
  277.  
  278.  
  279. # test help clear
  280. send "help clear\n"
  281. expect {
  282.     -re "Clear breakpoint at specified line or function..*\
  283. Argument may be line number, function name, or \"\*\" and an address..*\
  284. If line number is specified, all breakpoints in that line are cleared..*\
  285. If function is specified, breakpoints at beginning of function are cleared..*\
  286. If an address is specified, breakpoints at that address are cleared..*\
  287. With no argument, clears all breakpoints in the line that the selected frame.*\
  288. is executing in..*\
  289. See also the \"delete\" command which clears breakpoints by number..*$prompt $"\
  290.             { pass "help clear" }
  291.     -re "$prompt $"    { fail "help clear" }
  292.     timeout        { fail "(timeout) help clear" }
  293.     }
  294.  
  295.  
  296. # test help commands
  297. send "help commands\n"
  298. expect {
  299.     -re "Set commands to be executed when a breakpoint is hit..*\
  300. Give breakpoint number as argument after \"commands\"..*\
  301. With no argument, the targeted breakpoint is the last one set..*\
  302. The commands themselves follow starting on the next line..*\
  303. Type a line containing \"end\" to indicate the end of them..*\
  304. Give \"silent\" as the first line to make the breakpoint silent;.*\
  305. then no output is printed when it is hit, except what the commands print..*$prompt $"\
  306.             { pass "help commands" }
  307.     -re "$prompt $"    { fail "help commands" }
  308.     timeout        { fail "(timeout) help commands" }
  309.     }
  310.  
  311.  
  312. # test help condition
  313. send "help condition\n"
  314. expect {
  315.     -re "Specify breakpoint number N to break only if COND is true..*\
  316. N is an integer; COND is an expression to be evaluated whenever.*\
  317. breakpoint N is reached.  .*$prompt $"\
  318.             { pass "help condition" }
  319.     -re "$prompt $"    { fail "help condition" }
  320.     timeout        { fail "(timeout) help condition" }
  321.     }
  322.  
  323.  
  324. # test help core-file
  325. send "help core-file\n"
  326. expect {
  327.     -re "Use FILE as core dump for examining memory and registers..*\
  328. No arg means have no core file.  This command has been superseded by the.*\
  329. `target core' and `detach' commands..*$prompt $"\
  330.             { pass "help core-file" }
  331.     -re "$prompt $"    { fail "help core-file" }
  332.     timeout        { fail "(timeout) help core-file" }
  333.     }
  334.  
  335.  
  336. # test help delete "d" abbreviation
  337. send "help d\n"
  338. expect {
  339.     -re "Delete some breakpoints or auto-display expressions..*\
  340. Arguments are breakpoint numbers with spaces in between..*\
  341. To delete all breakpoints, give no argument..*\
  342. Also a prefix command for deletion of other GDB objects..*\
  343. The \"unset\" command is also an alias for \"delete\"..*\
  344. List of delete subcommands:.*\
  345. delete display -- Cancel some expressions to be displayed when program stops.*\
  346. delete breakpoints -- Delete some breakpoints or auto-display expressions.*\
  347. Type \"help delete\" followed by delete subcommand name for full documentation..*\
  348. Command name abbreviations are allowed if unambiguous..*$prompt $"\
  349.             { pass "help delete \"d\" abbreviation" }
  350.     -re "$prompt $"    { fail "help delete \"d\" abbreviation" }
  351.     timeout        { fail "(timeout) help delete \"d\" abbreviation" }
  352.     }
  353.  
  354.  
  355. # test help delete
  356. send "help delete\n"
  357. expect {
  358.     -re "Delete some breakpoints or auto-display expressions..*\
  359. Arguments are breakpoint numbers with spaces in between..*\
  360. To delete all breakpoints, give no argument..*\
  361. Also a prefix command for deletion of other GDB objects..*\
  362. The \"unset\" command is also an alias for \"delete\"..*\
  363. List of delete subcommands:.*\
  364. delete display -- Cancel some expressions to be displayed when program stops.*\
  365. delete breakpoints -- Delete some breakpoints or auto-display expressions.*\
  366. Type \"help delete\" followed by delete subcommand name for full documentation..*\
  367. Command name abbreviations are allowed if unambiguous..*$prompt $"\
  368.             { pass "help delete" }
  369.     -re "$prompt $"    { fail "help delete" }
  370.     timeout        { fail "(timeout) help delete" }
  371.     }
  372.  
  373.  
  374. # test help data
  375. send "help data\n"
  376. expect {
  377.     -re ".*\
  378. Examining data..*\
  379. List of commands:.*\
  380. whatis -- Print data type of expression EXP.*\
  381. ptype -- Print definition of type TYPE.*\
  382. inspect -- Same as \"print\" command.*\
  383. print -- Print value of expression EXP.*\
  384. call -- Call a function in the inferior process.*\
  385. set -- Evaluate expression EXP and assign result to variable VAR.*\
  386. set variable -- Evaluate expression EXP and assign result to variable VAR.*\
  387. output -- Like \"print\" but don't put in value history and don't print newline.*\
  388. printf -- Printf \"printf format string\".*\
  389. display -- Print value of expression EXP each time the program stops.*\
  390. undisplay -- Cancel some expressions to be displayed when program stops.*\
  391. disassemble -- Disassemble a specified section of memory.*\
  392. x -- Examine memory: x/FMT ADDRESS.*\
  393. delete display -- Cancel some expressions to be displayed when program stops.*\
  394. disable display -- Disable some expressions to be displayed when program stops.*\
  395. enable display -- Enable some expressions to be displayed when program stops.*\
  396. Type \"help\" followed by command name for full documentation..*\
  397. Command name abbreviations are allowed if unambiguous..*$prompt $"\
  398.             { pass "help data" }
  399.     -re "$prompt $"    { fail "help data" }
  400.     timeout        { fail "(timeout) help data" }
  401.     }
  402.  
  403.  
  404. # test help define
  405. send "help define\n"
  406. expect {
  407.     -re "Define a new command name.  Command name is argument..*\
  408. Definition appears on following lines, one command per line..*\
  409. End with a line of just \"end\"..*\
  410. Use the \"document\" command to give documentation for the new command..*\
  411. Commands defined in this way do not take arguments..*$prompt $"\
  412.             { pass "help define" }
  413.     -re "$prompt $"    { fail "help define" }
  414.     timeout        { fail "(timeout) help define" }
  415.     }
  416.  
  417.  
  418. # test help delete breakpoints
  419. send "help delete breakpoints\n"
  420. expect {
  421.     -re "Delete some breakpoints or auto-display expressions..*\
  422. Arguments are breakpoint numbers with spaces in between..*\
  423. To delete all breakpoints, give no argument..*\
  424. This command may be abbreviated \"delete\"..*$prompt $"\
  425.             { pass "help delete breakpoints" }
  426.     -re "$prompt $"    { fail "help delete breakpoints" }
  427.     timeout        { fail "(timeout) help delete breakpoints" }
  428.     }
  429.  
  430.  
  431. # test help delete display
  432. send "help delete display\n"
  433. expect {
  434.     -re "Cancel some expressions to be displayed when program stops..*\
  435. Arguments are the code numbers of the expressions to stop displaying..*\
  436. No argument means cancel all automatic-display expressions..*\
  437. Do \"info display\" to see current list of code numbers..*$prompt $"\
  438.             { pass "help delete display" }
  439.     -re "$prompt $"    { fail "help delete display" }
  440.     timeout        { fail "(timeout) help delete display" }
  441.     }
  442.  
  443.  
  444. # test help detach
  445. send "help detach\n"
  446. expect {
  447.     -re "Detach a process or file previously attached..*\
  448. If a process, it is no longer traced, and it continues its execution.  If you.*\
  449. were debugging a file, the file is closed and gdb no longer accesses it..*$prompt $"\
  450.             { pass "help detach" }
  451.     -re "$prompt $"    { fail "help detach" }
  452.     timeout        { fail "(timeout) help detach" }
  453.     }
  454.  
  455.  
  456. # test help directory
  457. send "help directory\n"
  458. expect {
  459.     -re "Add directory DIR to beginning of search path for source files..*\
  460. Forget cached info on source file locations and line positions..*\
  461. DIR can also be .cwd for the current working directory, or .cdir for the.*\
  462. directory in which the source file was compiled into object code..*\
  463. With no argument, reset the search path to .cdir:.cwd, the default..*$prompt $"\
  464.             { pass "help directory" }
  465.     -re "$prompt $"    { fail "help directory" }
  466.     timeout        { fail "(timeout) help directory" }
  467.     }
  468.  
  469.  
  470. # test help disable "dis" abbreviation
  471. send "help dis\n"
  472. expect {
  473.     -re "Disable some breakpoints..*\
  474. Arguments are breakpoint numbers with spaces in between..*\
  475. To disable all breakpoints, give no argument..*\
  476. A disabled breakpoint is not forgotten, but has no effect until reenabled..*\
  477. List of disable subcommands:.*\
  478. disable display -- Disable some expressions to be displayed when program stops.*\
  479. disable breakpoints -- Disable some breakpoints.*\
  480. Type \"help disable\" followed by disable subcommand name for full documentation..*\
  481. Command name abbreviations are allowed if unambiguous..*$prompt $"\
  482.             { pass "help disable \"dis\" abbreviation" }
  483.     -re "$prompt $"    { fail "help disable \"dis\" abbreviation" }
  484.     timeout        { fail "(timeout) help disable \"dis\" abbreviation" }
  485.     }
  486.  
  487.  
  488. # test help disable "disa" abbreviation
  489. send "help disa\n"
  490. expect {
  491.     -re "Disable some breakpoints..*\
  492. Arguments are breakpoint numbers with spaces in between..*\
  493. To disable all breakpoints, give no argument..*\
  494. A disabled breakpoint is not forgotten, but has no effect until reenabled..*\
  495. List of disable subcommands:.*\
  496. disable display -- Disable some expressions to be displayed when program stops.*\
  497. disable breakpoints -- Disable some breakpoints.*\
  498. Type \"help disable\" followed by disable subcommand name for full documentation..*\
  499. Command name abbreviations are allowed if unambiguous..*$prompt $"\
  500.             { pass "help disable \"disa\" abbreviation" }
  501.     -re "$prompt $"    { fail "help disable \"disa\" abbreviation" }
  502.     timeout        { fail "(timeout) help disable \"disa\" abbreviation" }
  503.     }
  504.  
  505.  
  506. # test help disable
  507. send "help disable\n"
  508. expect {
  509.     -re "Disable some breakpoints..*\
  510. Arguments are breakpoint numbers with spaces in between..*\
  511. To disable all breakpoints, give no argument..*\
  512. A disabled breakpoint is not forgotten, but has no effect until reenabled..*\
  513. List of disable subcommands:.*\
  514. disable display -- Disable some expressions to be displayed when program stops.*\
  515. disable breakpoints -- Disable some breakpoints.*\
  516. Type \"help disable\" followed by disable subcommand name for full documentation..*\
  517. Command name abbreviations are allowed if unambiguous..*$prompt $"\
  518.             { pass "help disable" }
  519.     -re "$prompt $"    { fail "help disable" }
  520.     timeout        { fail "(timeout) help disable" }
  521.     }
  522.  
  523.  
  524. # test help disable breakpoints
  525. send "help disable breakpoints\n"
  526. expect {
  527.     -re "Disable some breakpoints..*\
  528. Arguments are breakpoint numbers with spaces in between..*\
  529. To disable all breakpoints, give no argument..*\
  530. A disabled breakpoint is not forgotten, but has no effect until reenabled..*\
  531. This command may be abbreviated \"disable\"..*$prompt $"\
  532.             { pass "help disable breakpoints" }
  533.     -re "$prompt $"    { fail "help disable breakpoints" }
  534.     timeout        { fail "(timeout) help disable breakpoints" }
  535.     }
  536.  
  537.  
  538. # test help disable display
  539. send "help disable display\n"
  540. expect {
  541.     -re "Disable some expressions to be displayed when program stops..*\
  542. Arguments are the code numbers of the expressions to stop displaying..*\
  543. No argument means disable all automatic-display expressions..*\
  544. Do \"info display\" to see current list of code numbers..*$prompt $"\
  545.             { pass "help disable display" }
  546.     -re "$prompt $"    { fail "help disable display" }
  547.     timeout        { fail "(timeout) help disable display" }
  548.     }
  549.  
  550.  
  551. # test help disassemble
  552. send "help disassemble\n"
  553. expect {
  554.     -re "Disassemble a specified section of memory..*\
  555. Default is the function surrounding the pc of the selected frame..*\
  556. With a single argument, the function surrounding that address is dumped..*\
  557. Two arguments are taken as a range of memory to dump..*$prompt $"\
  558.             { pass "help disassemble" }
  559.     -re "$prompt $"    { fail "help disassemble" }
  560.     timeout        { fail "(timeout) help disassemble" }
  561.     }
  562.  
  563.  
  564. # test help display
  565. send "help display\n"
  566. expect {
  567.     -re "Print value of expression EXP each time the program stops..*\
  568. /FMT may be used before EXP as in the \"print\" command..*\
  569. /FMT \"i\" or \"s\" or including a size-letter is allowed,.*\
  570. as in the \"x\" command, and then EXP is used to get the address to examine.*\
  571. and examining is done as in the \"x\" command..*\
  572. With no argument, display all currently requested auto-display expressions..*\
  573. Use \"undisplay\" to cancel display requests previously made..*$prompt $"\
  574.             { pass "help display" }
  575.     -re "$prompt $"    { fail "help display" }
  576.     timeout        { fail "(timeout) help display" }
  577.     }
  578.  
  579.  
  580. # test help do
  581. send "help do\n"
  582. expect {
  583.     -re "Select and print stack frame called by this one..*\
  584. An argument says how many frames down to go..*$prompt $"\
  585.             { pass "help do" }
  586.     -re "$prompt $"    { fail "help do" }
  587.     timeout        { fail "(timeout) help do" }
  588.     }
  589.  
  590.  
  591. # test help document
  592. send "help document\n"
  593. expect {
  594.     -re "Document a user-defined command..*\
  595. Give command name as argument.  Give documentation on following lines..*\
  596. End with a line of just \"end\"..*$prompt $"\
  597.             { pass "help document" }
  598.     -re "$prompt $"    { fail "help document" }
  599.     timeout        { fail "(timeout) help document" }
  600.     }
  601.  
  602.  
  603.  
  604. # test help down
  605. send "help down\n"
  606. expect {
  607.     -re "Select and print stack frame called by this one..*\
  608. An argument says how many frames down to go..*$prompt $"\
  609.             { pass "help down" }
  610.     -re "$prompt $"    { fail "help down" }
  611.     timeout        { fail "(timeout) help down" }
  612.     }
  613.  
  614.  
  615. # test help down-silently
  616. send "help down-silently\n"
  617. expect {
  618.     -re "Same as the `down' command, but does not print anything..*\
  619. This is useful in command scripts..*$prompt $"\
  620.             { pass "help down-silently" }
  621.     -re "$prompt $"    { fail "help down-silently" }
  622.     timeout        { fail "(timeout) help down-silently" }
  623.     }
  624.  
  625.  
  626. # this command was removed from GDB 4.5.8
  627. # test help dump-me
  628. #send "help dump-me\n"
  629. #expect {
  630. #    -re "Get fatal error; make debugger dump its core..*$prompt $"\
  631. #            { pass "help dump-me" }
  632. #    -re "$prompt $"    { fail "help dump-me" }
  633. #    timeout        { fail "(timeout) help dump-me" }
  634. #    }
  635.  
  636. # test help echo
  637. send "help echo\n"
  638. expect {
  639.     -re "Print a constant string.  Give string as argument..*\
  640. C escape sequences may be used in the argument..*\
  641. No newline is added at the end of the argument;.*\
  642. use \".n\" if you want a newline to be printed..*\
  643. Since leading and trailing whitespace are ignored in command arguments,.*\
  644. if you want to print some you must use \".\" before leading whitespace.*\
  645. to be printed or after trailing whitespace..*$prompt $"\
  646.             { pass "help echo" }
  647.     -re "$prompt $"    { fail "help echo" }
  648.     timeout        { fail "(timeout) help echo" }
  649.     }
  650.  
  651.  
  652. # test help enable breakpoints delete
  653. send "help enable breakpoints delete\n"
  654. expect {
  655.     -re "Enable breakpoints and delete when hit.  Give breakpoint numbers..*\
  656. If a breakpoint is hit while enabled in this fashion, it is deleted..*$prompt $"\
  657.             { pass "help enable breakpoints delete" }
  658.     -re "$prompt $"    { fail "help enable breakpoints delete" }
  659.     timeout        { fail "(timeout) help enable breakpoints delete" }
  660.     }
  661.  
  662.  
  663. # test help enable breakpoints once
  664. send "help enable breakpoints once\n"
  665. expect {
  666.     -re "Enable breakpoints for one hit.  Give breakpoint numbers..*\
  667. If a breakpoint is hit while enabled in this fashion, it becomes disabled..*\
  668. See the \"tbreak\" command which sets a breakpoint and enables it once..*$prompt $"\
  669.             { pass "help enable breakpoints once" }
  670.     -re "$prompt $"    { fail "help enable breakpoints once" }
  671.     timeout        { fail "(timeout) help enable breakpoints once" }
  672.     }
  673.  
  674.  
  675. # test help enable breakpoints
  676. send "help enable breakpoints\n"
  677. expect {
  678.     -re "Enable some breakpoints..*\
  679. Give breakpoint numbers \(separated by spaces\) as arguments..*\
  680. This is used to cancel the effect of the \"disable\" command..*\
  681. May be abbreviated to simply \"enable\"..*.*\
  682. List of enable breakpoints subcommands:.*\
  683. enable breakpoints delete -- Enable breakpoints and delete when hit.*\
  684. enable breakpoints once -- Enable breakpoints for one hit.*\
  685. Type \"help enable breakpoints\" followed by enable breakpoints subcommand name for full documentation..*\
  686. Command name abbreviations are allowed if unambiguous..*$prompt $"\
  687.             { pass "help enable breakpoints" }
  688.     -re "$prompt $"    { fail "help enable breakpoints" }
  689.     timeout        { fail "(timeout) help enable breakpoints" }
  690.     }
  691.  
  692.  
  693. # test help enable delete
  694. send "help enable delete\n"
  695. expect {
  696.     -re "Enable breakpoints and delete when hit.  Give breakpoint numbers..*\
  697. If a breakpoint is hit while enabled in this fashion, it is deleted..*$prompt $"\
  698.             { pass "help enable delete" }
  699.     -re "$prompt $"    { fail "help enable delete" }
  700.     timeout        { fail "(timeout) help enable delete" }
  701.     }
  702.  
  703.  
  704. # test help enable display
  705. send "help enable display\n"
  706. expect {
  707.     -re "Enable some expressions to be displayed when program stops..*\
  708. Arguments are the code numbers of the expressions to resume displaying..*\
  709. No argument means enable all automatic-display expressions..*\
  710. Do \"info display\" to see current list of code numbers..*$prompt $"\
  711.             { pass "help enable display" }
  712.     -re "$prompt $"    { fail "help enable display" }
  713.     timeout        { fail "(timeout) help enable display" }
  714.     }
  715.  
  716.  
  717. # test help enable once
  718. send "help enable once\n"
  719. expect {
  720.     -re "Enable breakpoints for one hit.  Give breakpoint numbers..*\
  721. If a breakpoint is hit while enabled in this fashion, it becomes disabled..*\
  722. See the \"tbreak\" command which sets a breakpoint and enables it once..*$prompt $"\
  723.             { pass "help enable once" }
  724.     -re "$prompt $"    { fail "help enable once" }
  725.     timeout        { fail "(timeout) help enable once" }
  726.     }
  727.  
  728.  
  729. # test help enable
  730. send "help enable\n"
  731. expect {
  732.     -re "Enable some breakpoints..*\
  733. Give breakpoint numbers \(separated by spaces\) as arguments..*\
  734. With no subcommand, breakpoints are enabled until you command otherwise..*\
  735. This is used to cancel the effect of the \"disable\" command..*\
  736. With a subcommand you can enable temporarily..*\
  737. List of enable subcommands:.*\
  738. enable display -- Enable some expressions to be displayed when program stops.*\
  739. enable once -- Enable breakpoints for one hit.*\
  740. enable delete -- Enable breakpoints and delete when hit.*\
  741. Type \"help enable\" followed by enable subcommand name for full documentation..*\
  742. Command name abbreviations are allowed if unambiguous..*$prompt $"\
  743.             { pass "help enable" }
  744.     -re "$prompt $"    { fail "help enable" }
  745.     timeout        { fail "(timeout) help enable" }
  746.     }
  747.  
  748.  
  749. # test help exec-file
  750. send "help exec-file\n"
  751. expect {
  752.     -re "Use FILE as program for getting contents of pure memory..*\
  753. If FILE cannot be found as specified, your execution directory path.*\
  754. is searched for a command of that name..*\
  755. No arg means have no executable file..*$prompt $"\
  756.             { pass "help exec-file" }
  757.     -re "$prompt $"    { fail "help exec-file" }
  758.     timeout        { fail "(timeout) help exec-file" }
  759.     }
  760.  
  761.  
  762. # test help frame "f" abbreviation
  763. send "help f\n"
  764. expect {
  765.     -re "Select and print a stack frame..*\
  766. With no argument, print the selected stack frame.  \(See also \"info frame\"\)..*\
  767. An argument specifies the frame to select..*\
  768. It can be a stack frame number or the address of the frame..*\
  769. With argument, nothing is printed if input is coming from.*\
  770. a command file or a user-defined command..*$prompt $"\
  771.             { pass "help frame \"f\" abbreviation" }
  772.     -re "$prompt $"    { fail "help frame \"f\" abbreviation" }
  773.     timeout        { fail "(timeout) help frame \"f\" abbreviation" }
  774.     }
  775.  
  776.  
  777. # test help frame
  778. send "help frame\n"
  779. expect {
  780.     -re "Select and print a stack frame..*\
  781. With no argument, print the selected stack frame.  \(See also \"info frame\"\)..*\
  782. An argument specifies the frame to select..*\
  783. It can be a stack frame number or the address of the frame..*\
  784. With argument, nothing is printed if input is coming from.*\
  785. a command file or a user-defined command..*$prompt $"\
  786.             { pass "help frame" }
  787.     -re "$prompt $"    { fail "help frame" }
  788.     timeout        { fail "(timeout) help frame" }
  789.     }
  790.  
  791.  
  792. # test help fg
  793. send "help fg\n"
  794. expect {
  795.     -re "Continue program being debugged, after signal or breakpoint..*\
  796. If proceeding from breakpoint, a number N may be used as an argument:.*\
  797. then the same breakpoint won't break until the Nth time it is reached..*$prompt $"\
  798.             { pass "help fg" }
  799.     -re "$prompt $"    { fail "help fg" }
  800.     timeout        { fail "(timeout) help fg" }
  801.     }
  802.  
  803.  
  804. # test help file
  805. send "help file\n"
  806. expect {
  807.     -re "Use FILE as program to be debugged..*\
  808. It is read for its symbols, for getting the contents of pure memory,.*\
  809. and it is the program executed when you use the `run' command..*\
  810. If FILE cannot be found as specified, your execution directory path.*\
  811. \(.PATH\) is searched for a command of that name..*\
  812. No arg means to have no executable file and no symbols..*$prompt $"\
  813.             { pass "help file" }
  814.     -re "$prompt $"    { fail "help file" }
  815.     timeout        { fail "(timeout) help file" }
  816.     }
  817.  
  818.  
  819. # test help files
  820. # FIXME -- this should probably use the full pattern, but it won't work for some reason
  821. send "help files\n"
  822. expect {
  823.     -re "Specifying.*$prompt $"  { pass "help files" }
  824.     -re "$prompt $"    { fail "help files" }
  825.     timeout        { fail "(timeout) help files" }
  826.     }
  827.  
  828.  
  829. # test help finish
  830. send "help finish\n"
  831. expect {
  832.     -re "Execute until selected stack frame returns..*\
  833. Upon return, the value returned is printed and put in the value history..*$prompt $"\
  834.             { pass "help finish" }
  835.     -re "$prompt $"    { fail "help finish" }
  836.     timeout        { fail "(timeout) help finish" }
  837.     }
  838.  
  839.  
  840. # test help forward-search
  841. send "help forward-search\n"
  842. expect {
  843.     -re "Search for regular expression \(see regex\(3\)\) from last line listed..*$prompt $"\
  844.             { pass "help forward-search" }
  845.     -re "$prompt $"    { fail "help forward-search" }
  846.     timeout        { fail "(timeout) help forward-search" }
  847.     }
  848.  
  849.  
  850. # test help help "h" abbreviation 
  851. send "help h\n"
  852. expect {
  853.     -re "Print list of commands..*$prompt $"\
  854.             { pass "help help \"h\" abbreviation" }
  855.     -re "$prompt $"    { fail "help help \"h\" abbreviation" }
  856.     timeout        { fail "(timeout) help help \"h\" abbreviation" }
  857.     }
  858.  
  859.  
  860. # test help help
  861. send "help help\n"
  862. expect {
  863.     -re "Print list of commands..*$prompt $"\
  864.             { pass "help help" }
  865.     -re "$prompt $"    { fail "help help" }
  866.     timeout        { fail "(timeout) help help" }
  867.     }
  868.  
  869.  
  870. # test help handle
  871. # FIXME -- this should probably use the full pattern, but it won't work for some reason
  872. send "help handle\n"
  873. expect {
  874.     -re "Specify how to handle a signal..*$prompt $"\
  875.             { pass "help handle" }
  876.     -re "$prompt $"    { fail "help handle" }
  877.     timeout        { fail "(timeout) help handle" }
  878.     }
  879.  
  880.  
  881. # test help info "i" abbreviation
  882. # FIXME -- this should probably use the full pattern, but it won't work for some reason
  883. send "help i\n"
  884. expect {
  885.     -re "Generic command for showing things about the program being debugged..*\
  886. List of info subcommands:.*
  887. info set -- Show all GDB settings.*\
  888. info files -- Names of targets and files being debugged.*\
  889. info target -- Names of targets and files being debugged.*\
  890. info sources -- Source files in the program.*\
  891. info types -- All type names.*\
  892. info functions -- All function names.*\
  893. info variables -- All global and static variable names.*\
  894. info catch -- Exceptions that can be caught in the current stack frame.*\
  895. info args -- Argument variables of current stack frame.*\
  896. info locals -- Local variables of current stack frame.*\
  897. info frame -- All about selected stack frame.*\
  898. info stack -- Backtrace of the stack.*\
  899. info line -- Core addresses of the code for a source line.*\
  900. info source -- Information about the current source file.*\
  901. (info sharedlibrary -- Status of loaded shared object libraries.*)?\
  902. info display -- Expressions to display when program stops.*\
  903. info address -- Describe where variable VAR is stored.*\
  904. info signals -- What debugger does when program gets various signals.*\
  905. info terminal -- Print inferior\'s saved terminal status.*\
  906. info float -- Print the status of the floating point unit.*\
  907. info program -- Execution status of the program.*\
  908. info all-registers -- List of all registers and their contents.*\
  909. info registers -- List of integer registers and their contents.*\
  910. info warranty -- Various kinds of warranty you do not have.*\
  911. info copying -- Conditions for redistributing copies of GDB.*\
  912. info watchpoints -- Synonym for \`\`info breakpoints\'\'.*\
  913. info breakpoints -- Status of user-settable breakpoints.*\
  914. Type \"help info\" followed by info subcommand name for full documentation..*
  915. Command name abbreviations are allowed if unambiguous..*$prompt $"\
  916.             { pass "help info \"i\" abbreviation" }
  917.     -re "$prompt $"    { fail "help info \"i\" abbreviation" }
  918.     timeout        { fail "(timeout) help info \"i\" abbreviation" }
  919.     }
  920.  
  921.  
  922. # test help info
  923. # FIXME -- this should probably use the full pattern, but it won't work for some reason
  924. send "help info\n"
  925. expect {
  926.     -re "Generic command for showing things about the program being debugged..*\
  927. List of info subcommands:.*\
  928. info set -- Show all GDB settings.*\
  929. info files -- Names of targets and files being debugged.*\
  930. info target -- Names of targets and files being debugged.*\
  931. info sources -- Source files in the program.*\
  932. info types -- All type names.*\
  933. info functions -- All function names.*\
  934. info variables -- All global and static variable names.*\
  935. info catch -- Exceptions that can be caught in the current stack frame.*\
  936. info args -- Argument variables of current stack frame.*\
  937. info locals -- Local variables of current stack frame.*\
  938. info frame -- All about selected stack frame.*\
  939. info stack -- Backtrace of the stack.*\
  940. info line -- Core addresses of the code for a source line.*\
  941. info source -- Information about the current source file.*\
  942. (info sharedlibrary -- Status of loaded shared object libraries.*)?\
  943. info display -- Expressions to display when program stops.*\
  944. info address -- Describe where variable VAR is stored.*\
  945. info signals -- What debugger does when program gets various signals.*\
  946. info terminal -- Print inferior\'s saved terminal status.*\
  947. info float -- Print the status of the floating point unit.*\
  948. info program -- Execution status of the program.*\
  949. info all-registers -- List of all registers and their contents.*\
  950. info registers -- List of integer registers and their contents.*\
  951. info warranty -- Various kinds of warranty you do not have.*\
  952. info copying -- Conditions for redistributing copies of GDB.*\
  953. info watchpoints -- Synonym for \`\`info breakpoints\'\'.*\
  954. info breakpoints -- Status of user-settable breakpoints.*\
  955. Type \"help info\" followed by info subcommand name for full documentation..*\
  956. Command name abbreviations are allowed if unambiguous..*$prompt $"\
  957.             { pass "help info" }
  958.     -re "$prompt $"    { fail "help info" }
  959.     timeout        { fail "(timeout) help info" }
  960.     }
  961.  
  962.  
  963. # test help ignore
  964. send "help ignore\n"
  965. expect {
  966.     -re "Set ignore-count of breakpoint number N to COUNT..*$prompt $"\
  967.             { pass "help ignore" }
  968.     -re "$prompt $"    { fail "help ignore" }
  969.     timeout        { fail "(timeout) help ignore" }
  970.     }
  971.  
  972.  
  973. # test help info address
  974. send "help info address\n"
  975. expect {
  976.     -re "Describe where variable VAR is stored..*$prompt $"\
  977.             { pass "help info address" }
  978.     -re "$prompt $"    { fail "help info address" }
  979.     timeout        { fail "(timeout) help info address" }
  980.     }
  981.  
  982.  
  983. # test help info all-registers
  984. send "help info all-registers\n"
  985. expect {
  986.     -re "List of all registers and their contents, for selected stack frame..*\
  987. Register name as argument means describe only that register..*$prompt $"\
  988.             { pass "help info all-registers" }
  989.     -re "$prompt $"    { fail "help info all-registers" }
  990.     timeout        { fail "(timeout) help info all-registers" }
  991.     }
  992.  
  993.  
  994. # test help info args
  995. send "help info args\n"
  996. expect {
  997.     -re "Argument variables of current stack frame..*$prompt $"\
  998.             { pass "help info args" }
  999.     -re "$prompt $"    { fail "help info args" }
  1000.     timeout        { fail "(timeout) help info args" }
  1001.     }
  1002.  
  1003.  
  1004. # test help info breakpoints
  1005. # FIXME -- this should probably use the full pattern, but it won't work for some reason
  1006. send "help info breakpoints\n"
  1007. expect {
  1008.     -re "Status of user-settable breakpoints, or breakpoint number NUMBER..*\
  1009. breakpoint set..*$prompt $"\
  1010.             { pass "help info breakpoints" }
  1011.     -re "$prompt $"    { fail "help info breakpoints" }
  1012.     timeout        { fail "(timeout) help info breakpoints" }
  1013.     }
  1014.  
  1015.  
  1016. # test help info catch
  1017. send "help info catch\n"
  1018. expect {
  1019.     -re "Exceptions that can be caught in the current stack frame..*$prompt $"\
  1020.             { pass "help info catch" }
  1021.     -re "$prompt $"    { fail "help info catch" }
  1022.     timeout        { fail "(timeout) help info catch" }
  1023.     }
  1024.  
  1025.  
  1026. # test help info copying
  1027. send "help info copying\n"
  1028. expect {
  1029.     -re "Conditions for redistributing copies of GDB..*$prompt $"\
  1030.             { pass "help info copying" }
  1031.     -re "$prompt $"    { fail "help info copying" }
  1032.     timeout        { fail "(timeout) help info copying" }
  1033.     }
  1034.  
  1035.  
  1036. # test help info display
  1037. send "help info display\n"
  1038. expect {
  1039.     -re "Expressions to display when program stops, with code numbers..*$prompt $"\
  1040.             { pass "help info display" }
  1041.     -re "$prompt $"    { fail "help info display" }
  1042.     timeout        { fail "(timeout) help info display" }
  1043.     }
  1044.  
  1045.  
  1046. # test help info frame "f" abbreviation
  1047. send "help info f\n"
  1048. expect {
  1049.     -re "All about selected stack frame, or frame at ADDR..*$prompt $"\
  1050.             { pass "help info frame \"f\" abbreviation" }
  1051.     -re "$prompt $"    { fail "help info frame \"f\" abbreviation" }
  1052.     timeout        { fail "(timeout) help info frame \"f\" abbreviation" }
  1053.     }
  1054.  
  1055.  
  1056. # test help info frame
  1057. send "help info frame\n"
  1058. expect {
  1059.     -re "All about selected stack frame, or frame at ADDR..*$prompt $"\
  1060.             { pass "help info frame" }
  1061.     -re "$prompt $"    { fail "help info frame" }
  1062.     timeout        { fail "(timeout) help info frame" }
  1063.     }
  1064.  
  1065.  
  1066. # test help info files
  1067. send "help info files\n"
  1068. expect {
  1069.     -re "Names of targets and files being debugged..*\
  1070. Shows the entire stack of targets currently in use \(including the exec-file,.*\
  1071. core-file, and process, if any\), as well as the symbol file name..*$prompt $"\
  1072.             { pass "help info files" }
  1073.     -re "$prompt $"    { fail "help info files" }
  1074.     timeout        { fail "(timeout) help info files" }
  1075.     }
  1076.  
  1077.  
  1078. # test help info float
  1079. send "help info float\n"
  1080. expect {
  1081.     -re "Print the status of the floating point unit.*$prompt $"\
  1082.             { pass "help info float" }
  1083.     -re "$prompt $"    { fail "help info float" }
  1084.     timeout        { fail "(timeout) help info float" }
  1085.     }
  1086.  
  1087.  
  1088. # test help info functions
  1089. send "help info functions\n"
  1090. expect {
  1091.     -re "All function names, or those matching REGEXP..*$prompt $"\
  1092.             { pass "help info functions" }
  1093.     -re "$prompt $"    { fail "help info functions" }
  1094.     timeout        { fail "(timeout) help info functions" }
  1095.     }
  1096.  
  1097.  
  1098. # test help info line
  1099. send "help info line\n"
  1100. expect {
  1101.     -re "Core addresses of the code for a source line..*\
  1102. Line can be specified as.*\
  1103.   LINENUM, to list around that line in current file,.*\
  1104.   FILE:LINENUM, to list around that line in that file,.*\
  1105.   FUNCTION, to list around beginning of that function,.*\
  1106.   FILE:FUNCTION, to distinguish among like-named static functions..*\
  1107. Default is to describe the last source line that was listed..*\
  1108. This sets the default address for \"x\" to the line's first instruction.*\
  1109. so that \"x.i\" suffices to start examining the machine code..*\
  1110. The address is also stored as the value of \"._\"..*$prompt $"\
  1111.             { pass "help info line" }
  1112.     -re "$prompt $"    { fail "help info line" }
  1113.     timeout        { fail "(timeout) help info line" }
  1114.     }
  1115.  
  1116.  
  1117. # test help info locals
  1118. send "help info locals\n"
  1119. expect {
  1120.     -re "Local variables of current stack frame..*$prompt $"\
  1121.             { pass "help info locals" }
  1122.     -re "$prompt $"    { fail "help info locals" }
  1123.     timeout        { fail "(timeout) help info locals" }
  1124.     }
  1125.  
  1126.  
  1127. # test help info program
  1128. send "help info program\n"
  1129. expect {
  1130.     -re "Execution status of the program..*$prompt $"\
  1131.             { pass "help info program" }
  1132.     -re "$prompt $"    { fail "help info program" }
  1133.     timeout        { fail "(timeout) help info program" }
  1134.     }
  1135.  
  1136.  
  1137. # test help info registers
  1138. send "help info registers\n"
  1139. expect {
  1140.     -re "List of integer registers and their contents, for selected stack frame..*\
  1141. Register name as argument means describe only that register..*$prompt $"\
  1142.             { pass "help info registers" }
  1143.     -re "$prompt $"    { fail "help info registers" }
  1144.     timeout        { fail "(timeout) help info registers" }
  1145.     }
  1146.  
  1147.  
  1148. # test help info stack "s" abbreviation
  1149. send "help info s\n"
  1150. expect {
  1151.     -re "Backtrace of the stack, or innermost COUNT frames..*$prompt $"\
  1152.             { pass "help info stack \"s\" abbreviation" }
  1153.     -re "$prompt $"    { fail "help info stack \"s\" abbreviation" }
  1154.     timeout        { fail "(timeout) help info stack \"s\" abbreviation" }
  1155.     }
  1156.  
  1157.  
  1158. # test help info stack
  1159. send "help info stack\n"
  1160. expect {
  1161.     -re "Backtrace of the stack, or innermost COUNT frames..*$prompt $"\
  1162.             { pass "help info stack" }
  1163.     -re "$prompt $"    { fail "help info stack" }
  1164.     timeout        { fail "(timeout) help info stack" }
  1165.     }
  1166.  
  1167.  
  1168. # test help info set
  1169. send "help info set\n"
  1170. expect {
  1171.     -re "Show all GDB settings..*$prompt $"\
  1172.             { pass "help info set" }
  1173.     -re "$prompt $"    { fail "help info set" }
  1174.     timeout        { fail "(timeout) help info set" }
  1175.     }
  1176.  
  1177.  
  1178. # test help info signals
  1179. send "help info signals\n"
  1180. expect {
  1181.     -re "What debugger does when program gets various signals..*\
  1182. Specify a signal number as argument to print info on that signal only..*$prompt $"\
  1183.             { pass "help info signals" }
  1184.     -re "$prompt $"    { fail "help info signals" }
  1185.     timeout        { fail "(timeout) help info signals" }
  1186.     }
  1187.  
  1188.  
  1189. # test help info source
  1190. send "help info source\n"
  1191. expect {
  1192.     -re "Information about the current source file..*$prompt $"\
  1193.             { pass "help info source" }
  1194.     -re "$prompt $"    { fail "help info source" }
  1195.     timeout        { fail "(timeout) help aliases" }
  1196.     }
  1197.  
  1198.  
  1199. # test help info sources
  1200. send "help info sources\n"
  1201. expect {
  1202.     -re "Source files in the program..*$prompt $"\
  1203.             { pass "help info sources" }
  1204.     -re "$prompt $"    { fail "help info sources" }
  1205.     timeout        { fail "(timeout) help info sources" }
  1206.     }
  1207.  
  1208.  
  1209. # test help info target
  1210. send "help info target\n"
  1211. expect {
  1212.     -re "Names of targets and files being debugged..*\
  1213. Shows the entire stack of targets currently in use \(including the exec-file,.*\
  1214. core-file, and process, if any\), as well as the symbol file name..*$prompt $"\
  1215.             { pass "help info target" }
  1216.     -re "$prompt $"    { fail "help info target" }
  1217.     timeout        { fail "(timeout) help info target" }
  1218.     }
  1219.  
  1220.  
  1221. # test help info terminal
  1222. send "help info terminal\n"
  1223. expect {
  1224.     -re "Print inferior's saved terminal status..*$prompt $"\
  1225.             { pass "help info terminal" }
  1226.     -re "$prompt $"    { fail "help info terminal" }
  1227.     timeout        { fail "(timeout) help info terminal" }
  1228.     }
  1229.  
  1230.  
  1231. # test help info types
  1232. send "help info types\n"
  1233. expect {
  1234.     -re "All type names, or those matching REGEXP..*$prompt $"\
  1235.             { pass "help info types" }
  1236.     -re "$prompt $"    { fail "help info types" }
  1237.     timeout        { fail "(timeout) help info types" }
  1238.     }
  1239.  
  1240.  
  1241. # test help info variables
  1242. send "help info variables\n"
  1243. expect {
  1244.     -re "All global and static variable names, or those matching REGEXP..*$prompt $"\
  1245.             { pass "help info variables" }
  1246.     -re "$prompt $"    { fail "help info variables" }
  1247.     timeout        { fail "(timeout) help info variables" }
  1248.     }
  1249.  
  1250.  
  1251. # test help info warranty
  1252. send "help info warranty\n"
  1253. expect {
  1254.     -re "Various kinds of warranty you do not have..*$prompt $"\
  1255.             { pass "help info warranty" }
  1256.     -re "$prompt $"    { fail "help info warranty" }
  1257.     timeout        { fail "(timeout) help info warranty" }
  1258.     }
  1259.  
  1260.  
  1261. # test help info watchpoints
  1262. send "help info watchpoints\n"
  1263. expect {
  1264.     -re "Synonym for ``info breakpoints''..*$prompt $"\
  1265.             { pass "help info watchpoints" }
  1266.     -re "$prompt $"    { fail "help info watchpoints" }
  1267.     timeout        { fail "(timeout) help info watchpoints" }
  1268.     }
  1269.  
  1270.  
  1271. # test help inspect
  1272. send "help inspect\n"
  1273. expect {
  1274.     -re "Same as \"print\" command, except that if you are running in the epoch.*\
  1275. environment, the value is printed in its own window..*$prompt $"\
  1276.             { pass "help inspect" }
  1277.     -re "$prompt $"    { fail "help inspect" }
  1278.     timeout        { fail "(timeout) help inspect" }
  1279.     }
  1280.  
  1281.  
  1282. # test help jump
  1283. send "help jump\n"
  1284. expect {
  1285.     -re "Continue program being debugged at specified line or address..*\
  1286. Give as argument either LINENUM or \*ADDR, where ADDR is an expression.*\
  1287. for an address to start at..*$prompt $"\
  1288.             { pass "help jump" }
  1289.     -re "$prompt $"    { fail "help jump" }
  1290.     timeout        { fail "(timeout) help jump" }
  1291.     }
  1292.  
  1293.  
  1294. # test help kill
  1295. send "help kill\n"
  1296. expect {
  1297.     -re "Kill execution of program being debugged..*$prompt $"\
  1298.             { pass "help kill" }
  1299.     -re "$prompt $"    { fail "help kill" }
  1300.     timeout        { fail "(timeout) help kill" }
  1301.     }
  1302.  
  1303.  
  1304. # test help list "l" abbreviation
  1305. send "help l\n"
  1306. expect {
  1307.     -re "List specified function or line..*\
  1308. With no argument, lists ten more lines after or around previous listing..*\
  1309. \"list -\" lists the ten lines before a previous ten-line listing..*\
  1310. One argument specifies a line, and ten lines are listed around that line..*\
  1311. Two arguments with comma between specify starting and ending lines to list..*\
  1312. Lines can be specified in these ways:.*\
  1313.   LINENUM, to list around that line in current file,.*\
  1314.   FILE:LINENUM, to list around that line in that file,.*\
  1315.   FUNCTION, to list around beginning of that function,.*\
  1316.   FILE:FUNCTION, to distinguish among like-named static functions..*\
  1317.   \*ADDRESS, to list around the line containing that address..*\
  1318. With two args if one is empty it stands for ten lines away from the other arg..*$prompt $"\
  1319.             { pass "help list \"l\" abbreviation" }
  1320.     -re "$prompt $"    { fail "help list \"l\" abbreviation" }
  1321.     timeout        { fail "(timeout) help list \"l\" abbreviation" }
  1322.     }
  1323.  
  1324.  
  1325. # test help list
  1326. send "help list\n"
  1327. expect {
  1328.     -re "List specified function or line..*\
  1329. With no argument, lists ten more lines after or around previous listing..*\
  1330. \"list -\" lists the ten lines before a previous ten-line listing..*\
  1331. One argument specifies a line, and ten lines are listed around that line..*\
  1332. Two arguments with comma between specify starting and ending lines to list..*\
  1333. Lines can be specified in these ways:.*\
  1334.   LINENUM, to list around that line in current file,.*\
  1335.   FILE:LINENUM, to list around that line in that file,.*\
  1336.   FUNCTION, to list around beginning of that function,.*\
  1337.   FILE:FUNCTION, to distinguish among like-named static functions..*\
  1338.   \*ADDRESS, to list around the line containing that address..*\
  1339. With two args if one is empty it stands for ten lines away from the other arg..*$prompt $"\
  1340.             { pass "help list" }
  1341.     -re "$prompt $"    { fail "help list" }
  1342.     timeout        { fail "(timeout) help list" }
  1343.     }
  1344.  
  1345.  
  1346. # test help load
  1347. send "help load\n"
  1348. expect {
  1349.     -re "Dynamically load FILE into the running program, and record its symbols.*\
  1350. for access from GDB..*$prompt $"\
  1351.             { pass "help load" }
  1352.     -re "$prompt $"    { fail "help load" }
  1353.     timeout        { fail "(timeout) help load" }
  1354.     }
  1355.  
  1356.  
  1357. # test help make
  1358. send "help make\n"
  1359. expect {
  1360.     -re "Run the ``make'' program using the rest of the line as arguments..*$prompt $"\
  1361.             { pass "help make" }
  1362.     -re "$prompt $"    { fail "help make" }
  1363.     timeout        { fail "(timeout) help make" }
  1364.     }
  1365.  
  1366.  
  1367. # test help next "n" abbreviation
  1368. send "help n\n"
  1369. expect {
  1370.     -re "Step program, proceeding through subroutine calls..*\
  1371. Like the \"step\" command as long as subroutine calls do not happen;.*\
  1372. when they do, the call is treated as one instruction..*\
  1373. Argument N means do this N times \(or till program stops for another reason\)..*$prompt $"\
  1374.             { pass "help next \"n\" abbreviation" }
  1375.     -re "$prompt $"    { fail "help next \"n\" abbreviation" }
  1376.     timeout        { fail "(timeout) help next \"n\" abbreviation" }
  1377.     }
  1378.  
  1379.  
  1380. # test help next
  1381. send "help next\n"
  1382. expect {
  1383.     -re "Step program, proceeding through subroutine calls..*\
  1384. Like the \"step\" command as long as subroutine calls do not happen;.*\
  1385. when they do, the call is treated as one instruction..*\
  1386. Argument N means do this N times \(or till program stops for another reason\)..*$prompt $"\
  1387.             { pass "help next" }
  1388.     -re "$prompt $"    { fail "help next" }
  1389.     timeout        { fail "(timeout) help next" }
  1390.     }
  1391.  
  1392.  
  1393. # test help nexti
  1394. send "help ni\n"
  1395. expect {
  1396.     -re "Step one instruction, but proceed through subroutine calls..*\
  1397. Argument N means do this N times \(or till program stops for another reason\)..*$prompt $"\
  1398.             { pass "help nexti" }
  1399.     -re "$prompt $"    { fail "help nexti" }
  1400.     timeout        { fail "(timeout) help nexti" }
  1401.     }
  1402.  
  1403.  
  1404. # all the commands that used to be here are now in "maintainance" instead
  1405. # test help obscure
  1406. send "help obscure\n"
  1407. expect {
  1408.     -re "Obscure features..*\
  1409. List of commands:.*\
  1410. Type \"help\" followed by command name for full documentation..*\
  1411. Command name abbreviations are allowed if unambiguous..*$prompt $"\
  1412.             { pass "help obscure" }
  1413.     -re "$prompt $"    { fail "help obscure" }
  1414.     timeout        { fail "(timeout) help obscure" }
  1415.     }
  1416.  
  1417.  
  1418. # test help output
  1419. send "help output\n"
  1420. expect {
  1421.     -re "Like \"print\" but don't put in value history and don't print newline..*\
  1422. This is useful in user-defined commands..*$prompt $"\
  1423.             { pass "help output" }
  1424.     -re "$prompt $"    { fail "help output" }
  1425.     timeout        { fail "(timeout) help output" }
  1426.     }
  1427.  
  1428.  
  1429. # test help print "p" abbreviation
  1430. # FIXME -- this should probably use the full pattern, but it won't work for some reason
  1431. send "help p\n"
  1432. expect {
  1433.     -re "Print value of expression EXP..*\
  1434. Variables accessible are those of the lexical environment of the selected.*\
  1435. EXP may be preceded with /FMT, where FMT is a format letter.*\
  1436. but no count or size letter \(see \"x\" command\)..*$prompt $"\
  1437.             { pass "help print \"p\" abbreviation" }
  1438.     -re "$prompt $"    { fail "help print \"p\" abbreviation" }
  1439.     timeout        { fail "(timeout) help print \"p\" abbreviation" }
  1440.     }
  1441.  
  1442.  
  1443. # test help print
  1444. # FIXME -- this should probably use the full pattern, but it won't work for some reason
  1445. send "help print\n"
  1446. expect {
  1447.     -re "Print value of expression EXP..*\
  1448. Variables accessible are those of the lexical environment of the selected.*\
  1449. EXP may be preceded with /FMT, where FMT is a format letter.*\
  1450. but no count or size letter \(see \"x\" command\)..*$prompt $"\
  1451.             { pass "help print" }
  1452.     -re "$prompt $"    { fail "help print" }
  1453.     timeout        { fail "(timeout) help print" }
  1454.     }
  1455.  
  1456.  
  1457. # test help path
  1458. send "help path\n"
  1459. expect {
  1460.     -re "Add directory DIR\(s\) to beginning of search path for object files..*\
  1461. .cwd in the path means the current working directory..*\
  1462. This path is equivalent to the .PATH shell variable.  It is a list of.*\
  1463. directories, separated by colons.  These directories are searched to find.*\
  1464. fully linked executable files and separately compiled object files as needed..*$prompt $"\
  1465.             { pass "help path" }
  1466.     -re "$prompt $"    { fail "help path" }
  1467.     timeout        { fail "(timeout) help path" }
  1468.     }
  1469.  
  1470.  
  1471. # test help printcmds
  1472. send "help printcmds\n"
  1473. expect {
  1474.     -re "Undefined command: \"printcmds\".  Try \"help\"..*$prompt $"\
  1475.             { pass "help printcmds" }
  1476.     -re "$prompt $"    { fail "help printcmds" }
  1477.     timeout        { fail "(timeout) help printcmds" }
  1478.     }
  1479.  
  1480.  
  1481. # test help printf
  1482. send "help printf\n"
  1483. expect {
  1484.     -re "printf \"printf format string\", arg1, arg2, arg3, ..., argn.*\
  1485. This is useful for formatted output in user-defined commands..*$prompt $"\
  1486.             { pass "help printf" }
  1487.     -re "$prompt $"    { fail "help printf" }
  1488.     timeout        { fail "(timeout) help printf" }
  1489.     }
  1490.  
  1491.  
  1492. # this command doesn't exist in GDB 4.5.8
  1493. # test help printsyms
  1494. #send "help printsyms\n"
  1495. #expect {
  1496. #    -re "Print dump of current symbol definitions to file OUTFILE..*\
  1497. #If a SOURCE file is specified, dump only that file's symbols..*$prompt $"\
  1498. #            { pass "help printsyms" }
  1499. #    -re "$prompt $"    { fail "help printsyms" }
  1500. #    timeout        { fail "(timeout) help printsyms" }
  1501. #    }
  1502.  
  1503. # test help ptype
  1504. send "help ptype\n"
  1505. expect {
  1506.     -re "Print definition of type TYPE..*\
  1507. Argument may be a type name defined by typedef, or \"struct STRUCTNAME\".*\
  1508. or \"union UNIONNAME\" or \"enum ENUMNAME\"..*\
  1509. The selected stack frame's lexical context is used to look up the name..*$prompt $"\
  1510.             { pass "help ptype" }
  1511.     -re "$prompt $"    { fail "help ptype" }
  1512.     timeout        { fail "(timeout) help ptype" }
  1513.     }
  1514.  
  1515.  
  1516. # test help pwd
  1517. send "help pwd\n"
  1518. expect {
  1519.     -re "Print working directory.  This is used for your program as well..*$prompt $"\
  1520.             { pass "help pwd" }
  1521.     -re "$prompt $"    { fail "help pwd" }
  1522.     timeout        { fail "(timeout) help pwd" }
  1523.     }
  1524.  
  1525.  
  1526. # test help quit "q" abbreviation
  1527. send "help q\n"
  1528. expect {
  1529.     -re "Exit gdb..*$prompt $"\
  1530.             { pass "help quit \"q\" abbreviation" }
  1531.     -re "$prompt $"    { fail "help quit \"q\" abbreviation" }
  1532.     timeout        { fail "(timeout) help quit \"q\" abbreviation" }
  1533.     }
  1534.  
  1535.  
  1536. # test help quit
  1537. send "help quit\n"
  1538. expect {
  1539.     -re "Exit gdb..*$prompt $"\
  1540.             { pass "help quit" }
  1541.     -re "$prompt $"    { fail "help quit" }
  1542.     timeout        { fail "(timeout) help quit" }
  1543.     }
  1544.  
  1545.  
  1546. # test help run "r" abbreviation
  1547. send "help r\n"
  1548. expect {
  1549.     -re "Start debugged program.  You may specify arguments to give it..*\
  1550. Args may include .*, or .*; they are expanded using \"sh\"..*\
  1551. Input and output redirection with \".\", \".\", or \"..\" are also allowed..*\
  1552. With no arguments, uses arguments last specified \(with \"run\" or \"set args\"\)..*\
  1553. To cancel previous arguments and run with no arguments,.*\
  1554. use \"set args\" without arguments..*$prompt $"\
  1555.             { pass "help run \"r\" abbreviation" }
  1556.     -re "$prompt $"    { fail "help run \"r\" abbreviation" }
  1557.     timeout        { fail "(timeout) help run \"r\" abbreviation" }
  1558.     }
  1559.  
  1560.  
  1561. # test help run
  1562. send "help run\n"
  1563. expect {
  1564.     -re "Start debugged program.  You may specify arguments to give it..*\
  1565. Args may include .*, or .*; they are expanded using \"sh\"..*\
  1566. Input and output redirection with \".\", \".\", or \"..\" are also allowed..*\
  1567. With no arguments, uses arguments last specified \(with \"run\" or \"set args\"\)..*\
  1568. To cancel previous arguments and run with no arguments,.*\
  1569. use \"set args\" without arguments..*$prompt $"\
  1570.             { pass "help run" }
  1571.     -re "$prompt $"    { fail "help run" }
  1572.     timeout        { fail "(timeout) help run" }
  1573.     }
  1574.  
  1575.  
  1576. # test help rbreak
  1577. send "help rbreak\n"
  1578. expect {
  1579.     -re "Set a breakpoint for all functions matching REGEXP..*$prompt $"\
  1580.             { pass "help rbreak" }
  1581.     -re "$prompt $"    { fail "help rbreak" }
  1582.     timeout        { fail "(timeout) help rbreak" }
  1583.     }
  1584.  
  1585.  
  1586. # test help return
  1587. send "help return\n"
  1588. expect {
  1589.     -re "Make selected stack frame return to its caller..*\
  1590. Control remains in the debugger, but when you continue.*\
  1591. execution will resume in the frame above the one now selected..*\
  1592. If an argument is given, it is an expression for the value to return..*$prompt $"\
  1593.             { pass "help return" }
  1594.     -re "$prompt $"    { fail "help return" }
  1595.     timeout        { fail "(timeout) help return" }
  1596.     }
  1597.  
  1598.  
  1599. # test help reverse-search
  1600. send "help reverse-search\n"
  1601. expect {
  1602.     -re "Search backward for regular expression \(see regex\(3\)\) from last line listed..*$prompt $"\
  1603.             { pass "help reverse-search" }
  1604.     -re "$prompt $"    { fail "help reverse-search" }
  1605.     timeout        { fail "(timeout) help reverse-search" }
  1606.     }
  1607.  
  1608.  
  1609. # test help running
  1610. send "help running\n"
  1611. expect {
  1612.     -re "Running the program..*\
  1613. List of commands:.*\
  1614. show args -- Show arguments to give program being debugged when it is started.*\
  1615. set environment -- Set environment variable value to give the program.*\
  1616. set args -- Set arguments to give program being debugged when it is started.*\
  1617. handle -- Specify how to handle a signal.*\
  1618. kill -- Kill execution of program being debugged.*\
  1619. run -- Start debugged program.*\
  1620. continue -- Continue program being debugged.*\
  1621. jump -- Continue program being debugged at specified line or address.*\
  1622. until -- Execute until the program reaches a source line greater than the current.*\
  1623. step -- Step program until it reaches a different source line.*\
  1624. next -- Step program.*\
  1625. finish -- Execute until selected stack frame returns.*\
  1626. nexti -- Step one instruction.*\
  1627. stepi -- Step one instruction exactly.*\
  1628. signal -- Continue program giving it signal number SIGNUMBER.*\
  1629. detach -- Detach a process or file previously attached.*\
  1630. attach -- Attach to a process or file outside of GDB.*\
  1631. unset environment -- Cancel environment variable VAR for the program.*\
  1632. tty -- Set terminal for future runs of program being debugged.*\
  1633. target -- Connect to a target machine or process.*\
  1634. Type \"help\" followed by command name for full documentation..*\
  1635. Command name abbreviations are allowed if unambiguous..*$prompt $"\
  1636.             { pass "help running" }
  1637.     -re "$prompt $"    { fail "help running" }
  1638.     timeout        { fail "(timeout) help running" }
  1639.     }
  1640.  
  1641.  
  1642. # test help step "s" abbreviation
  1643. send "help s\n"
  1644. expect {
  1645.     -re "Step program until it reaches a different source line..*\
  1646. Argument N means do this N times \(or till program stops for another reason\)..*$prompt $"\
  1647.             { pass "help step \"s\" abbreviation" }
  1648.     -re "$prompt $"    { fail "help step \"s\" abbreviation" }
  1649.     timeout        { fail "(timeout) help step \"s\" abbreviation" }
  1650.     }
  1651.  
  1652.  
  1653. # test help step
  1654. send "help step\n"
  1655. expect {
  1656.     -re "Step program until it reaches a different source line..*\
  1657. Argument N means do this N times \(or till program stops for another reason\)..*$prompt $"\
  1658.             { pass "help step" }
  1659.     -re "$prompt $"    { fail "help step" }
  1660.     timeout        { fail "(timeout) help step" }
  1661.     }
  1662.  
  1663.  
  1664. # test help search
  1665. send "help search\n"
  1666. expect {
  1667.     -re "Search for regular expression \(see regex\(3\)\) from last line listed..*$prompt $"\
  1668.             { pass "help search" }
  1669.     -re "$prompt $"    { fail "help search" }
  1670.     timeout        { fail "(timeout) help search" }
  1671.     }
  1672.  
  1673.  
  1674. # test help section
  1675. send "help section\n"
  1676. expect {
  1677.     -re "Change the base address of section SECTION of the exec file to ADDR..*\
  1678. This can be used if the exec file does not contain section addresses,.*\
  1679. \(such as in the a.out format\), or when the addresses specified in the.*\
  1680. file itself are wrong.  Each section must be changed separately.  The.*\
  1681. ``info files'' command lists all the sections and their addresses..*$prompt $"\
  1682.             { pass "help section" }
  1683.     -re "$prompt $"    { fail "help section" }
  1684.     timeout        { fail "(timeout) help section" }
  1685.     }
  1686.  
  1687.  
  1688. # test help set args
  1689. send "help set args\n"
  1690. expect {
  1691.     -re "Set arguments to give program being debugged when it is started..*\
  1692. Follow this command with any number of args, to be passed to the program..*$prompt $"\
  1693.             { pass "help set args" }
  1694.     -re "$prompt $"    { fail "help set args" }
  1695.     timeout        { fail "(timeout) help set args" }
  1696.     }
  1697.  
  1698.  
  1699. # test help set check "c" abbreviation
  1700. send "help set c\n"
  1701. expect {
  1702.     -re "Set the status of the type/range checker.*\
  1703. List of set check subcommands:.*\
  1704. set check range -- Set range checking.*\
  1705. set check type -- Set type checking.*\
  1706. Type \"help set check\" followed by set check subcommand name for full documentation..*\
  1707. Command name abbreviations are allowed if unambiguous..*$prompt $"\
  1708.             { pass "help set check \"c\" abbreviation" }
  1709.     -re "$prompt $"    { fail "help set check \"c\" abbreviation" }
  1710.     timeout        { fail "(timeout) help set check \"c\" abbreviation" }
  1711.     }
  1712.  
  1713.  
  1714. # test help set check "ch" abbreviation
  1715. send "help set ch\n"
  1716. expect {
  1717.     -re "Set the status of the type/range checker.*\
  1718. List of set check subcommands:.*\
  1719. set check range -- Set range checking.*\
  1720. set check type -- Set type checking.*\
  1721. Type \"help set check\" followed by set check subcommand name for full documentation..*\
  1722. Command name abbreviations are allowed if unambiguous..*$prompt $"\
  1723.             { pass "help set check \"ch\" abbreviation" }
  1724.     -re "$prompt $"    { fail "help set check \"ch\" abbreviation" }
  1725.     timeout        { fail "(timeout) help set check \"ch\" abbreviation" }
  1726.     }
  1727.  
  1728.  
  1729. # test help set check
  1730. send "help set check\n"
  1731. expect {
  1732.     -re "Set the status of the type/range checker.*\
  1733. List of set check subcommands:.*\
  1734. set check range -- Set range checking.*\
  1735. set check type -- Set type checking.*\
  1736. Type \"help set check\" followed by set check subcommand name for full documentation..*\
  1737. Command name abbreviations are allowed if unambiguous..*$prompt $"\
  1738.             { pass "help set check" }
  1739.     -re "$prompt $"    { fail "help set check" }
  1740.     timeout        { fail "(timeout) help set check" }
  1741.     }
  1742.  
  1743.  
  1744. # test help set check range
  1745. send "help set check range\n"
  1746. expect {
  1747.     -re "Set range checking.  \(on/warn/off/auto\).*$prompt $"\
  1748.             { pass "help set check range" }
  1749.     -re "$prompt $"    { fail "help set check range" }
  1750.     timeout        { fail "(timeout) help set check range" }
  1751.     }
  1752.  
  1753.  
  1754. # test help set check type
  1755. send "help set check type\n"
  1756. expect {
  1757.     -re "Set type checking.  \(on/warn/off/auto\).*$prompt $"\
  1758.             { pass "help set check type" }
  1759.     -re "$prompt $"    { fail "help set check type" }
  1760.     timeout        { fail "(timeout) help set check type" }
  1761.     }
  1762.  
  1763.  
  1764. # test help set complaints
  1765. send "help set complaints\n"
  1766. expect {
  1767.     -re "Set max number of complaints about incorrect symbols..*$prompt $"\
  1768.             { pass "help set complaints" }
  1769.     -re "$prompt $"    { fail "help set complaints" }
  1770.     timeout        { fail "(timeout) help set complaints" }
  1771.     }
  1772.  
  1773.  
  1774. # test help set confirm
  1775. send "help set confirm\n"
  1776. expect {
  1777.     -re "Set whether to confirm potentially dangerous operations..*$prompt $"\
  1778.             { pass "help set confirm" }
  1779.     -re "$prompt $"    { fail "help set confirm" }
  1780.     timeout        { fail "(timeout) help set confirm" }
  1781.     }
  1782.  
  1783.  
  1784. # test help set editing
  1785. send "help set editing\n"
  1786. expect {
  1787.     -re "Set editing of command lines as they are typed..*\
  1788. Use \"on\" to enable to enable the editing, and \"off\" to disable it..*\
  1789. Without an argument, command line editing is enabled.  To edit, use.*\
  1790. EMACS-like or VI-like commands like control-P or ESC..*$prompt $"\
  1791.             { pass "help set editing" }
  1792.     -re "$prompt $"    { fail "help set editing" }
  1793.     timeout        { fail "(timeout) help set editing" }
  1794.     }
  1795.  
  1796.  
  1797. # test help set environment
  1798. send "help set environment\n"
  1799. expect {
  1800.     -re "Set environment variable value to give the program..*\
  1801. Arguments are VAR VALUE where VAR is variable name and VALUE is value..*\
  1802. VALUES of environment variables are uninterpreted strings..*\
  1803. This does not affect the program until the next \"run\" command..*$prompt $"\
  1804.             { pass "help set environment" }
  1805.     -re "$prompt $"    { fail "help set environment" }
  1806.     timeout        { fail "(timeout) help set environment" }
  1807.     }
  1808.  
  1809.  
  1810. # test help set height
  1811. send "help set height\n"
  1812. expect {
  1813.     -re "Set number of lines gdb thinks are in a page..*$prompt $"\
  1814.             { pass "help set height" }
  1815.     -re "$prompt $"    { fail "help set height" }
  1816.     timeout        { fail "(timeout) help set height" }
  1817.     }
  1818.  
  1819.  
  1820. # test help set history expansion
  1821. send "help set history expansion\n"
  1822. expect {
  1823.     -re "Set history expansion on command input..*\
  1824. Without an argument, history expansion is enabled..*$prompt $"\
  1825.             { pass "help set history expansion" }
  1826.     -re "$prompt $"    { fail "help set history expansion" }
  1827.     timeout        { fail "(timeout) help set history expansion" }
  1828.     }
  1829.  
  1830.  
  1831. # test help set history filename
  1832. send "help set history filename\n"
  1833. expect {
  1834.     -re "Set the filename in which to record the command history.*\
  1835.  \(the list of previous commands of which a record is kept\)..*$prompt $"\
  1836.             { pass "help set history filename" }
  1837.     -re "$prompt $"    { fail "help set history filename" }
  1838.     timeout        { fail "(timeout) help set history filename" }
  1839.     }
  1840.  
  1841.  
  1842. # test help set history save
  1843. send "help set history save\n"
  1844. expect {
  1845.     -re "Set saving of the history record on exit..*\
  1846. Use \"on\" to enable to enable the saving, and \"off\" to disable it..*\
  1847. Without an argument, saving is enabled..*$prompt $"\
  1848.             { pass "help set history save" }
  1849.     -re "$prompt $"    { fail "help set history save" }
  1850.     timeout        { fail "(timeout) help set history save" }
  1851.     }
  1852.  
  1853.  
  1854. # test help set history size
  1855. send "help set history size\n"
  1856. expect {
  1857.     -re "Set the size of the command history, .*\
  1858. ie. the number of previous commands to keep a record of..*$prompt $"\
  1859.             { pass "help set history size" }
  1860.     -re "$prompt $"    { fail "help set history size" }
  1861.     timeout        { fail "(timeout) help set history size" }
  1862.     }
  1863.  
  1864.  
  1865. # test help set history
  1866. send "help set history\n"
  1867. expect {
  1868.     -re "Generic command for setting command history parameters..*\
  1869. List of set history subcommands:.*\
  1870. set history filename -- Set the filename in which to record the command history.*\
  1871. set history size -- Set the size of the command history.*\
  1872. set history save -- Set saving of the history record on exit.*\
  1873. set history expansion -- Set history expansion on command input.*\
  1874. Type \"help set history\" followed by set history subcommand name for full documentation..*\
  1875. Command name abbreviations are allowed if unambiguous..*$prompt $"\
  1876.             { pass "help set history" }
  1877.     -re "$prompt $"    { fail "help set history" }
  1878.     timeout        { fail "(timeout) help set history" }
  1879.     }
  1880.  
  1881.  
  1882. # test help set language
  1883. send "help set language\n"
  1884. expect {
  1885.     -re "Set the current source language..*$prompt $"\
  1886.             { pass "help set language" }
  1887.     -re "$prompt $"    { fail "help set language" }
  1888.     timeout        { fail "(timeout) help set language" }
  1889.     }
  1890.  
  1891.  
  1892. # test help set listsize
  1893. send "help set listsize\n"
  1894. expect {
  1895.     -re "Set number of source lines gdb will list by default..*$prompt $"\
  1896.             { pass "help set listsize" }
  1897.     -re "$prompt $"    { fail "help set listsize" }
  1898.     timeout        { fail "(timeout) help set listsize" }
  1899.     }
  1900.  
  1901.  
  1902. # test help set print "p" abbreviation
  1903. send "help set p\n"
  1904. expect {
  1905.     -re ".*\
  1906. Generic command for setting how things print..*\
  1907. List of set print subcommands:.*\
  1908. set print address -- Set printing of addresses.*\
  1909. set print array -- Set prettyprinting of arrays.*\
  1910. set print union -- Set printing of unions interior to structures.*\
  1911. set print pretty -- Set prettyprinting of structures.*\
  1912. set print elements -- Set limit on string chars or array elements to print.*\
  1913. set print asm-demangle -- Set demangling of C\+\+ names in disassembly listings.*\
  1914. set print sevenbit-strings -- Set printing of 8-bit characters in strings as .nnn.*\
  1915. set print demangle -- Set demangling of encoded C\+\+ names when displaying symbols.*\
  1916. set print object -- Set printing of object's derived type based on vtable info.*\
  1917. set print vtbl -- Set printing of C\+\+ virtual function tables.*\
  1918. Type \"help set print\" followed by set print subcommand name for full documentation..*\
  1919. Command name abbreviations are allowed if unambiguous..*$prompt $"\
  1920.             { pass "help set print \"p\" abbreviatio" }
  1921.     -re "$prompt $"    { fail "help set print \"p\" abbreviatio" }
  1922.     timeout        { fail "(timeout) help set print \"p\" abbreviatio" }
  1923.     }
  1924.  
  1925.  
  1926. # test help set print "pr" abbreviation
  1927. send "help set pr\n"
  1928. expect {
  1929.     -re ".*\
  1930. Generic command for setting how things print..*\
  1931. List of set print subcommands:.*\
  1932. set print address -- Set printing of addresses.*\
  1933. set print array -- Set prettyprinting of arrays.*\
  1934. set print union -- Set printing of unions interior to structures.*\
  1935. set print pretty -- Set prettyprinting of structures.*\
  1936. set print elements -- Set limit on string chars or array elements to print.*\
  1937. set print asm-demangle -- Set demangling of C\+\+ names in disassembly listings.*\
  1938. set print sevenbit-strings -- Set printing of 8-bit characters in strings as .nnn.*\
  1939. set print demangle -- Set demangling of encoded C\+\+ names when displaying symbols.*\
  1940. set print object -- Set printing of object's derived type based on vtable info.*\
  1941. set print vtbl -- Set printing of C\+\+ virtual function tables.*\
  1942. Type \"help set print\" followed by set print subcommand name for full documentation..*\
  1943. Command name abbreviations are allowed if unambiguous..*$prompt $"\
  1944.             { pass "help set print \"pr\" abbreviation" }
  1945.     -re "$prompt $"    { fail "help set print \"pr\" abbreviation" }
  1946.     timeout        { fail "(timeout) help set print \"pr\" abbreviation" }
  1947.     }
  1948.  
  1949.  
  1950. # test help set print
  1951. send "help set print\n"
  1952. expect {
  1953.     -re ".*\
  1954. Generic command for setting how things print..*\
  1955. List of set print subcommands:.*\
  1956. set print address -- Set printing of addresses.*\
  1957. set print array -- Set prettyprinting of arrays.*\
  1958. set print union -- Set printing of unions interior to structures.*\
  1959. set print pretty -- Set prettyprinting of structures.*\
  1960. set print elements -- Set limit on string chars or array elements to print.*\
  1961. set print asm-demangle -- Set demangling of C\+\+ names in disassembly listings.*\
  1962. set print sevenbit-strings -- Set printing of 8-bit characters in strings as .nnn.*\
  1963. set print demangle -- Set demangling of encoded C\+\+ names when displaying symbols.*\
  1964. set print object -- Set printing of object's derived type based on vtable info.*\
  1965. set print vtbl -- Set printing of C\+\+ virtual function tables.*\
  1966. Type \"help set print\" followed by set print subcommand name for full documentation..*\
  1967. Command name abbreviations are allowed if unambiguous..*$prompt $"\
  1968.             { pass "help set print" }
  1969.     -re "$prompt $"    { fail "help set print" }
  1970.     timeout        { fail "(timeout) help set print" }
  1971.     }
  1972.  
  1973.  
  1974. # test help set print address
  1975. send "help set print address\n"
  1976. expect {
  1977.     -re "Set printing of addresses..*$prompt $"\
  1978.             { pass "help set print address" }
  1979.     -re "$prompt $"    { fail "help set print address" }
  1980.     timeout        { fail "(timeout) help set print address" }
  1981.     }
  1982.  
  1983.  
  1984. # test help set print array
  1985. send "help set print array\n"
  1986. expect {
  1987.     -re "Set prettyprinting of arrays..*$prompt $"\
  1988.             { pass "help set print array" }
  1989.     -re "$prompt $"    { fail "help set print array" }
  1990.     timeout        { fail "(timeout) help set print array" }
  1991.     }
  1992.  
  1993.  
  1994. # test help set print asm-demangle
  1995. send "help set print asm-demangle\n"
  1996. expect {
  1997.     -re "Set demangling of C\+\+ names in disassembly listings..*$prompt $"\
  1998.             { pass "help set print asm-demangle" }
  1999.     -re "$prompt $"    { fail "help set print asm-demangle" }
  2000.     timeout        { fail "(timeout) help set print asm-demangle" }
  2001.     }
  2002.  
  2003.  
  2004. # test help set print demangle
  2005. send "help set print demangle\n"
  2006. expect {
  2007.     -re "Set demangling of encoded C\+\+ names when displaying symbols..*$prompt $"\
  2008.             { pass "help set print demangle" }
  2009.     -re "$prompt $"    { fail "help set print demangle" }
  2010.     timeout        { fail "(timeout) help set print demangle" }
  2011.     }
  2012.  
  2013.  
  2014. # test help set print elements
  2015. send "help set print elements\n"
  2016. expect {
  2017.     -re "Set limit on string chars or array elements to print..*\
  2018. \"set print elements 0\" causes there to be no limit..*$prompt $"\
  2019.             { pass "help set print elements" }
  2020.     -re "$prompt $"    { fail "help set print elements" }
  2021.     timeout        { fail "(timeout) help set print elements" }
  2022.     }
  2023.  
  2024.  
  2025. # test help set print object
  2026. send "help set print object\n"
  2027. expect {
  2028.     -re "Set printing of object's derived type based on vtable info..*$prompt $"\
  2029.             { pass "help set print object" }
  2030.     -re "$prompt $"    { fail "help set print object" }
  2031.     timeout        { fail "(timeout) help set print object" }
  2032.     }
  2033.  
  2034.  
  2035. # test help set print pretty
  2036. send "help set print pretty\n"
  2037. expect {
  2038.     -re "Set prettyprinting of structures..*$prompt $"\
  2039.             { pass "help set print pretty" }
  2040.     -re "$prompt $"    { fail "help set print pretty" }
  2041.     timeout        { fail "(timeout) help set print pretty" }
  2042.     }
  2043.  
  2044.  
  2045. # test help set print sevenbit-strings
  2046. send "help set print sevenbit-strings\n"
  2047. expect {
  2048.     -re "Set printing of 8-bit characters in strings as .nnn..*$prompt $"\
  2049.             { pass "help set print sevenbit-strings" }
  2050.     -re "$prompt $"    { fail "help set print sevenbit-strings" }
  2051.     timeout        { fail "(timeout) help set print sevenbit-strings" }
  2052.     }
  2053.  
  2054.  
  2055. # test help set print union
  2056. send "help set print union\n"
  2057. expect {
  2058.     -re "Set printing of unions interior to structures..*$prompt $"\
  2059.             { pass "help set print union" }
  2060.     -re "$prompt $"    { fail "help set print union" }
  2061.     timeout        { fail "(timeout) help set print union" }
  2062.     }
  2063.  
  2064.  
  2065. # test help set print vtbl
  2066. send "help set print vtbl\n"
  2067. expect {
  2068.     -re "Set printing of C\+\+ virtual function tables..*$prompt $"\
  2069.             { pass "help set print vtbl" }
  2070.     -re "$prompt $"    { fail "help set print vtbl" }
  2071.     timeout        { fail "(timeout) help set print vtbl" }
  2072.     }
  2073.  
  2074.  
  2075. # test help set prompt
  2076. send "help set prompt\n"
  2077. expect {
  2078.     -re "Set gdb's prompt.*$prompt $"\
  2079.             { pass "help set prompt" }
  2080.     -re "$prompt $"    { fail "help set prompt" }
  2081.     timeout        { fail "(timeout) help set prompt" }
  2082.     }
  2083.  
  2084.  
  2085. # test help set radix
  2086. send "help set radix\n"
  2087. expect {
  2088.     -re "Set default input and output number radix..*$prompt $"\
  2089.             { pass "help set radix" }
  2090.     -re "$prompt $"    { fail "help set radix" }
  2091.     timeout        { fail "(timeout) help set radix" }
  2092.     }
  2093.  
  2094.  
  2095. # test help set symbol-reloading
  2096. send "help set symbol-reloading\n"
  2097. expect {
  2098.     -re "Set dynamic symbol table reloading multiple times in one run..*$prompt $"\
  2099.             { pass "help set symbol-reloading" }
  2100.     -re "$prompt $"    { fail "help set symbol-reloading" }
  2101.     timeout        { fail "(timeout) help set symbol-reloading" }
  2102.     }
  2103.  
  2104.  
  2105. # test help set variable
  2106. send "help set variable\n"
  2107. expect {
  2108.     -re ".*\
  2109. Evaluate expression EXP and assign result to variable VAR, using assignment.*\
  2110. syntax appropriate for the current language \(VAR = EXP or VAR := EXP for.*\
  2111. example\).  VAR may be a debugger \"convenience\" variable \(names starting.*\
  2112. with \\\$\), a register \(a few standard names starting with \\\$\), or an actual.*\
  2113. variable in the program being debugged.  EXP is any valid expression.*\
  2114. This may usually be abbreviated to simply \"set\"..*$prompt $"\
  2115.             { pass "help set variable" }
  2116.     -re "$prompt $"    { fail "help set variable" }
  2117.     timeout        { fail "(timeout) help set variable" }
  2118.     }
  2119.  
  2120.  
  2121. # test help set verbose
  2122. send "help set verbose\n"
  2123. expect {
  2124.     -re "Set verbosity..*$prompt $"\
  2125.             { pass "help set verbose" }
  2126.     -re "Set verbose printing of informational messages.*$prompt $"\
  2127.             { pass "help set verbose. FIXME" }
  2128.     -re "$prompt $"    { fail "help set verbose" }
  2129.     timeout        { fail "(timeout) help set verbose" }
  2130.     }
  2131.  
  2132.  
  2133. #test help set width
  2134. send "help set width\n"
  2135. expect {
  2136.     -re "Set number of characters gdb thinks are in a line..*$prompt $"\
  2137.             { pass "help set width" }
  2138.     -re "$prompt $"    { fail "help set width" }
  2139.     timeout        { fail "(timeout) help set width" }
  2140.     }
  2141.  
  2142.  
  2143. # test help set write
  2144. # This is only supported on targets which use exec.o.
  2145. if ![istarget "rs6000-*-*"] then {
  2146.     send "help set write\n"
  2147.     expect {
  2148.     -re "Set writing into executable and core files..*$prompt $"\
  2149.             { pass "help set write" }
  2150.     -re "$prompt $"    { fail "help set write" }
  2151.     timeout        { fail "(timeout) help set write" }
  2152.     }
  2153. }
  2154.  
  2155. # test help set
  2156. # FIXME -- this should probably use the full pattern, but it won't work for some reason
  2157. # FIXME -- decstations hang randomly on this very long output from gdb and
  2158. # continue with their output only if something is sent to gdb.
  2159. # This behaviour brings expect and gdb out of sync, so we better skip this test.
  2160. if ![istarget "mips-*-ultrix*"] then {
  2161.     send "help set\n"
  2162.     expect {
  2163.     -re ".*\
  2164. Evaluate expression EXP and assign result to variable VAR, using assignment.*\
  2165. syntax appropriate for the current language \(VAR = EXP or VAR := EXP for.*\
  2166. example\).  VAR may be a debugger \"convenience\" variable \(names starting.*\
  2167. with \\\$\), a register \(a few standard names starting with \\\$\), or an actual.*\
  2168. variable in the program being debugged.  EXP is any valid expression.*\
  2169. set listsize -- Set number of source lines gdb will list by default.*\
  2170. Type \"help set\" followed by set subcommand name for full documentation..*\
  2171. Command name abbreviations are allowed if unambiguous..*\
  2172. $prompt $"\
  2173.             { pass "help set" }
  2174.     -re "$prompt $"    { fail "help set" }
  2175.     timeout        { fail "(timeout) help set" }
  2176.     }
  2177. }
  2178.  
  2179. # test help shell
  2180. send "help shell\n"
  2181. expect {
  2182.     -re "Execute the rest of the line as a shell command.  .*\
  2183. With no arguments, run an inferior shell..*$prompt $"\
  2184.             { pass "help shell" }
  2185.     -re "$prompt $"    { fail "help shell" }
  2186.     timeout        { fail "(timeout) help shell" }
  2187.     }
  2188.  
  2189.  
  2190. # test help show args
  2191. send "help show args\n"
  2192. expect {
  2193.     -re "Show arguments to give program being debugged when it is started..*\
  2194. Follow this command with any number of args, to be passed to the program..*$prompt $"\
  2195.             { pass "help show args" }
  2196.     -re "$prompt $"    { fail "help show args" }
  2197.     timeout        { fail "(timeout) help show args" }
  2198.     }
  2199.  
  2200.  
  2201. # test help show check "c" abbreviation
  2202. send "help show c\n"
  2203. expect {
  2204.     -re "Show the status of the type/range checker.*\
  2205. List of show check subcommands:.*\
  2206. show check range -- Show range checking.*\
  2207. show check type -- Show type checking.*\
  2208. Type \"help show check\" followed by show check subcommand name for full documentation..*\
  2209. Command name abbreviations are allowed if unambiguous..*$prompt $"\
  2210.             { pass "help show check \"c\" abbreviation" }
  2211.     -re "$prompt $"    { fail "help show check \"c\" abbreviation" }
  2212.     timeout        { fail "(timeout) help show check \"c\" abbreviation" }
  2213.     }
  2214.  
  2215.  
  2216. # test help show check
  2217. send "help show check\n"
  2218. expect {
  2219.     -re "Show the status of the type/range checker.*\
  2220. List of show check subcommands:.*\
  2221. show check range -- Show range checking.*\
  2222. show check type -- Show type checking.*\
  2223. Type \"help show check\" followed by show check subcommand name for full documentation..*\
  2224. Command name abbreviations are allowed if unambiguous..*$prompt $"\
  2225.             { pass "help show check" }
  2226.     -re "$prompt $"    { fail "help show check" }
  2227.     timeout        { fail "(timeout) help show check" }
  2228.     }
  2229.  
  2230.  
  2231. # test help show check range
  2232. send "help show check range\n"
  2233. expect {
  2234.     -re "Show range checking.  \(on/warn/off/auto\).*$prompt $"\
  2235.             { pass "help show check range" }
  2236.     -re "$prompt $"    { fail "help show check range" }
  2237.     timeout        { fail "(timeout) help show check range" }
  2238.     }
  2239.  
  2240.  
  2241. # test help show check type
  2242. send "help show check type\n"
  2243. expect {
  2244.     -re "Show type checking.  \(on/warn/off/auto\).*$prompt $"\
  2245.             { pass "help show check type" }
  2246.     -re "$prompt $"    { fail "help show check type" }
  2247.     timeout        { fail "(timeout) help show check type" }
  2248.     }
  2249.  
  2250.  
  2251. # test help show commands
  2252. send "help show commands\n"
  2253. expect {
  2254.     -re "Show the the history of commands you typed..*\
  2255. You can supply a command number to start with, or a `\+' to start after.*\
  2256. the previous command number shown..*$prompt $"\
  2257.             { pass "help show commands" }
  2258.     -re "$prompt $"    { fail "help show commands" }
  2259.     timeout        { fail "(timeout) help show commands" }
  2260.     }
  2261.  
  2262.  
  2263. # test help show complaints
  2264. send "help show complaints\n"
  2265. expect {
  2266.     -re "Show max number of complaints about incorrect symbols..*$prompt $"\
  2267.             { pass "help show complaints" }
  2268.     -re "$prompt $"    { fail "help show complaints" }
  2269.     timeout        { fail "(timeout) help show complaints" }
  2270.     }
  2271.  
  2272.  
  2273. # test help show confirm
  2274. send "help show confirm\n"
  2275. expect {
  2276.     -re "Show whether to confirm potentially dangerous operations..*$prompt $"\
  2277.             { pass "help show confirm" }
  2278.     -re "$prompt $"    { fail "help show confirm" }
  2279.     timeout        { fail "(timeout) help show confirm" }
  2280.     }
  2281.  
  2282.  
  2283. # test help show convenience
  2284. send "help show convenience\n"
  2285. expect {
  2286.     -re "Debugger convenience \(\".foo\"\) variables..*\
  2287. These variables are created when you assign them values;.*\
  2288. thus, \"print .foo=1\" gives \".foo\" the value 1.  Values may be any type..*\
  2289. A few convenience variables are given values automatically:.*\
  2290. \"._\"holds the last address examined with \"x\" or \"info lines\",.*\
  2291. \".__\" holds the contents of the last address examined with \"x\"..*$prompt $"\
  2292.             { pass "help show convenience" }
  2293.     -re "$prompt $"    { fail "help show convenience" }
  2294.     timeout        { fail "(timeout) help show convenience" }
  2295.     }
  2296.  
  2297.  
  2298. # test help show directories
  2299. send "help show directories\n"
  2300. expect {
  2301.     -re "Current search path for finding source files..*\
  2302. .cwd in the path means the current working directory..*\
  2303. .cdir in the path means the compilation directory of the source file..*$prompt $"\
  2304.             { pass "help show directories" }
  2305.     -re "$prompt $"    { fail "help show directories" }
  2306.     timeout        { fail "(timeout) help show directories" }
  2307.     }
  2308.  
  2309.  
  2310. # test help show editing
  2311. send "help show editing\n"
  2312. expect {
  2313.     -re "Show editing of command lines as they are typed..*\
  2314. Use \"on\" to enable to enable the editing, and \"off\" to disable it..*\
  2315. Without an argument, command line editing is enabled.  To edit, use.*\
  2316. EMACS-like or VI-like commands like control-P or ESC..*$prompt $"\
  2317.             { pass "help show editing" }
  2318.     -re "$prompt $"    { fail "help show editing" }
  2319.     timeout        { fail "(timeout) help show editing" }
  2320.     }
  2321.  
  2322.  
  2323. # test help show environment
  2324. send "help show environment\n"
  2325. expect {
  2326.     -re "The environment to give the program, or one variable's value..*\
  2327. With an argument VAR, prints the value of environment variable VAR to.*\
  2328. give the program being debugged.  With no arguments, prints the entire.*\
  2329. environment to be given to the program..*$prompt $"\
  2330.             { pass "help show environment" }
  2331.     -re "$prompt $"    { fail "help show environment" }
  2332.     timeout        { fail "(timeout) help show environment" }
  2333.     }
  2334.  
  2335.  
  2336. # test help show height
  2337. send "help show height\n"
  2338. expect {
  2339.     -re "Show number of lines gdb thinks are in a page..*$prompt $"\
  2340.             { pass "help show height" }
  2341.     -re "$prompt $"    { fail "help show height" }
  2342.     timeout        { fail "(timeout) help show height" }
  2343.     }
  2344.  
  2345.  
  2346. # test help show history expansion
  2347. send "help show history expansion\n"
  2348. expect {
  2349.     -re "Show history expansion on command input..*\
  2350. Without an argument, history expansion is enabled..*$prompt $"\
  2351.             { pass "help show history expansion" }
  2352.     -re "$prompt $"    { fail "help show history expansion" }
  2353.     timeout        { fail "(timeout) help show history expansion" }
  2354.     }
  2355.  
  2356.  
  2357. # test help show history filename
  2358. send "help show history filename\n"
  2359. expect {
  2360.     -re "Show the filename in which to record the command history.*\
  2361.  \(the list of previous commands of which a record is kept\)..*$prompt $"\
  2362.             { pass "help show history filename" }
  2363.     -re "$prompt $"    { fail "help show history filename" }
  2364.     timeout        { fail "(timeout) help show history filename" }
  2365.     }
  2366.  
  2367.  
  2368. # test help show history save
  2369. send "help show history save\n"
  2370. expect {
  2371.     -re "Show saving of the history record on exit..*\
  2372. Use \"on\" to enable to enable the saving, and \"off\" to disable it..*\
  2373. Without an argument, saving is enabled..*$prompt $"\
  2374.             { pass "help show history save" }
  2375.     -re "$prompt $"    { fail "help show history save" }
  2376.     timeout        { fail "(timeout) help show history save" }
  2377.     }
  2378.  
  2379.  
  2380. # test help show history size
  2381. send "help show history size\n"
  2382. expect {
  2383.     -re "Show the size of the command history, .*\
  2384. ie. the number of previous commands to keep a record of..*$prompt $"\
  2385.             { pass "help show history size" }
  2386.     -re "$prompt $"    { fail "help show history size" }
  2387.     timeout        { fail "(timeout) help show history size" }
  2388.     }
  2389.  
  2390.  
  2391. # test help show history
  2392. send "help show history\n"
  2393. expect {
  2394.     -re "Generic command for showing command history parameters..*\
  2395. List of show history subcommands:.*\
  2396. show history filename -- Show the filename in which to record the command history.*\
  2397. show history size -- Show the size of the command history.*\
  2398. show history save -- Show saving of the history record on exit.*\
  2399. show history expansion -- Show history expansion on command input.*\
  2400. Type \"help show history\" followed by show history subcommand name for full documentation..*\
  2401. Command name abbreviations are allowed if unambiguous..*$prompt $"\
  2402.             { pass "help show history" }
  2403.     -re "$prompt $"    { fail "help show history" }
  2404.     timeout        { fail "(timeout) help show history" }
  2405.     }
  2406.  
  2407.  
  2408. # test help show language
  2409. send "help show language\n"
  2410. expect {
  2411.     -re "Show the current source language..*$prompt $"\
  2412.             { pass "help show language" }
  2413.     -re "$prompt $"    { fail "help show language" }
  2414.     timeout        { fail "(timeout) help show language" }
  2415.     }
  2416.  
  2417.  
  2418. # test help show listsize
  2419. send "help show listsize\n"
  2420. expect {
  2421.     -re "Show number of source lines gdb will list by default..*$prompt $"\
  2422.             { pass "help show listsize" }
  2423.     -re "$prompt $"    { fail "help show listsize" }
  2424.     timeout        { fail "(timeout) help show listsize" }
  2425.     }
  2426.  
  2427.  
  2428. # test help show print "p" abbreviation
  2429. send "help show p\n"
  2430. expect {
  2431.     -re "Generic command for showing print settings..*\
  2432. List of show print subcommands:.*\
  2433. show print address -- Show printing of addresses.*\
  2434. show print array -- Show prettyprinting of arrays.*\
  2435. show print union -- Show printing of unions interior to structures.*\
  2436. show print pretty -- Show prettyprinting of structures.*\
  2437. show print elements -- Show limit on string chars or array elements to print.*\
  2438. show print asm-demangle -- Show demangling of C\+\+ names in disassembly listings.*\
  2439. show print sevenbit-strings -- Show printing of 8-bit characters in strings as .nnn.*\
  2440. show print demangle -- Show demangling of encoded C\+\+ names when displaying symbols.*\
  2441. show print object -- Show printing of object's derived type based on vtable info.*\
  2442. show print vtbl -- Show printing of C\+\+ virtual function tables.*\
  2443. Type \"help show print\" followed by show print subcommand name for full documentation..*\
  2444. Command name abbreviations are allowed if unambiguous..*$prompt $"\
  2445.             { pass "help show print \"p\" abbreviation" }
  2446.     -re "$prompt $"    { fail "help show print \"p\" abbreviation" }
  2447.     timeout        { fail "(timeout) help show print \"p\" abbreviation" }
  2448.     }
  2449.  
  2450.  
  2451. # test help show print "pr" abbreviation
  2452. send "help show pr\n"
  2453. expect {
  2454.     -re "Generic command for showing print settings..*\
  2455. List of show print subcommands:.*\
  2456. show print address -- Show printing of addresses.*\
  2457. show print array -- Show prettyprinting of arrays.*\
  2458. show print union -- Show printing of unions interior to structures.*\
  2459. show print pretty -- Show prettyprinting of structures.*\
  2460. show print elements -- Show limit on string chars or array elements to print.*\
  2461. show print asm-demangle -- Show demangling of C\+\+ names in disassembly listings.*\
  2462. show print sevenbit-strings -- Show printing of 8-bit characters in strings as .nnn.*\
  2463. show print demangle -- Show demangling of encoded C\+\+ names when displaying symbols.*\
  2464. show print object -- Show printing of object's derived type based on vtable info.*\
  2465. show print vtbl -- Show printing of C\+\+ virtual function tables.*\
  2466. Type \"help show print\" followed by show print subcommand name for full documentation..*\
  2467. Command name abbreviations are allowed if unambiguous..*$prompt $"\
  2468.             { pass "help show print \"pr\" abbreviation" }
  2469.     -re "$prompt $"    { fail "help show print \"pr\" abbreviation" }
  2470.     timeout        { fail "(timeout) help show print \"pr\" abbreviation" }
  2471.     }
  2472.  
  2473.  
  2474. # test help show print
  2475. send "help show print\n"
  2476. expect {
  2477.     -re "Generic command for showing print settings..*\
  2478. List of show print subcommands:.*\
  2479. show print address -- Show printing of addresses.*\
  2480. show print array -- Show prettyprinting of arrays.*\
  2481. show print union -- Show printing of unions interior to structures.*\
  2482. show print pretty -- Show prettyprinting of structures.*\
  2483. show print elements -- Show limit on string chars or array elements to print.*\
  2484. show print asm-demangle -- Show demangling of C\+\+ names in disassembly listings.*\
  2485. show print sevenbit-strings -- Show printing of 8-bit characters in strings as .nnn.*\
  2486. show print demangle -- Show demangling of encoded C\+\+ names when displaying symbols.*\
  2487. show print object -- Show printing of object's derived type based on vtable info.*\
  2488. show print vtbl -- Show printing of C\+\+ virtual function tables.*\
  2489. Type \"help show print\" followed by show print subcommand name for full documentation..*\
  2490. Command name abbreviations are allowed if unambiguous..*$prompt $"\
  2491.             { pass "help show print" }
  2492.     -re "$prompt $"    { fail "help show print" }
  2493.     timeout        { fail "(timeout) help show print" }
  2494.     }
  2495.  
  2496.  
  2497. # test help show paths
  2498. send "help show paths\n"
  2499. expect {
  2500.     -re "Current search path for finding object files..*\
  2501. .cwd in the path means the current working directory..*\
  2502. This path is equivalent to the .PATH shell variable.  It is a list of.*\
  2503. directories, separated by colons.  These directories are searched to find.*\
  2504. fully linked executable files and separately compiled object files as needed..*$prompt $"\
  2505.             { pass "help show paths" }
  2506.     -re "$prompt $"    { fail "help show paths" }
  2507.     timeout        { fail "(timeout) help show paths" }
  2508.     }
  2509.  
  2510.  
  2511. # test help show print address
  2512. send "help show print address\n"
  2513. expect {
  2514.     -re "Show printing of addresses..*$prompt $"\
  2515.             { pass "help show print address" }
  2516.     -re "$prompt $"    { fail "help show print address" }
  2517.     timeout        { fail "(timeout) help show print address" }
  2518.     }
  2519.  
  2520.  
  2521. # test help show print array
  2522. send "help show print array\n"
  2523. expect {
  2524.     -re "Show prettyprinting of arrays..*$prompt $"\
  2525.             { pass "help show print array" }
  2526.     -re "$prompt $"    { fail "help show print array" }
  2527.     timeout        { fail "(timeout) help show print array" }
  2528.     }
  2529.  
  2530.  
  2531. # test help show print asm-demangle
  2532. send "help show print asm-demangle\n"
  2533. expect {
  2534.     -re "Show demangling of C\+\+ names in disassembly listings..*$prompt $"\
  2535.             { pass "help show print asm-demangle" }
  2536.     -re "$prompt $"    { fail "help show print asm-demangle" }
  2537.     timeout        { fail "(timeout) help show print asm-demangle" }
  2538.     }
  2539.  
  2540.  
  2541. # test help show print demangle
  2542. send "help show print demangle\n"
  2543. expect {
  2544.     -re "Show demangling of encoded C\+\+ names when displaying symbols..*$prompt $"\
  2545.             { pass "help show print demangle" }
  2546.     -re "$prompt $"    { fail "help show print demangle" }
  2547.     timeout        { fail "(timeout) help show print demangle" }
  2548.     }
  2549.  
  2550.  
  2551. # test help show print elements
  2552. send "help show print elements\n"
  2553. expect {
  2554.     -re "Show limit on string chars or array elements to print..*\
  2555. \"set print elements 0\" causes there to be no limit..*$prompt $"\
  2556.             { pass "help show print elements" }
  2557.     -re "$prompt $"    { fail "help show print elements" }
  2558.     timeout        { fail "(timeout) help show print elements" }
  2559.     }
  2560.  
  2561.  
  2562. # test help show print object
  2563. send "help show print object\n"
  2564. expect {
  2565.     -re "Show printing of object's derived type based on vtable info..*$prompt $"\
  2566.             { pass "help show print object" }
  2567.     -re "$prompt $"    { fail "help show print object" }
  2568.     timeout        { fail "(timeout) help show print object" }
  2569.     }
  2570.  
  2571.  
  2572. # test help show print pretty
  2573. send "help show print pretty\n"
  2574. expect {
  2575.     -re "Show prettyprinting of structures..*$prompt $"\
  2576.             { pass "help show print pretty" }
  2577.     -re "$prompt $"    { fail "help show print pretty" }
  2578.     timeout        { fail "(timeout) help show print pretty" }
  2579.     }
  2580.  
  2581.  
  2582. # test help show print sevenbit-strings
  2583. send "help show print sevenbit-strings\n"
  2584. expect {
  2585.     -re "Show printing of 8-bit characters in strings as .nnn..*$prompt $"\
  2586.             { pass "help show print sevenbit-strings" }
  2587.     -re "$prompt $"    { fail "help show print sevenbit-strings" }
  2588.     timeout        { fail "(timeout) help show print sevenbit-strings" }
  2589.     }
  2590.  
  2591.  
  2592. # test help show print union
  2593. send "help show print union\n"
  2594. expect {
  2595.     -re "Show printing of unions interior to structures..*$prompt $"\
  2596.             { pass "help show print union" }
  2597.     -re "$prompt $"    { fail "help show print union" }
  2598.     timeout        { fail "(timeout) help show print union" }
  2599.     }
  2600.  
  2601.  
  2602. # test help show print vtbl
  2603. send "help show print vtbl\n"
  2604. expect {
  2605.     -re "Show printing of C\+\+ virtual function tables..*$prompt $"\
  2606.             { pass "help show print vtbl" }
  2607.     -re "$prompt $"    { fail "help show print vtbl" }
  2608.     timeout        { fail "(timeout) help show print vtbl" }
  2609.     }
  2610.  
  2611.  
  2612. # test help show prompt
  2613. send "help show prompt\n"
  2614. expect {
  2615.     -re "Show gdb's prompt.*$prompt $"\
  2616.             { pass "help show prompt" }
  2617.     -re "$prompt $"    { fail "help show prompt" }
  2618.     timeout        { fail "(timeout) help show prompt" }
  2619.     }
  2620.  
  2621.  
  2622. # test help show radix
  2623. send "help show radix\n"
  2624. expect {
  2625.     -re "Show default input and output number radix..*$prompt $"\
  2626.             { pass "help show radix" }
  2627.     -re "$prompt $"    { fail "help show radix" }
  2628.     timeout        { fail "(timeout) help show radix" }
  2629.     }
  2630.  
  2631.  
  2632. # test help show symbol-reloading
  2633. send "help show symbol-reloading\n"
  2634. expect {
  2635.     -re "Show dynamic symbol table reloading multiple times in one run..*$prompt $"\
  2636.             { pass "help show symbol-reloading" }
  2637.     -re "$prompt $"    { fail "help show symbol-reloading" }
  2638.     timeout        { fail "(timeout) help show symbol-reloading" }
  2639.     }
  2640.  
  2641.  
  2642. # test help show user
  2643. send "help show user\n"
  2644. expect {
  2645.     -re "Show definitions of user defined commands..*\
  2646. Argument is the name of the user defined command..*\
  2647. With no argument, show definitions of all user defined commands..*$prompt $"\
  2648.             { pass "help show user" }
  2649.     -re "$prompt $"    { fail "help show user" }
  2650.     timeout        { fail "(timeout) help show user" }
  2651.     }
  2652.  
  2653.  
  2654. # test help show values
  2655. send "help show values\n"
  2656. expect {
  2657.     -re "Elements of value history around item number IDX \(or last ten\)..*$prompt $"\
  2658.             { pass "help show values" }
  2659.     -re "$prompt $"    { fail "help show values" }
  2660.     timeout        { fail "(timeout) help show values" }
  2661.     }
  2662.  
  2663.  
  2664. # test help show verbose
  2665. send "help show verbose\n"
  2666. expect {
  2667.     -re "Show verbosity..*$prompt $"\
  2668.             { pass "help show verbose" }
  2669.     -re "Show verbose printing of informational messages..*$prompt $"\
  2670.             { pass "help show verbose. FIXME" }
  2671.     -re "$prompt $"    { fail "help show verbose" }
  2672.     timeout        { fail "(timeout) help show verbose" }
  2673.     }
  2674.  
  2675.  
  2676. # test help show version
  2677. send "help show version\n"
  2678. expect {
  2679.     -re "Show what version of GDB this is..*$prompt $"\
  2680.             { pass "help show version" }
  2681.     -re "$prompt $"    { fail "help show version" }
  2682.     timeout        { fail "(timeout) help show version" }
  2683.     }
  2684.  
  2685.  
  2686. # test help show width
  2687. send "help show width\n"
  2688. expect {
  2689.     -re "Show number of characters gdb thinks are in a line..*$prompt $"\
  2690.             { pass "help show width" }
  2691.     -re "$prompt $"    { fail "help show width" }
  2692.     timeout        { fail "(timeout) help show width" }
  2693.     }
  2694.  
  2695.  
  2696. # test help show write
  2697. # This is only supported on targets which use exec.o.
  2698. if ![istarget "rs6000-*-*"] then {
  2699.     send "help show write\n"
  2700.     expect {
  2701.     -re "Show writing into executable and core files..*$prompt $"\
  2702.             { pass "help show write" }
  2703.     -re "$prompt $"    { fail "help show write" }
  2704.     timeout        { fail "(timeout) help show write" }
  2705.     }
  2706. }
  2707.  
  2708. # test help show
  2709. # FIXME -- this should probably use the full pattern, but it won't work for some reason
  2710. send "help show\n"
  2711. expect {
  2712.     -re "Generic command for showing things about the debugger..*\
  2713. List of show subcommands:.*\
  2714. show listsize -- Show number of source lines gdb will list by default.*\
  2715. show directories -- Current search path for finding source files.*\
  2716. Type \"help show\" followed by show subcommand name for full documentation..*\
  2717. Command name abbreviations are allowed if unambiguous..*$prompt $"\
  2718.             { pass "help show" }
  2719.     -re "$prompt $"    { fail "help show" }
  2720.     timeout        { fail "(timeout) help show" }
  2721.     }
  2722.  
  2723.  
  2724.  
  2725. # test help step
  2726. send "help step\n"
  2727. expect {
  2728.     -re "Step program until it reaches a different source line..*\
  2729. Argument N means do this N times \(or till program stops for another reason\)..*$prompt $"\
  2730.             { pass "help step" }
  2731.     -re "$prompt $"    { fail "help step" }
  2732.     timeout        { fail "(timeout) help step" }
  2733.     }
  2734.  
  2735. # test help stepi "si" abbreviation
  2736. send "help si\n"
  2737. expect {
  2738.     -re "Step one instruction exactly..*\
  2739. Argument N means do this N times \(or till program stops for another reason\)..*$prompt $"\
  2740.             { pass "help stepi \"si\" abbreviation" }
  2741.     -re "$prompt $"    { fail "help stepi \"si\" abbreviation" }
  2742.     timeout        { fail "(timeout) help stepi \"si\" abbreviation" }
  2743.     }
  2744.  
  2745.  
  2746. # test help stepi
  2747. send "help stepi\n"
  2748. expect {
  2749.     -re "Step one instruction exactly..*\
  2750. Argument N means do this N times \(or till program stops for another reason\)..*$prompt $"\
  2751.             { pass "help stepi" }
  2752.     -re "$prompt $"    { fail "help stepi" }
  2753.     timeout        { fail "(timeout) help stepi" }
  2754.     }
  2755.  
  2756.  
  2757. # test help signal
  2758. send "help signal\n"
  2759. expect {
  2760.     -re "Continue program giving it signal number SIGNUMBER..*$prompt $"\
  2761.             { pass "help signal" }
  2762.     -re "$prompt $"    { fail "help signal" }
  2763.     timeout        { fail "(timeout) help signal" }
  2764.     }
  2765.  
  2766.  
  2767. # test help source
  2768. # vxgdb reads .vxgdbinit
  2769. send "help source\n"
  2770. expect {
  2771.     -re "Read commands from a file named FILE..*\
  2772. Note that the file \".(vx)?gdbinit\" is read automatically in this way.*\
  2773. when gdb is started..*$prompt $"\
  2774.             { pass "help source" }
  2775.     -re "$prompt $"    { fail "help source" }
  2776.     timeout        { fail "(timeout) help source" }
  2777.     }
  2778.  
  2779.  
  2780. # test help stack
  2781. send "help stack\n"
  2782. expect {
  2783.     -re "Examining the stack..*\
  2784. The stack is made up of stack frames.  Gdb assigns numbers to stack frames.*\
  2785. counting from zero for the innermost \(currently executing\) frame..*\
  2786. At any time gdb identifies one frame as the \"selected\" frame..*\
  2787. Variable lookups are done with respect to the selected frame..*\
  2788. When the program being debugged stops, gdb selects the innermost frame..*\
  2789. The commands below can be used to select other frames by number or address..*\
  2790. List of commands:.*\
  2791. bt -- Print backtrace of all stack frames.*\
  2792. backtrace -- Print backtrace of all stack frames.*\
  2793. select-frame -- Select a stack frame without printing anything.*\
  2794. frame -- Select and print a stack frame.*\
  2795. down -- Select and print stack frame called by this one.*\
  2796. up -- Select and print stack frame that called this one.*\
  2797. return -- Make selected stack frame return to its caller.*\
  2798. Type \"help\" followed by command name for full documentation..*\
  2799. Command name abbreviations are allowed if unambiguous..*$prompt $"\
  2800.             { pass "help stack" }
  2801.     -re "$prompt $"    { fail "help stack" }
  2802.     timeout        { fail "(timeout) help stack" }
  2803.     }
  2804.  
  2805.  
  2806. # test help status
  2807. send "help status\n"
  2808. expect {
  2809.     -re "Status inquiries..*\
  2810. List of commands:.*\
  2811. show -- Generic command for showing things about the debugger.*\
  2812. info -- Generic command for showing things about the program being debugged.*\
  2813. Type \"help\" followed by command name for full documentation..*\
  2814. Command name abbreviations are allowed if unambiguous..*$prompt $"\
  2815.             { pass "help status" }
  2816.     -re "$prompt $"    { fail "help status" }
  2817.     timeout        { fail "(timeout) help status" }
  2818.     }
  2819.  
  2820.  
  2821. # test help support
  2822. # FIXME -- this should probably use the full pattern, but it won't work for some reason
  2823. send "help support\n"
  2824. expect {
  2825.     -re "Support facilities..*\
  2826. List of commands:.*\
  2827. show confirm -- Show whether to confirm potentially dangerous operations.*\
  2828. show history -- Generic command for showing command history parameters.*\
  2829. down-silently -- Same as the `down' command.*\
  2830. up-silently -- Same as the `up' command.*\
  2831. Type \"help\" followed by command name for full documentation..*\
  2832. Command name abbreviations are allowed if unambiguous..*$prompt $"\
  2833.             { pass "help support" }
  2834.     -re "$prompt $"    { fail "help support" }
  2835.     timeout        { fail "(timeout) help support" }
  2836.     }
  2837.  
  2838.  
  2839. # test help symbol-file
  2840. send "help symbol-file\n"
  2841. expect {
  2842.     -re "Load symbol table from executable file FILE..*\
  2843. The `file' command can also load symbol tables, as well as setting the file.*\
  2844. to execute..*$prompt $"\
  2845.             { pass "help symbol-file" }
  2846.     -re "$prompt $"    { fail "help symbol-file" }
  2847.     timeout        { fail "(timeout) help symbol-file" }
  2848.     }
  2849.  
  2850.  
  2851. # test help target child
  2852. send "help target child\n"
  2853. expect {
  2854.     -re "Unix child process \(started by the \"run\" command\)..*$prompt $"\
  2855.         { pass "help target child (non-procfs version)" }
  2856.     -re "Undefined target command: \"child\".  Try \"help target\"..*$prompt $"\
  2857.         { pass "help target child (procfs version)" }
  2858.     -re "$prompt $"    { fail "help target child" }
  2859.     timeout        { fail "(timeout) help target child" }
  2860.     }
  2861.  
  2862.  
  2863. # test help target procfs
  2864. send "help target procfs\n"
  2865. expect {
  2866.     -re "Unix /proc child process \(started by the \"run\" command\)..*$prompt $"\
  2867.         { pass "help target procfs (procfs version)" }
  2868.     -re "Undefined target command: \"procfs\".  Try \"help target\"..*$prompt $"\
  2869.         { pass "help target procfs (non-procfs version)" }
  2870.     -re "$prompt $"    { fail "help target procfs" }
  2871.     timeout        { fail "(timeout) help target procfs" }
  2872.     }
  2873.  
  2874.  
  2875. # test help target core
  2876. send "help target core\n"
  2877. expect {
  2878.     -re "Use a core file as a target.  Specify the filename of the core file..*$prompt $"\
  2879.             { pass "help target core" }
  2880.     -re "Undefined target command: \"core\".  Try \"help target\"..*$prompt $"\
  2881.             { pass "help target core" }
  2882.     -re "$prompt $"    { fail "help target core" }
  2883.     timeout        { fail "(timeout) help target core" }
  2884.     }
  2885.  
  2886.  
  2887. # test help target exec
  2888. send "help target exec\n"
  2889. expect {
  2890.     -re "Use an executable file as a target..*\
  2891. Specify the filename of the executable file..*$prompt $"\
  2892.             { pass "help target exec" }
  2893.     -re "$prompt $"    { fail "help target exec" }
  2894.     timeout        { fail "(timeout) help target exec" }
  2895.     }
  2896.  
  2897.  
  2898. # test help target remote
  2899. send "help target remote\n"
  2900. expect {
  2901.     -re "Use a remote computer via a serial line, using a gdb-specific protocol..*\
  2902. Specify the serial device it is connected to \(e.g. /dev/ttya\)..*$prompt $"\
  2903.             { pass "help target remote" }
  2904.     -re "$prompt $"    { fail "help target remote" }
  2905.     timeout        { fail "(timeout) help target remote" }
  2906.     }
  2907.  
  2908.  
  2909. # test help target
  2910. # the child process target may be "target child" or "target procfs"
  2911. send "help target\n"
  2912. expect {
  2913.     -re "Connect to a target machine or process..*\
  2914. The first argument is the type or protocol of the target machine..*\
  2915. Remaining arguments are interpreted by the target protocol.  For more.*\
  2916. information on the arguments for a particular protocol, type.*\
  2917. `help target ' followed by the protocol name..*\
  2918. List of target subcommands:.*\
  2919. target remote -- Use a remote computer via a serial line.*\
  2920. target exec -- Use an executable file as a target.*\
  2921. Type \"help target\" followed by target subcommand name for full documentation..*\
  2922. Command name abbreviations are allowed if unambiguous..*$prompt $"\
  2923.             { pass "help target" }
  2924.     -re "$prompt $"    { fail "help target" }
  2925.     timeout        { fail "(timeout) help target" }
  2926.     }
  2927.  
  2928.  
  2929. # test help tbreak
  2930. send "help tbreak\n"
  2931. expect {
  2932.     -re "Set a temporary breakpoint.  Args like \"break\" command..*\
  2933. Like \"break\" except the breakpoint is only enabled temporarily,.*\
  2934. so it will be disabled when hit.  Equivalent to \"break\" followed.*\
  2935. by using \"enable once\" on the breakpoint number..*$prompt $"\
  2936.             { pass "help tbreak" }
  2937.     -re "$prompt $"    { fail "help tbreak" }
  2938.     timeout        { fail "(timeout) help tbreak" }
  2939.     }
  2940.  
  2941.  
  2942. # test help tty
  2943. send "help tty\n"
  2944. expect {
  2945.     -re "Set terminal for future runs of program being debugged..*$prompt $"\
  2946.             { pass "help tty" }
  2947.     -re "$prompt $"    { fail "help tty" }
  2948.     timeout        { fail "(timeout) help tty" }
  2949.     }
  2950.  
  2951.  
  2952. # test help until "u" abbreviation
  2953. send "help u\n"
  2954. expect {
  2955.     -re "Execute until the program reaches a source line greater than the current.*\
  2956. or a specified line or address or function \(same args as break command\)..*\
  2957. Execution will also stop upon exit from the current stack frame..*$prompt $"\
  2958.             { pass "help until \"u\" abbreviation" }
  2959.     -re "$prompt $"    { fail "help until \"u\" abbreviation" }
  2960.     timeout        { fail "(timeout) help until \"u\" abbreviation" }
  2961.     }
  2962.  
  2963.  
  2964. # test help until
  2965. send "help until\n"
  2966. expect {
  2967.     -re "Execute until the program reaches a source line greater than the current.*\
  2968. or a specified line or address or function \(same args as break command\)..*\
  2969. Execution will also stop upon exit from the current stack frame..*$prompt $"\
  2970.             { pass "help until" }
  2971.     -re "$prompt $"    { fail "help until" }
  2972.     timeout        { fail "(timeout) help until" }
  2973.     }
  2974.  
  2975.  
  2976. # test help undisplay
  2977. send "help undisplay\n"
  2978. expect {
  2979.     -re "Cancel some expressions to be displayed when program stops..*\
  2980. Arguments are the code numbers of the expressions to stop displaying..*\
  2981. No argument means cancel all automatic-display expressions..*\
  2982. \"delete display\" has the same effect as this command..*\
  2983. Do \"info display\" to see current list of code numbers..*$prompt $"\
  2984.             { pass "help undisplay" }
  2985.     -re "$prompt $"    { fail "help undisplay" }
  2986.     timeout        { fail "(timeout) help undisplay" }
  2987.     }
  2988.  
  2989.  
  2990. # test help unset environment
  2991. send "help unset environment\n"
  2992. expect {
  2993.     -re "Cancel environment variable VAR for the program..*\
  2994. This does not affect the program until the next \"run\" command..*$prompt $"\
  2995.             { pass "help unset environment" }
  2996.     -re "$prompt $"    { fail "help unset environment" }
  2997.     timeout        { fail "(timeout) help unset environment" }
  2998.     }
  2999.  
  3000.  
  3001. # test help unset
  3002. send "help unset\n"
  3003. expect {
  3004.     -re "Complement to certain \"set\" commands.*\
  3005. List of unset subcommands:.*\
  3006. unset environment -- Cancel environment variable VAR for the program.*\
  3007. Type \"help unset\" followed by unset subcommand name for full documentation..*\
  3008. Command name abbreviations are allowed if unambiguous..*$prompt $"\
  3009.             { pass "help unset" }
  3010.     -re "$prompt $"    { fail "help unset" }
  3011.     timeout        { fail "(timeout) help unset" }
  3012.     }
  3013.  
  3014.  
  3015. # test help up
  3016. send "help up\n"
  3017. expect {
  3018.     -re "Select and print stack frame that called this one..*\
  3019. An argument says how many frames up to go..*$prompt $"\
  3020.             { pass "help up" }
  3021.     -re "$prompt $"    { fail "help up" }
  3022.     timeout        { fail "(timeout) help up" }
  3023.     }
  3024.  
  3025.  
  3026. # test help up-silently
  3027. send "help up-silently\n"
  3028. expect {
  3029.     -re "Same as the `up' command, but does not print anything..*\
  3030. This is useful in command scripts..*$prompt $"\
  3031.             { pass "help up-silently" }
  3032.     -re "$prompt $"    { fail "help up-silently" }
  3033.     timeout        { fail "(timeout) help up-silently" }
  3034.     }
  3035.  
  3036.  
  3037. # test help user-defined
  3038. send "help user-defined\n"
  3039. expect {
  3040.     -re "User-defined commands..*\
  3041. The commands in this class are those defined by the user..*\
  3042. Use the \"define\" command to define a command..*\
  3043. List of commands:.*\
  3044. Type \"help\" followed by command name for full documentation..*\
  3045. Command name abbreviations are allowed if unambiguous..*$prompt $"\
  3046.             { pass "help user-defined" }
  3047.     -re "$prompt $"    { fail "help user-defined" }
  3048.     timeout        { fail "(timeout) help user-defined" }
  3049.     }
  3050.  
  3051.  
  3052. # test help watch
  3053. send "help watch\n"
  3054. expect {
  3055.     -re "Set a watchpoint for an expression..*\
  3056. A watchpoint stops execution of your program whenever the value of.*\
  3057. an expression changes..*$prompt $"\
  3058.             { pass "help watch" }
  3059.     -re "$prompt $"    { fail "help watch" }
  3060.     timeout        { fail "(timeout) help watch" }
  3061.     }
  3062.  
  3063.  
  3064. # test help whatis
  3065. send "help whatis\n"
  3066. expect {
  3067.     -re "Print data type of expression EXP..*$prompt $"\
  3068.             { pass "help whatis" }
  3069.     -re "$prompt $"    { fail "help whatis" }
  3070.     timeout        { fail "(timeout) help whatis" }
  3071.     }
  3072.  
  3073.  
  3074. # test help where
  3075. send "help where\n"
  3076. expect {
  3077.     -re "Print backtrace of all stack frames, or innermost COUNT frames..*\
  3078. With a negative argument, print outermost -COUNT frames..*$prompt $"\
  3079.             { pass "help where" }
  3080.     -re "$prompt $"    { fail "help where" }
  3081.     timeout        { fail "(timeout) help where" }
  3082.     }
  3083.  
  3084.  
  3085. # test help x
  3086. # FIXME -- this should probably use the full pattern, but it won't work for some reason
  3087. send "help x\n"
  3088. expect {
  3089.     -re "Examine memory: x/FMT ADDRESS..*\
  3090. ADDRESS is an expression for the memory address to examine..*\
  3091. FMT is a repeat count followed by a format letter and a size letter..*\
  3092. Defaults for format and size letters are those previously used..*\
  3093. Default count is 1.  Default address is following last thing printed.*\
  3094. with this command or \"print\"..*$prompt $"\
  3095.             { pass "help x" }
  3096.     -re "$prompt $"    { fail "help x" }
  3097.     timeout        { fail "(timeout) help x" }
  3098.     }
  3099.  
  3100.  
  3101. # test help info bogus-gdb-command
  3102. send "help info bogus-gdb-command\n"
  3103. expect {
  3104.     -re "Undefined info command: \"bogus-gdb-command\".  Try \"help info\"..*$prompt $"\
  3105.             { pass "help info bogus-gdb-command" }
  3106.     -re "$prompt $"    { fail "help info bogus-gdb-command" }
  3107.     timeout        { fail "(timeout) help info bogus-gdb-command" }
  3108.     }
  3109.  
  3110.  
  3111. # test help gotcha
  3112. send "help gotcha\n"
  3113. expect {
  3114.     -re "Undefined command: \"gotcha\".  Try \"help\"..*$prompt $"\
  3115.             { pass "help gotcha" }
  3116.     -re "$prompt $"    { fail "help gotcha" }
  3117.     timeout        { fail "(timeout) help gotcha" }
  3118.     }
  3119.  
  3120.