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