xref: /openbsd-src/gnu/usr.bin/binutils/gdb/testsuite/gdb.base/help.exp (revision b2ea75c1b17e1a9a339660e7ed45cd24946b230e)
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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
26set prms_id 0
27set bug_id 0
28
29# force the height of the debugger to be pretty large so no pagers getused
30send "set height 400\n"
31expect -re "$prompt $"
32
33# use a larger expect input buffer for long help outputs.
34match_max 6000
35
36# test help add-symbol-file
37send "help add-symbol-file\n"
38expect 	{
39	-re "Usage: add-symbol-file FILE ADDR.*
40Load the symbols from FILE, assuming FILE has been dynamically loaded..*
41ADDR 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
49send "help aliases\n"
50expect {
51	-re "Aliases of other commands..*
52List of commands\:.*
53Type \"help\" followed by command name for full documentation..*
54Command 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
61send "help attach\n"
62expect {
63	-re "Attach to a process or file outside of GDB..*
64This command attaches to another target, of the same type as your last.*
65`target' command .`info files' will show your target stack.*
66The command may take as argument a process id or a device file..*
67For a process id, you must have permission to send the process a signal,.*
68and it must have the same effective uid as the debugger..*
69When using \"attach\", you should use the \"file\" command to specify.*
70the 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
79send "help b\n"
80expect {
81	-re "Set breakpoint at specified line or function..*
82Argument may be line number, function name, or \"\[*\]\" and an address..*
83If line number is specified, break at start of code for that line..*
84If function is specified, break at start of code for that function..*
85If an address is specified, break at that exact address..*
86With no arg, uses current execution address of selected stack frame..*
87This is useful for breaking on return to a stack frame..*
88Multiple breakpoints at one place are permitted, and useful if conditional..*
89Do \"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
97send "help br\n"
98expect {
99	-re "Set breakpoint at specified line or function..*
100Argument may be line number, function name, or \"\[*\]\" and an address..*
101If line number is specified, break at start of code for that line..*
102If function is specified, break at start of code for that function..*
103If an address is specified, break at that exact address..*
104With no arg, uses current execution address of selected stack frame..*
105This is useful for breaking on return to a stack frame..*
106Multiple breakpoints at one place are permitted, and useful if conditional..*
107Do \"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
115send "help bre\n"
116expect {
117	-re "Set breakpoint at specified line or function..*
118Argument may be line number, function name, or \"\[*\]\" and an address..*
119If line number is specified, break at start of code for that line..*
120If function is specified, break at start of code for that function..*
121If an address is specified, break at that exact address..*
122With no arg, uses current execution address of selected stack frame..*
123This is useful for breaking on return to a stack frame..*
124Multiple breakpoints at one place are permitted, and useful if conditional..*
125Do \"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
133send "help brea\n"
134expect {
135	-re "Set breakpoint at specified line or function..*
136Argument may be line number, function name, or \"\[*\]\" and an address..*
137If line number is specified, break at start of code for that line..*
138If function is specified, break at start of code for that function..*
139If an address is specified, break at that exact address..*
140With no arg, uses current execution address of selected stack frame..*
141This is useful for breaking on return to a stack frame..*
142Multiple breakpoints at one place are permitted, and useful if conditional..*
143Do \"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
151send "help break\n"
152expect {
153	-re "Set breakpoint at specified line or function..*
154Argument may be line number, function name, or \"\[*\]\" and an address..*
155If line number is specified, break at start of code for that line..*
156If function is specified, break at start of code for that function..*
157If an address is specified, break at that exact address..*
158With no arg, uses current execution address of selected stack frame..*
159This is useful for breaking on return to a stack frame..*
160Multiple breakpoints at one place are permitted, and useful if conditional..*
161Do \"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
169send "help breakpoints\n"
170expect {
171	-re "Making program stop at certain points..*
172List of commands\:.*
173watch -- Set a watchpoint for an expression.*
174catch -- Set breakpoints to catch exceptions that are raised.*
175break -- Set breakpoint at specified line or function.*
176clear -- Clear breakpoint at specified line or function.*
177delete -- Delete some breakpoints or auto-display expressions.*
178disable -- Disable some breakpoints.*
179enable -- Enable some breakpoints.*
180tbreak -- Set a temporary breakpoint.*
181condition -- Specify breakpoint number N to break only if COND is true.*
182commands -- Set commands to be executed when a breakpoint is hit.*
183ignore -- Set ignore-count of breakpoint number N to COUNT.*
184Type \"help\" followed by command name for full documentation..*
185Command 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
193send "help bt\n"
194expect {
195	-re "Print backtrace of all stack frames, or innermost COUNT frames..*
196With 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
204send "help backtrace\n"
205expect {
206	-re "Print backtrace of all stack frames, or innermost COUNT frames..*
207With 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
215send "help c\n"
216expect {
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
225send "help continue\n"
226expect {
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
235send "help call\n"
236expect {
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
245send "help catch\n"
246expect {
247	-re "Set breakpoints to catch exceptions that are raised..*
248Argument may be a single exception to catch, multiple exceptions.*
249to catch, or the default exception \"default\".  If no arguments.*
250are given, breakpoints are set at all exception handlers catch clauses.*
251within the current scope..*
252A condition specified for the catch applies to all breakpoints set.*
253with this command.*
254Do \"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
262send "help cd\n"
263expect {
264	-re "Set working directory to DIR for debugger and program being debugged..*
265The change does not take effect for the program being debugged.*
266until 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
274send "help clear\n"
275expect {
276	-re "Clear breakpoint at specified line or function.*
277Argument may be line number, function name, or .* and an address.*
278If line number is specified, all breakpoints in that line are cleared.*
279If function is specified, breakpoints at beginning of function are cleared.*
280If an address is specified, breakpoints at that address are cleared.*
281With no argument, clears all breakpoints in the line that the selected frame.*
282is executing in..*
283See 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
291send "help commands\n"
292expect {
293	-re "Set commands to be executed when a breakpoint is hit..*
294Give breakpoint number as argument after \"commands\"..*
295With no argument, the targeted breakpoint is the last one set..*
296The commands themselves follow starting on the next line..*
297Type a line containing \"end\" to indicate the end of them..*
298Give \"silent\" as the first line to make the breakpoint silent;.*
299then 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
307send "help condition\n"
308expect {
309	-re "Specify breakpoint number N to break only if COND is true..*
310Usage is `condition N COND', where N is an integer and COND is an.*
311expression 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
319send "help core-file\n"
320expect {
321	-re "Use FILE as core dump for examining memory and registers..*
322No 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
331send "help d\n"
332expect {
333	-re "Delete some breakpoints or auto-display expressions..*
334Arguments are breakpoint numbers with spaces in between..*
335To delete all breakpoints, give no argument..*
336Also a prefix command for deletion of other GDB objects..*
337The \"unset\" command is also an alias for \"delete\"..*
338List of delete subcommands:.*
339delete display -- Cancel some expressions to be displayed when program stops.*
340delete breakpoints -- Delete some breakpoints or auto-display expressions.*
341Type \"help delete\" followed by delete subcommand name for full documentation..*
342Command 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
350send "help delete\n"
351expect {
352	-re "Delete some breakpoints or auto-display expressions..*
353Arguments are breakpoint numbers with spaces in between..*
354To delete all breakpoints, give no argument..*
355Also a prefix command for deletion of other GDB objects..*
356The \"unset\" command is also an alias for \"delete\"..*
357List of delete subcommands:.*
358delete display -- Cancel some expressions to be displayed when program stops.*
359delete breakpoints -- Delete some breakpoints or auto-display expressions.*
360Type \"help delete\" followed by delete subcommand name for full documentation..*
361Command 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
369send "help data\n"
370expect {
371	-re ".*
372Examining data..*
373List of commands:.*
374Type \"help\" followed by command name for full documentation..*
375Command 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
383send "help define\n"
384expect {
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
393send "help delete breakpoints\n"
394expect {
395	-re "Delete some breakpoints or auto-display expressions..*
396Arguments are breakpoint numbers with spaces in between..*
397To delete all breakpoints, give no argument..*
398This 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
406send "help delete display\n"
407expect {
408	-re "Cancel some expressions to be displayed when program stops..*
409Arguments are the code numbers of the expressions to stop displaying..*
410No argument means cancel all automatic-display expressions..*
411Do \"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
419send "help detach\n"
420expect {
421	-re "Detach a process or file previously attached..*
422If a process, it is no longer traced, and it continues its execution.  If you.*
423were 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
431send "help directory\n"
432expect {
433	-re "Add directory DIR to beginning of search path for source files..*
434Forget cached info on source file locations and line positions..*
435DIR can also be .cwd for the current working directory, or .cdir for the.*
436directory in which the source file was compiled into object code..*
437With 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
445send "help dis\n"
446expect {
447	-re "Disable some breakpoints..*
448Arguments are breakpoint numbers with spaces in between..*
449To disable all breakpoints, give no argument..*
450A disabled breakpoint is not forgotten, but has no effect until reenabled..*
451List of disable subcommands:.*
452disable display -- Disable some expressions to be displayed when program stops.*
453disable breakpoints -- Disable some breakpoints.*
454Type \"help disable\" followed by disable subcommand name for full documentation..*
455Command 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
463send "help disa\n"
464expect {
465	-re "Disable some breakpoints..*
466Arguments are breakpoint numbers with spaces in between..*
467To disable all breakpoints, give no argument..*
468A disabled breakpoint is not forgotten, but has no effect until reenabled..*
469List of disable subcommands:.*
470disable display -- Disable some expressions to be displayed when program stops.*
471disable breakpoints -- Disable some breakpoints.*
472Type \"help disable\" followed by disable subcommand name for full documentation..*
473Command 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
481send "help disable\n"
482expect {
483	-re "Disable some breakpoints..*
484Arguments are breakpoint numbers with spaces in between..*
485To disable all breakpoints, give no argument..*
486A disabled breakpoint is not forgotten, but has no effect until reenabled..*
487List of disable subcommands:.*
488disable display -- Disable some expressions to be displayed when program stops.*
489disable breakpoints -- Disable some breakpoints.*
490Type \"help disable\" followed by disable subcommand name for full documentation..*
491Command 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
499send "help disable breakpoints\n"
500expect {
501	-re "Disable some breakpoints..*
502Arguments are breakpoint numbers with spaces in between..*
503To disable all breakpoints, give no argument..*
504A disabled breakpoint is not forgotten, but has no effect until reenabled..*
505This 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
513send "help disable display\n"
514expect {
515	-re "Disable some expressions to be displayed when program stops..*
516Arguments are the code numbers of the expressions to stop displaying..*
517No argument means disable all automatic-display expressions..*
518Do \"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
526send "help disassemble\n"
527expect {
528	-re "Disassemble a specified section of memory..*
529Default is the function surrounding the pc of the selected frame..*
530With a single argument, the function surrounding that address is dumped..*
531Two 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
539send "help display\n"
540expect {
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,.*
544as in the \"x\" command, and then EXP is used to get the address to examine.*
545and examining is done as in the \"x\" command..*
546With no argument, display all currently requested auto-display expressions..*
547Use \"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
555send "help do\n"
556expect {
557	-re "Select and print stack frame called by this one..*
558An 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
566send "help document\n"
567expect {
568	-re "Document a user-defined command..*
569Give command name as argument.  Give documentation on following lines..*
570End 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
579send "help down\n"
580expect {
581	-re "Select and print stack frame called by this one..*
582An 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
590send "help down-silently\n"
591expect {
592	-re "Same as the `down' command, but does not print anything..*
593This 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
611send "help echo\n"
612expect {
613	-re "Print a constant string.  Give string as argument..*
614C escape sequences may be used in the argument..*
615No newline is added at the end of the argument;.*
616use \".n\" if you want a newline to be printed..*
617Since leading and trailing whitespace are ignored in command arguments,.*
618if you want to print some you must use \".\" before leading whitespace.*
619to 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
627send "help enable breakpoints delete\n"
628expect {
629	-re "Enable breakpoints and delete when hit.  Give breakpoint numbers..*
630If 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
638send "help enable breakpoints once\n"
639expect {
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
648send "help enable breakpoints\n"
649expect {
650	-re "Enable some breakpoints..*
651Give breakpoint numbers .separated by spaces. as arguments..*
652This is used to cancel the effect of the \"disable\" command..*
653May be abbreviated to simply \"enable\"..*.*
654List of enable breakpoints subcommands:.*
655enable breakpoints delete -- Enable breakpoints and delete when hit.*
656enable breakpoints once -- Enable breakpoints for one hit.*
657Type \"help enable breakpoints\" followed by enable breakpoints subcommand name for full documentation..*
658Command 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
666send "help enable delete\n"
667expect {
668	-re "Enable breakpoints and delete when hit.  Give breakpoint numbers..*
669If 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
677send "help enable display\n"
678expect {
679	-re "Enable some expressions to be displayed when program stops..*
680Arguments are the code numbers of the expressions to resume displaying..*
681No argument means enable all automatic-display expressions..*
682Do \"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
690send "help enable once\n"
691expect {
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
700send "help enable\n"
701expect {
702	-re "Enable some breakpoints..*
703Give breakpoint numbers .separated by spaces. as arguments..*
704With no subcommand, breakpoints are enabled until you command otherwise..*
705This is used to cancel the effect of the \"disable\" command..*
706With a subcommand you can enable temporarily..*
707List of enable subcommands:.*
708enable display -- Enable some expressions to be displayed when program stops.*
709enable once -- Enable breakpoints for one hit.*
710enable delete -- Enable breakpoints and delete when hit.*
711Type \"help enable\" followed by enable subcommand name for full documentation..*
712Command 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
720send "help exec-file\n"
721expect {
722	-re "Use FILE as program for getting contents of pure memory..*
723If FILE cannot be found as specified, your execution directory path.*
724is searched for a command of that name..*
725No 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
733send "help f\n"
734expect {
735	-re "Select and print a stack frame..*
736With no argument, print the selected stack frame.  .See also \"info frame\".*
737An argument specifies the frame to select..*
738It can be a stack frame number or the address of the frame..*
739With argument, nothing is printed if input is coming from.*
740a 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
748send "help frame\n"
749expect {
750	-re "Select and print a stack frame..*
751With no argument, print the selected stack frame.  .See also \"info frame\"...*
752An argument specifies the frame to select..*
753It can be a stack frame number or the address of the frame..*
754With argument, nothing is printed if input is coming from.*
755a 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
763send "help fg\n"
764expect {
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
773send "help file\n"
774expect {
775	-re "Use FILE as program to be debugged..*
776It is read for its symbols, for getting the contents of pure memory,.*
777and it is the program executed when you use the `run' command..*
778If FILE cannot be found as specified, your execution directory path.*
779..PATH. is searched for a command of that name..*
780No 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
788send "help files\n"
789expect {
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
797send "help finish\n"
798expect {
799	-re "Execute until selected stack frame returns..*
800Upon 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
808send "help forward-search\n"
809expect {
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
818send "help h\n"
819expect {
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
828send "help help\n"
829expect {
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
838send "help handle\n"
839expect {
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
848send "help i\n"
849expect {
850	-re "Generic command for showing things about the program being debugged..*
851List of info subcommands:.*
852Type \"help info\" followed by info subcommand name for full documentation..*
853Command 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
861send "help info\n"
862expect {
863	-re "Generic command for showing things about the program being debugged..*
864List of info subcommands:.*
865Type \"help info\" followed by info subcommand name for full documentation..*
866Command 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
874send "help ignore\n"
875expect {
876	-re "Set ignore-count of breakpoint number N to COUNT..*
877Usage 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
885send "help info address\n"
886expect {
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
895send "help info all-registers\n"
896expect {
897	-re "List of all registers and their contents, for selected stack frame..*
898Register 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
906send "help info args\n"
907expect {
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
916send "help info breakpoints\n"
917expect {
918	-re "Status of user-settable breakpoints, or breakpoint number NUMBER..*
919breakpoint 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
927send "help info catch\n"
928expect {
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
937send "help info copying\n"
938expect {
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
947send "help info display\n"
948expect {
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
957send "help info f\n"
958expect {
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
967send "help info frame\n"
968expect {
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
977send "help info files\n"
978expect {
979	-re "Names of targets and files being debugged..*
980Shows the entire stack of targets currently in use .including the exec-file,.*
981core-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
989send "help info float\n"
990expect {
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
999send "help info functions\n"
1000expect {
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
1009send "help info line\n"
1010expect {
1011	-re "Core addresses of the code for a source line..*
1012Line 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..*
1017Default is to describe the last source line that was listed..*
1018This sets the default address for \"x\" to the line's first instruction.*
1019so that \"x.i\" suffices to start examining the machine code..*
1020The 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
1028send "help info locals\n"
1029expect {
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
1038send "help info program\n"
1039expect {
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
1048send "help info registers\n"
1049expect {
1050	-re "List of integer registers and their contents, for selected stack frame..*
1051Register 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
1059send "help info s\n"
1060expect {
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
1069send "help info stack\n"
1070expect {
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
1079send "help info set\n"
1080expect {
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
1089send "help info signals\n"
1090expect {
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
1099send "help info source\n"
1100expect {
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
1109send "help info sources\n"
1110expect {
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
1119send "help info target\n"
1120expect {
1121	-re "Names of targets and files being debugged..*
1122Shows the entire stack of targets currently in use .including the exec-file,.*
1123core-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
1131send "help info terminal\n"
1132expect {
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
1141send "help info types\n"
1142expect {
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
1151send "help info variables\n"
1152expect {
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
1161send "help info warranty\n"
1162expect {
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
1171send "help info watchpoints\n"
1172expect {
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
1181send "help inspect\n"
1182expect {
1183	-re "Same as \"print\" command, except that if you are running in the epoch.*
1184environment, 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
1192send "help jump\n"
1193expect {
1194	-re "Continue program being debugged at specified line or address..*
1195Give as argument either LINENUM or \[*\]+ADDR, where ADDR is an expression.*
1196for 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
1204send "help kill\n"
1205expect {
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
1214send "help l\n"
1215expect {
1216	-re "List specified function or line..*
1217With no argument, lists ten more lines after or around previous listing..*
1218\"list -\" lists the ten lines before a previous ten-line listing..*
1219One argument specifies a line, and ten lines are listed around that line..*
1220Two arguments with comma between specify starting and ending lines to list..*
1221Lines 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..*
1227With 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
1235send "help list\n"
1236expect {
1237	-re "List specified function or line..*
1238With no argument, lists ten more lines after or around previous listing..*
1239\"list -\" lists the ten lines before a previous ten-line listing..*
1240One argument specifies a line, and ten lines are listed around that line..*
1241Two arguments with comma between specify starting and ending lines to list..*
1242Lines 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..*
1248With 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
1256send "help load\n"
1257expect {
1258	-re "Dynamically load FILE into the running program, and record its symbols.*
1259for 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
1267send "help make\n"
1268expect {
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
1277send "help n\n"
1278expect {
1279	-re "Step program, proceeding through subroutine calls..*
1280Like the \"step\" command as long as subroutine calls do not happen;.*
1281when they do, the call is treated as one instruction..*
1282Argument 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
1290send "help next\n"
1291expect {
1292	-re "Step program, proceeding through subroutine calls..*
1293Like the \"step\" command as long as subroutine calls do not happen;.*
1294when they do, the call is treated as one instruction..*
1295Argument 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
1303send "help ni\n"
1304expect {
1305	-re "Step one instruction, but proceed through subroutine calls..*
1306Argument 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
1315send "help obscure\n"
1316expect {
1317	-re "Obscure features..*
1318List of commands:.*
1319Type \"help\" followed by command name for full documentation..*
1320Command 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
1328send "help output\n"
1329expect {
1330	-re "Like \"print\" but don't put in value history and don't print newline..*
1331This 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
1339send "help p\n"
1340expect {
1341	-re "Print value of expression EXP..*
1342Variables accessible are those of the lexical environment of the selected.*
1343EXP may be preceded with /FMT, where FMT is a format letter.*
1344but 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
1352send "help print\n"
1353expect {
1354	-re "Print value of expression EXP..*
1355Variables accessible are those of the lexical environment of the selected.*
1356EXP may be preceded with /FMT, where FMT is a format letter.*
1357but 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
1365send "help path\n"
1366expect {
1367	-re "Add directory DIR.s. to beginning of search path for object files..*
1368.cwd in the path means the current working directory..*
1369This path is equivalent to the .PATH shell variable.  It is a list of.*
1370directories, separated by colons.  These directories are searched to find.*
1371fully 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
1379send "help printcmds\n"
1380expect {
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
1389send "help printf\n"
1390expect {
1391	-re "printf \"printf format string\", arg1, arg2, arg3, ..., argn.*
1392This 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
1411send "help ptype\n"
1412expect {
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
1421send "help pwd\n"
1422expect {
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
1431send "help q\n"
1432expect {
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
1441send "help quit\n"
1442expect {
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
1451send "help r\n"
1452expect {
1453	-re "Start debugged program.  You may specify arguments to give it..*
1454Args may include .*, or .*; they are expanded using \"sh\"..*
1455Input and output redirection with \".\", \".\", or \"..\" are also allowed..*
1456With no arguments, uses arguments last specified .with \"run\" or \"set args\"...*
1457To cancel previous arguments and run with no arguments,.*
1458use \"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
1466send "help run\n"
1467expect {
1468	-re "Start debugged program.  You may specify arguments to give it..*
1469Args may include .*, or .*; they are expanded using \"sh\"..*
1470Input and output redirection with \".\", \".\", or \"..\" are also allowed..*
1471With no arguments, uses arguments last specified .with \"run\" or \"set args\"...*
1472To cancel previous arguments and run with no arguments,.*
1473use \"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
1481send "help rbreak\n"
1482expect {
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
1491send "help return\n"
1492expect {
1493	-re "Make selected stack frame return to its caller..*
1494Control remains in the debugger, but when you continue.*
1495execution will resume in the frame above the one now selected..*
1496If 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
1504send "help reverse-search\n"
1505expect {
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
1514send "help running\n"
1515expect {
1516	-re "Running the program..*
1517List of commands:.*
1518Type \"help\" followed by command name for full documentation..*
1519Command 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
1527send "help s\n"
1528expect {
1529	-re "Step program until it reaches a different source line..*
1530Argument 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
1538send "help step\n"
1539expect {
1540	-re "Step program until it reaches a different source line..*
1541Argument 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
1549send "help search\n"
1550expect {
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
1559send "help section\n"
1560expect {
1561	-re "Change the base address of section SECTION of the exec file to ADDR..*
1562This 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.*
1564file 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 annotate
1573send "help set annotate\n"
1574expect {
1575	-re "Set annotation_level.*
15760 == normal;     1 == fullname \\(for use when running under emacs\\).*
15772 == output annotated suitably for use by programs that control GDB..*$prompt $"\
1578			{ pass "help set annotate" }
1579	-re "$prompt $"	{ fail "help set annotate" }
1580	timeout		{ fail "(timeout) help set annotate" }
1581	}
1582
1583
1584# test help set args
1585send "help set args\n"
1586expect {
1587	-re "Set arguments to give program being debugged when it is started..*
1588Follow this command with any number of args, to be passed to the program..*$prompt $"\
1589			{ pass "help set args" }
1590	-re "$prompt $"	{ fail "help set args" }
1591	timeout		{ fail "(timeout) help set args" }
1592	}
1593
1594
1595# test help set check "c" abbreviation
1596send "help set c\n"
1597expect {
1598	-re "Set the status of the type/range checker.*
1599List of set check subcommands:.*
1600set check range -- Set range checking.*
1601set check type -- Set type checking.*
1602Type \"help set check\" followed by set check subcommand name for full documentation..*
1603Command name abbreviations are allowed if unambiguous..*$prompt $"\
1604			{ pass "help set check \"c\" abbreviation" }
1605	-re "$prompt $"	{ fail "help set check \"c\" abbreviation" }
1606	timeout		{ fail "(timeout) help set check \"c\" abbreviation" }
1607	}
1608
1609
1610# test help set check "ch" abbreviation
1611send "help set ch\n"
1612expect {
1613	-re "Set the status of the type/range checker.*
1614List of set check subcommands:.*
1615set check range -- Set range checking.*
1616set check type -- Set type checking.*
1617Type \"help set check\" followed by set check subcommand name for full documentation..*
1618Command name abbreviations are allowed if unambiguous..*$prompt $"\
1619			{ pass "help set check \"ch\" abbreviation" }
1620	-re "$prompt $"	{ fail "help set check \"ch\" abbreviation" }
1621	timeout		{ fail "(timeout) help set check \"ch\" abbreviation" }
1622	}
1623
1624
1625# test help set check
1626send "help set check\n"
1627expect {
1628	-re "Set the status of the type/range checker.*
1629List of set check subcommands:.*
1630set check range -- Set range checking.*
1631set check type -- Set type checking.*
1632Type \"help set check\" followed by set check subcommand name for full documentation..*
1633Command name abbreviations are allowed if unambiguous..*$prompt $"\
1634			{ pass "help set check" }
1635	-re "$prompt $"	{ fail "help set check" }
1636	timeout		{ fail "(timeout) help set check" }
1637	}
1638
1639
1640# test help set check range
1641send "help set check range\n"
1642expect {
1643	-re "Set range checking.  .on/warn/off/auto..*$prompt $"\
1644			{ pass "help set check range" }
1645	-re "$prompt $"	{ fail "help set check range" }
1646	timeout		{ fail "(timeout) help set check range" }
1647	}
1648
1649
1650# test help set check type
1651send "help set check type\n"
1652expect {
1653	-re "Set type checking.  .on/warn/off/auto..*$prompt $"\
1654			{ pass "help set check type" }
1655	-re "$prompt $"	{ fail "help set check type" }
1656	timeout		{ fail "(timeout) help set check type" }
1657	}
1658
1659
1660# test help set complaints
1661send "help set complaints\n"
1662expect {
1663	-re "Set max number of complaints about incorrect symbols..*$prompt $"\
1664			{ pass "help set complaints" }
1665	-re "$prompt $"	{ fail "help set complaints" }
1666	timeout		{ fail "(timeout) help set complaints" }
1667	}
1668
1669
1670# test help set confirm
1671send "help set confirm\n"
1672expect {
1673	-re "Set whether to confirm potentially dangerous operations..*$prompt $"\
1674			{ pass "help set confirm" }
1675	-re "$prompt $"	{ fail "help set confirm" }
1676	timeout		{ fail "(timeout) help set confirm" }
1677	}
1678
1679
1680# test help set editing
1681send "help set editing\n"
1682expect {
1683	-re "Set editing of command lines as they are typed..*
1684Use \"on\" to enable to enable the editing, and \"off\" to disable it..*
1685Without an argument, command line editing is enabled.  To edit, use.*
1686EMACS-like or VI-like commands like control-P or ESC..*$prompt $"\
1687			{ pass "help set editing" }
1688	-re "$prompt $"	{ fail "help set editing" }
1689	timeout		{ fail "(timeout) help set editing" }
1690	}
1691
1692
1693# test help set environment
1694send "help set environment\n"
1695expect {
1696	-re "Set environment variable value to give the program..*
1697Arguments are VAR VALUE where VAR is variable name and VALUE is value..*
1698VALUES of environment variables are uninterpreted strings..*
1699This does not affect the program until the next \"run\" command..*$prompt $"\
1700			{ pass "help set environment" }
1701	-re "$prompt $"	{ fail "help set environment" }
1702	timeout		{ fail "(timeout) help set environment" }
1703	}
1704
1705
1706# test help set height
1707send "help set height\n"
1708expect {
1709	-re "Set number of lines gdb thinks are in a page..*$prompt $"\
1710			{ pass "help set height" }
1711	-re "$prompt $"	{ fail "help set height" }
1712	timeout		{ fail "(timeout) help set height" }
1713	}
1714
1715
1716# test help set history expansion
1717send "help set history expansion\n"
1718expect {
1719	-re "Set history expansion on command input..*
1720Without an argument, history expansion is enabled..*$prompt $"\
1721			{ pass "help set history expansion" }
1722	-re "$prompt $"	{ fail "help set history expansion" }
1723	timeout		{ fail "(timeout) help set history expansion" }
1724	}
1725
1726
1727# test help set history filename
1728send "help set history filename\n"
1729expect {
1730	-re "Set the filename in which to record the command history.*
1731 .the list of previous commands of which a record is kept...*$prompt $"\
1732			{ pass "help set history filename" }
1733	-re "$prompt $"	{ fail "help set history filename" }
1734	timeout		{ fail "(timeout) help set history filename" }
1735	}
1736
1737
1738# test help set history save
1739send "help set history save\n"
1740expect {
1741	-re "Set saving of the history record on exit..*
1742Use \"on\" to enable to enable the saving, and \"off\" to disable it..*
1743Without an argument, saving is enabled..*$prompt $"\
1744			{ pass "help set history save" }
1745	-re "$prompt $"	{ fail "help set history save" }
1746	timeout		{ fail "(timeout) help set history save" }
1747	}
1748
1749
1750# test help set history size
1751send "help set history size\n"
1752expect {
1753	-re "Set the size of the command history, .*
1754ie. the number of previous commands to keep a record of..*$prompt $"\
1755			{ pass "help set history size" }
1756	-re "$prompt $"	{ fail "help set history size" }
1757	timeout		{ fail "(timeout) help set history size" }
1758	}
1759
1760
1761# test help set history
1762send "help set history\n"
1763expect {
1764	-re "Generic command for setting command history parameters..*
1765List of set history subcommands:.*
1766set history filename -- Set the filename in which to record the command history.*
1767set history size -- Set the size of the command history.*
1768set history save -- Set saving of the history record on exit.*
1769set history expansion -- Set history expansion on command input.*
1770Type \"help set history\" followed by set history subcommand name for full documentation..*
1771Command name abbreviations are allowed if unambiguous..*$prompt $"\
1772			{ pass "help set history" }
1773	-re "$prompt $"	{ fail "help set history" }
1774	timeout		{ fail "(timeout) help set history" }
1775	}
1776
1777
1778# test help set language
1779send "help set language\n"
1780expect {
1781	-re "Set the current source language..*$prompt $"\
1782			{ pass "help set language" }
1783	-re "$prompt $"	{ fail "help set language" }
1784	timeout		{ fail "(timeout) help set language" }
1785	}
1786
1787
1788# test help set listsize
1789send "help set listsize\n"
1790expect {
1791	-re "Set number of source lines gdb will list by default..*$prompt $"\
1792			{ pass "help set listsize" }
1793	-re "$prompt $"	{ fail "help set listsize" }
1794	timeout		{ fail "(timeout) help set listsize" }
1795	}
1796
1797
1798# test help set print "p" abbreviation
1799# FIXME -- Ultrix hangs randomly on this very long output from gdb and
1800# continues with its output only if something is sent to gdb.
1801# This behaviour throws expect and gdb out of sync, so we better skip this
1802# test.
1803# Also, if the system is slow, it may time out because the output is large.
1804# Just skip the test rather than bothering with increasing the timeout.
1805if 0 then {
1806send "help set p\n"
1807expect {
1808	-re ".*
1809Generic command for setting how things print..*
1810List of set print subcommands:.*
1811Type \"help set print\" followed by set print subcommand name for full documentation..*
1812Command name abbreviations are allowed if unambiguous..*$prompt $"\
1813			{ pass "help set print \"p\" abbreviatio" }
1814	-re "$prompt $"	{ fail "help set print \"p\" abbreviatio" }
1815	timeout		{ fail "(timeout) help set print \"p\" abbreviatio" }
1816	}
1817
1818# test help set print "pr" abbreviation
1819send "help set pr\n"
1820expect {
1821	-re ".*
1822Generic command for setting how things print..*
1823List of set print subcommands:.*
1824Type \"help set print\" followed by set print subcommand name for full documentation..*
1825Command name abbreviations are allowed if unambiguous..*$prompt $"\
1826			{ pass "help set print \"pr\" abbreviation" }
1827	-re "$prompt $"	{ fail "help set print \"pr\" abbreviation" }
1828	timeout		{ fail "(timeout) help set print \"pr\" abbreviation" }
1829	}
1830
1831
1832# test help set print
1833send "help set print\n"
1834expect {
1835	-re ".*
1836Generic command for setting how things print..*
1837List of set print subcommands:.*
1838Type \"help set print\" followed by set print subcommand name for full documentation..*
1839Command name abbreviations are allowed if unambiguous..*$prompt $"\
1840			{ pass "help set print" }
1841	-re "$prompt $"	{ fail "help set print" }
1842	timeout		{ fail "(timeout) help set print" }
1843	}
1844}
1845
1846# test help set print address
1847send "help set print address\n"
1848expect {
1849	-re "Set printing of addresses..*$prompt $"\
1850			{ pass "help set print address" }
1851	-re "$prompt $"	{ fail "help set print address" }
1852	timeout		{ fail "(timeout) help set print address" }
1853	}
1854
1855
1856# test help set print array
1857send "help set print array\n"
1858expect {
1859	-re "Set prettyprinting of arrays..*$prompt $"\
1860			{ pass "help set print array" }
1861	-re "$prompt $"	{ fail "help set print array" }
1862	timeout		{ fail "(timeout) help set print array" }
1863	}
1864
1865
1866# test help set print asm-demangle
1867send "help set print asm-demangle\n"
1868expect {
1869	-re "Set demangling of C\[+\]+ names in disassembly listings..*$prompt $"\
1870			{ pass "help set print asm-demangle" }
1871	-re "$prompt $"	{ fail "help set print asm-demangle" }
1872	timeout		{ fail "(timeout) help set print asm-demangle" }
1873	}
1874
1875
1876# test help set print demangle
1877send "help set print demangle\n"
1878expect {
1879	-re "Set demangling of encoded C\[+\]+ names when displaying symbols..*$prompt $"\
1880			{ pass "help set print demangle" }
1881	-re "$prompt $"	{ fail "help set print demangle" }
1882	timeout		{ fail "(timeout) help set print demangle" }
1883	}
1884
1885
1886# test help set print elements
1887send "help set print elements\n"
1888expect {
1889	-re "Set limit on string chars or array elements to print..*
1890\"set print elements 0\" causes there to be no limit..*$prompt $"\
1891			{ pass "help set print elements" }
1892	-re "$prompt $"	{ fail "help set print elements" }
1893	timeout		{ fail "(timeout) help set print elements" }
1894	}
1895
1896
1897# test help set print object
1898send "help set print object\n"
1899expect {
1900	-re "Set printing of object's derived type based on vtable info..*$prompt $"\
1901			{ pass "help set print object" }
1902	-re "$prompt $"	{ fail "help set print object" }
1903	timeout		{ fail "(timeout) help set print object" }
1904	}
1905
1906
1907# test help set print pretty
1908send "help set print pretty\n"
1909expect {
1910	-re "Set prettyprinting of structures..*$prompt $"\
1911			{ pass "help set print pretty" }
1912	-re "$prompt $"	{ fail "help set print pretty" }
1913	timeout		{ fail "(timeout) help set print pretty" }
1914	}
1915
1916
1917# test help set print sevenbit-strings
1918send "help set print sevenbit-strings\n"
1919expect {
1920	-re "Set printing of 8-bit characters in strings as .nnn..*$prompt $"\
1921			{ pass "help set print sevenbit-strings" }
1922	-re "$prompt $"	{ fail "help set print sevenbit-strings" }
1923	timeout		{ fail "(timeout) help set print sevenbit-strings" }
1924	}
1925
1926
1927# test help set print union
1928send "help set print union\n"
1929expect {
1930	-re "Set printing of unions interior to structures..*$prompt $"\
1931			{ pass "help set print union" }
1932	-re "$prompt $"	{ fail "help set print union" }
1933	timeout		{ fail "(timeout) help set print union" }
1934	}
1935
1936
1937# test help set print vtbl
1938send "help set print vtbl\n"
1939expect {
1940	-re "Set printing of C\[+\]+ virtual function tables..*$prompt $"\
1941			{ pass "help set print vtbl" }
1942	-re "$prompt $"	{ fail "help set print vtbl" }
1943	timeout		{ fail "(timeout) help set print vtbl" }
1944	}
1945
1946
1947# test help set prompt
1948send "help set prompt\n"
1949expect {
1950	-re "Set gdb's prompt.*$prompt $"\
1951			{ pass "help set prompt" }
1952	-re "$prompt $"	{ fail "help set prompt" }
1953	timeout		{ fail "(timeout) help set prompt" }
1954	}
1955
1956
1957# test help set radix
1958send "help set radix\n"
1959expect {
1960	-re "Set default input and output number radices.*
1961Use \'set input-radix\' or \'set output-radix\' to independently set each..*
1962Without an argument, sets both radices back to the default value of 10..*
1963.*$prompt $"\
1964			{ pass "help set radix" }
1965	-re "Set default input and output number radix..*$prompt $"\
1966			{ fail "help set radix (obsolete radix support)" }
1967	-re "$prompt $"	{ fail "help set radix" }
1968	timeout		{ fail "(timeout) help set radix" }
1969	}
1970
1971
1972# test help set symbol-reloading
1973send "help set symbol-reloading\n"
1974expect {
1975	-re "Set dynamic symbol table reloading multiple times in one run..*$prompt $"\
1976			{ pass "help set symbol-reloading" }
1977	-re "$prompt $"	{ fail "help set symbol-reloading" }
1978	timeout		{ fail "(timeout) help set symbol-reloading" }
1979	}
1980
1981
1982# test help set variable
1983send "help set variable\n"
1984expect {
1985	-re ".*
1986Evaluate expression EXP and assign result to variable VAR, using assignment.*
1987syntax appropriate for the current language .VAR = EXP or VAR := EXP for.*
1988example..  VAR may be a debugger \"convenience\" variable .names starting.*
1989with \\\$., a register .a few standard names starting with \\\$., or an actual.*
1990variable in the program being debugged.  EXP is any valid expression.*
1991This may usually be abbreviated to simply \"set\"..*$prompt $"\
1992			{ pass "help set variable" }
1993	-re "$prompt $"	{ fail "help set variable" }
1994	timeout		{ fail "(timeout) help set variable" }
1995	}
1996
1997
1998# test help set verbose
1999send "help set verbose\n"
2000expect {
2001	-re "Set verbosity..*$prompt $"\
2002			{ pass "help set verbose" }
2003	-re "Set verbose printing of informational messages.*$prompt $"\
2004			{ pass "help set verbose. FIXME" }
2005	-re "$prompt $"	{ fail "help set verbose" }
2006	timeout		{ fail "(timeout) help set verbose" }
2007	}
2008
2009
2010#test help set width
2011send "help set width\n"
2012expect {
2013	-re "Set number of characters gdb thinks are in a line..*$prompt $"\
2014			{ pass "help set width" }
2015	-re "$prompt $"	{ fail "help set width" }
2016	timeout		{ fail "(timeout) help set width" }
2017	}
2018
2019
2020# test help set write
2021# This is only supported on targets which use exec.o.
2022if ![istarget "rs6000-*-*"] then {
2023    send "help set write\n"
2024    expect {
2025	-re "Set writing into executable and core files..*$prompt $"\
2026			{ pass "help set write" }
2027	-re "$prompt $"	{ fail "help set write" }
2028	timeout		{ fail "(timeout) help set write" }
2029	}
2030}
2031
2032# test help set
2033# FIXME -- Ultrix hangs randomly on this very long output from gdb and
2034# continues with its output only if something is sent to gdb.
2035# This behaviour throws expect and gdb out of sync, so we better skip this
2036# test.
2037# Also, if the system is slow, it may time out because the output is large.
2038# Just skip the test rather than bothering with increasing the timeout.
2039if 0 then {
2040if ![istarget "*-*-ultrix*"] then {
2041    send "help set\n"
2042    expect {
2043	-re ".*
2044Evaluate expression EXP and assign result to variable VAR, using assignment.*
2045syntax appropriate for the current language .VAR = EXP or VAR := EXP for.*
2046example..  VAR may be a debugger \"convenience\" variable .names starting.*
2047with \\\$., a register .a few standard names starting with \\\$., or an actual.*
2048variable in the program being debugged.  EXP is any valid expression.*
2049set listsize -- Set number of source lines gdb will list by default.*
2050Type \"help set\" followed by set subcommand name for full documentation..*
2051Command name abbreviations are allowed if unambiguous..*
2052$prompt $"\
2053			{ pass "help set" }
2054	-re "$prompt $"	{ fail "help set" }
2055	timeout		{ fail "(timeout) help set" }
2056	}
2057}
2058}
2059
2060# test help shell
2061send "help shell\n"
2062expect {
2063	-re "Execute the rest of the line as a shell command.  .*
2064With no arguments, run an inferior shell..*$prompt $"\
2065			{ pass "help shell" }
2066	-re "$prompt $"	{ fail "help shell" }
2067	timeout		{ fail "(timeout) help shell" }
2068	}
2069
2070
2071#test help show annotate
2072send "help show annotate\n"
2073expect {
2074	-re "Show annotation_level.*
20750 == normal;     1 == fullname \\(for use when running under emacs\\).*
20762 == output annotated suitably for use by programs that control GDB..*$prompt $"\
2077			{ pass "help show annotate" }
2078	-re "$prompt $"	{ fail "help show annotate" }
2079	timeout		{ fail "(timeout) help show annotate" }
2080	}
2081
2082
2083# test help show args
2084send "help show args\n"
2085expect {
2086	-re "Show arguments to give program being debugged when it is started..*
2087Follow this command with any number of args, to be passed to the program..*$prompt $"\
2088			{ pass "help show args" }
2089	-re "$prompt $"	{ fail "help show args" }
2090	timeout		{ fail "(timeout) help show args" }
2091	}
2092
2093
2094# test help show check "c" abbreviation
2095send "help show c\n"
2096expect {
2097	-re "Show the status of the type/range checker.*
2098List of show check subcommands:.*
2099show check range -- Show range checking.*
2100show check type -- Show type checking.*
2101Type \"help show check\" followed by show check subcommand name for full documentation..*
2102Command name abbreviations are allowed if unambiguous..*$prompt $"\
2103			{ pass "help show check \"c\" abbreviation" }
2104	-re "$prompt $"	{ fail "help show check \"c\" abbreviation" }
2105	timeout		{ fail "(timeout) help show check \"c\" abbreviation" }
2106	}
2107
2108
2109# test help show check
2110send "help show check\n"
2111expect {
2112	-re "Show the status of the type/range checker.*
2113List of show check subcommands:.*
2114show check range -- Show range checking.*
2115show check type -- Show type checking.*
2116Type \"help show check\" followed by show check subcommand name for full documentation..*
2117Command name abbreviations are allowed if unambiguous..*$prompt $"\
2118			{ pass "help show check" }
2119	-re "$prompt $"	{ fail "help show check" }
2120	timeout		{ fail "(timeout) help show check" }
2121	}
2122
2123
2124# test help show check range
2125send "help show check range\n"
2126expect {
2127	-re "Show range checking.  .on/warn/off/auto..*$prompt $"\
2128			{ pass "help show check range" }
2129	-re "$prompt $"	{ fail "help show check range" }
2130	timeout		{ fail "(timeout) help show check range" }
2131	}
2132
2133
2134# test help show check type
2135send "help show check type\n"
2136expect {
2137	-re "Show type checking.  .on/warn/off/auto..*$prompt $"\
2138			{ pass "help show check type" }
2139	-re "$prompt $"	{ fail "help show check type" }
2140	timeout		{ fail "(timeout) help show check type" }
2141	}
2142
2143
2144# test help show commands
2145send "help show commands\n"
2146expect {
2147	-re "Show the history of commands you typed..*
2148You can supply a command number to start with, or a `\[+\]' to start after.*
2149the previous command number shown..*$prompt $"\
2150			{ pass "help show commands" }
2151	-re "$prompt $"	{ fail "help show commands" }
2152	timeout		{ fail "(timeout) help show commands" }
2153	}
2154
2155
2156# test help show complaints
2157send "help show complaints\n"
2158expect {
2159	-re "Show max number of complaints about incorrect symbols..*$prompt $"\
2160			{ pass "help show complaints" }
2161	-re "$prompt $"	{ fail "help show complaints" }
2162	timeout		{ fail "(timeout) help show complaints" }
2163	}
2164
2165
2166# test help show confirm
2167send "help show confirm\n"
2168expect {
2169	-re "Show whether to confirm potentially dangerous operations..*$prompt $"\
2170			{ pass "help show confirm" }
2171	-re "$prompt $"	{ fail "help show confirm" }
2172	timeout		{ fail "(timeout) help show confirm" }
2173	}
2174
2175
2176# test help show convenience
2177send "help show convenience\n"
2178expect {
2179	-re "Debugger convenience .\".foo\". variables..*
2180These variables are created when you assign them values;.*
2181thus, \"print .foo=1\" gives \".foo\" the value 1.  Values may be any type..*
2182A few convenience variables are given values automatically:.*
2183\"._\"holds the last address examined with \"x\" or \"info lines\",.*
2184\".__\" holds the contents of the last address examined with \"x\"..*$prompt $"\
2185			{ pass "help show convenience" }
2186	-re "$prompt $"	{ fail "help show convenience" }
2187	timeout		{ fail "(timeout) help show convenience" }
2188	}
2189
2190
2191# test help show directories
2192send "help show directories\n"
2193expect {
2194	-re "Current search path for finding source files..*
2195.cwd in the path means the current working directory..*
2196.cdir in the path means the compilation directory of the source file..*$prompt $"\
2197			{ pass "help show directories" }
2198	-re "$prompt $"	{ fail "help show directories" }
2199	timeout		{ fail "(timeout) help show directories" }
2200	}
2201
2202
2203# test help show editing
2204send "help show editing\n"
2205expect {
2206	-re "Show editing of command lines as they are typed..*
2207Use \"on\" to enable to enable the editing, and \"off\" to disable it..*
2208Without an argument, command line editing is enabled.  To edit, use.*
2209EMACS-like or VI-like commands like control-P or ESC..*$prompt $"\
2210			{ pass "help show editing" }
2211	-re "$prompt $"	{ fail "help show editing" }
2212	timeout		{ fail "(timeout) help show editing" }
2213	}
2214
2215
2216# test help show environment
2217send "help show environment\n"
2218expect {
2219	-re "The environment to give the program, or one variable's value..*
2220With an argument VAR, prints the value of environment variable VAR to.*
2221give the program being debugged.  With no arguments, prints the entire.*
2222environment to be given to the program..*$prompt $"\
2223			{ pass "help show environment" }
2224	-re "$prompt $"	{ fail "help show environment" }
2225	timeout		{ fail "(timeout) help show environment" }
2226	}
2227
2228
2229# test help show height
2230send "help show height\n"
2231expect {
2232	-re "Show number of lines gdb thinks are in a page..*$prompt $"\
2233			{ pass "help show height" }
2234	-re "$prompt $"	{ fail "help show height" }
2235	timeout		{ fail "(timeout) help show height" }
2236	}
2237
2238
2239# test help show history expansion
2240send "help show history expansion\n"
2241expect {
2242	-re "Show history expansion on command input..*
2243Without an argument, history expansion is enabled..*$prompt $"\
2244			{ pass "help show history expansion" }
2245	-re "$prompt $"	{ fail "help show history expansion" }
2246	timeout		{ fail "(timeout) help show history expansion" }
2247	}
2248
2249
2250# test help show history filename
2251send "help show history filename\n"
2252expect {
2253	-re "Show the filename in which to record the command history.*
2254 .the list of previous commands of which a record is kept...*$prompt $"\
2255			{ pass "help show history filename" }
2256	-re "$prompt $"	{ fail "help show history filename" }
2257	timeout		{ fail "(timeout) help show history filename" }
2258	}
2259
2260
2261# test help show history save
2262send "help show history save\n"
2263expect {
2264	-re "Show saving of the history record on exit..*
2265Use \"on\" to enable to enable the saving, and \"off\" to disable it..*
2266Without an argument, saving is enabled..*$prompt $"\
2267			{ pass "help show history save" }
2268	-re "$prompt $"	{ fail "help show history save" }
2269	timeout		{ fail "(timeout) help show history save" }
2270	}
2271
2272
2273# test help show history size
2274send "help show history size\n"
2275expect {
2276	-re "Show the size of the command history, .*
2277ie. the number of previous commands to keep a record of..*$prompt $"\
2278			{ pass "help show history size" }
2279	-re "$prompt $"	{ fail "help show history size" }
2280	timeout		{ fail "(timeout) help show history size" }
2281	}
2282
2283
2284# test help show history
2285send "help show history\n"
2286expect {
2287	-re "Generic command for showing command history parameters..*
2288List of show history subcommands:.*
2289show history filename -- Show the filename in which to record the command history.*
2290show history size -- Show the size of the command history.*
2291show history save -- Show saving of the history record on exit.*
2292show history expansion -- Show history expansion on command input.*
2293Type \"help show history\" followed by show history subcommand name for full documentation..*
2294Command name abbreviations are allowed if unambiguous..*$prompt $"\
2295			{ pass "help show history" }
2296	-re "$prompt $"	{ fail "help show history" }
2297	timeout		{ fail "(timeout) help show history" }
2298	}
2299
2300
2301# test help show language
2302send "help show language\n"
2303expect {
2304	-re "Show the current source language..*$prompt $"\
2305			{ pass "help show language" }
2306	-re "$prompt $"	{ fail "help show language" }
2307	timeout		{ fail "(timeout) help show language" }
2308	}
2309
2310
2311# test help show listsize
2312send "help show listsize\n"
2313expect {
2314	-re "Show number of source lines gdb will list by default..*$prompt $"\
2315			{ pass "help show listsize" }
2316	-re "$prompt $"	{ fail "help show listsize" }
2317	timeout		{ fail "(timeout) help show listsize" }
2318	}
2319
2320
2321# test help show print "p" abbreviation
2322send "help show p\n"
2323expect {
2324	-re "Generic command for showing print settings..*
2325List of show print subcommands:.*
2326Type \"help show print\" followed by show print subcommand name for full documentation..*
2327Command name abbreviations are allowed if unambiguous..*$prompt $"\
2328			{ pass "help show print \"p\" abbreviation" }
2329	-re "$prompt $"	{ fail "help show print \"p\" abbreviation" }
2330	timeout		{ fail "(timeout) help show print \"p\" abbreviation" }
2331	}
2332
2333
2334# test help show print "pr" abbreviation
2335send "help show pr\n"
2336expect {
2337	-re "Generic command for showing print settings..*
2338List of show print subcommands:.*
2339Type \"help show print\" followed by show print subcommand name for full documentation..*
2340Command name abbreviations are allowed if unambiguous..*$prompt $"\
2341			{ pass "help show print \"pr\" abbreviation" }
2342	-re "$prompt $"	{ fail "help show print \"pr\" abbreviation" }
2343	timeout		{ fail "(timeout) help show print \"pr\" abbreviation" }
2344	}
2345
2346
2347# test help show print
2348send "help show print\n"
2349expect {
2350	-re "Generic command for showing print settings..*
2351List of show print subcommands:.*
2352Type \"help show print\" followed by show print subcommand name for full documentation..*
2353Command name abbreviations are allowed if unambiguous..*$prompt $"\
2354			{ pass "help show print" }
2355	-re "$prompt $"	{ fail "help show print" }
2356	timeout		{ fail "(timeout) help show print" }
2357	}
2358
2359
2360# test help show paths
2361send "help show paths\n"
2362expect {
2363	-re "Current search path for finding object files..*
2364.cwd in the path means the current working directory..*
2365This path is equivalent to the .PATH shell variable.  It is a list of.*
2366directories, separated by colons.  These directories are searched to find.*
2367fully linked executable files and separately compiled object files as needed..*$prompt $"\
2368			{ pass "help show paths" }
2369	-re "$prompt $"	{ fail "help show paths" }
2370	timeout		{ fail "(timeout) help show paths" }
2371	}
2372
2373
2374# test help show print address
2375send "help show print address\n"
2376expect {
2377	-re "Show printing of addresses..*$prompt $"\
2378			{ pass "help show print address" }
2379	-re "$prompt $"	{ fail "help show print address" }
2380	timeout		{ fail "(timeout) help show print address" }
2381	}
2382
2383
2384# test help show print array
2385send "help show print array\n"
2386expect {
2387	-re "Show prettyprinting of arrays..*$prompt $"\
2388			{ pass "help show print array" }
2389	-re "$prompt $"	{ fail "help show print array" }
2390	timeout		{ fail "(timeout) help show print array" }
2391	}
2392
2393
2394# test help show print asm-demangle
2395send "help show print asm-demangle\n"
2396expect {
2397	-re "Show demangling of C\[+\]+ names in disassembly listings..*$prompt $"\
2398			{ pass "help show print asm-demangle" }
2399	-re "$prompt $"	{ fail "help show print asm-demangle" }
2400	timeout		{ fail "(timeout) help show print asm-demangle" }
2401	}
2402
2403
2404# test help show print demangle
2405send "help show print demangle\n"
2406expect {
2407	-re "Show demangling of encoded C\[+\]+ names when displaying symbols..*$prompt $"\
2408			{ pass "help show print demangle" }
2409	-re "$prompt $"	{ fail "help show print demangle" }
2410	timeout		{ fail "(timeout) help show print demangle" }
2411	}
2412
2413
2414# test help show print elements
2415send "help show print elements\n"
2416expect {
2417	-re "Show limit on string chars or array elements to print..*
2418\"set print elements 0\" causes there to be no limit..*$prompt $"\
2419			{ pass "help show print elements" }
2420	-re "$prompt $"	{ fail "help show print elements" }
2421	timeout		{ fail "(timeout) help show print elements" }
2422	}
2423
2424
2425# test help show print object
2426send "help show print object\n"
2427expect {
2428	-re "Show printing of object's derived type based on vtable info..*$prompt $"\
2429			{ pass "help show print object" }
2430	-re "$prompt $"	{ fail "help show print object" }
2431	timeout		{ fail "(timeout) help show print object" }
2432	}
2433
2434
2435# test help show print pretty
2436send "help show print pretty\n"
2437expect {
2438	-re "Show prettyprinting of structures..*$prompt $"\
2439			{ pass "help show print pretty" }
2440	-re "$prompt $"	{ fail "help show print pretty" }
2441	timeout		{ fail "(timeout) help show print pretty" }
2442	}
2443
2444
2445# test help show print sevenbit-strings
2446send "help show print sevenbit-strings\n"
2447expect {
2448	-re "Show printing of 8-bit characters in strings as .nnn..*$prompt $"\
2449			{ pass "help show print sevenbit-strings" }
2450	-re "$prompt $"	{ fail "help show print sevenbit-strings" }
2451	timeout		{ fail "(timeout) help show print sevenbit-strings" }
2452	}
2453
2454
2455# test help show print union
2456send "help show print union\n"
2457expect {
2458	-re "Show printing of unions interior to structures..*$prompt $"\
2459			{ pass "help show print union" }
2460	-re "$prompt $"	{ fail "help show print union" }
2461	timeout		{ fail "(timeout) help show print union" }
2462	}
2463
2464
2465# test help show print vtbl
2466send "help show print vtbl\n"
2467expect {
2468	-re "Show printing of C\[+\]+ virtual function tables..*$prompt $"\
2469			{ pass "help show print vtbl" }
2470	-re "$prompt $"	{ fail "help show print vtbl" }
2471	timeout		{ fail "(timeout) help show print vtbl" }
2472	}
2473
2474
2475# test help show prompt
2476send "help show prompt\n"
2477expect {
2478	-re "Show gdb's prompt.*$prompt $"\
2479			{ pass "help show prompt" }
2480	-re "$prompt $"	{ fail "help show prompt" }
2481	timeout		{ fail "(timeout) help show prompt" }
2482	}
2483
2484
2485# test help show radix
2486send "help show radix\n"
2487expect {
2488	-re "Show the default input and output number radices.*
2489Use \'show input-radix\' or \'show output-radix\' to independently show each.*
2490$prompt $"\
2491			{ pass "help show radix" }
2492	-re "Show default input and output number radix..*$prompt $"\
2493			{ fail "help show radix (obsolete radix support)" }
2494	-re "$prompt $"	{ fail "help show radix" }
2495	timeout		{ fail "(timeout) help show radix" }
2496	}
2497
2498
2499# test help show symbol-reloading
2500send "help show symbol-reloading\n"
2501expect {
2502	-re "Show dynamic symbol table reloading multiple times in one run..*$prompt $"\
2503			{ pass "help show symbol-reloading" }
2504	-re "$prompt $"	{ fail "help show symbol-reloading" }
2505	timeout		{ fail "(timeout) help show symbol-reloading" }
2506	}
2507
2508
2509# test help show user
2510send "help show user\n"
2511expect {
2512	-re "Show definitions of user defined commands..*
2513Argument is the name of the user defined command..*
2514With no argument, show definitions of all user defined commands..*$prompt $"\
2515			{ pass "help show user" }
2516	-re "$prompt $"	{ fail "help show user" }
2517	timeout		{ fail "(timeout) help show user" }
2518	}
2519
2520
2521# test help show values
2522send "help show values\n"
2523expect {
2524	-re "Elements of value history around item number IDX .or last ten...*$prompt $"\
2525			{ pass "help show values" }
2526	-re "$prompt $"	{ fail "help show values" }
2527	timeout		{ fail "(timeout) help show values" }
2528	}
2529
2530
2531# test help show verbose
2532send "help show verbose\n"
2533expect {
2534	-re "Show verbosity..*$prompt $"\
2535			{ pass "help show verbose" }
2536	-re "Show verbose printing of informational messages..*$prompt $"\
2537			{ pass "help show verbose. FIXME" }
2538	-re "$prompt $"	{ fail "help show verbose" }
2539	timeout		{ fail "(timeout) help show verbose" }
2540	}
2541
2542
2543# test help show version
2544send "help show version\n"
2545expect {
2546	-re "Show what version of GDB this is..*$prompt $"\
2547			{ pass "help show version" }
2548	-re "$prompt $"	{ fail "help show version" }
2549	timeout		{ fail "(timeout) help show version" }
2550	}
2551
2552
2553# test help show width
2554send "help show width\n"
2555expect {
2556	-re "Show number of characters gdb thinks are in a line..*$prompt $"\
2557			{ pass "help show width" }
2558	-re "$prompt $"	{ fail "help show width" }
2559	timeout		{ fail "(timeout) help show width" }
2560	}
2561
2562
2563# test help show write
2564# This is only supported on targets which use exec.o.
2565if ![istarget "rs6000-*-*"] then {
2566    send "help show write\n"
2567    expect {
2568	-re "Show writing into executable and core files..*$prompt $"\
2569			{ pass "help show write" }
2570	-re "$prompt $"	{ fail "help show write" }
2571	timeout		{ fail "(timeout) help show write" }
2572	}
2573}
2574
2575# test help show
2576# If the system is slow, it may time out because the output is large.
2577# Just skip the test rather than bothering with increasing the timeout.
2578if 0 then {
2579send "help show\n"
2580expect {
2581	-re "Generic command for showing things about the debugger..*
2582List of show subcommands:.*
2583show listsize -- Show number of source lines gdb will list by default.*
2584show directories -- Current search path for finding source files.*
2585Type \"help show\" followed by show subcommand name for full documentation..*
2586Command name abbreviations are allowed if unambiguous..*$prompt $"\
2587			{ pass "help show" }
2588	-re "$prompt $"	{ fail "help show" }
2589	timeout		{ fail "(timeout) help show" }
2590	}
2591}
2592
2593
2594
2595# test help step
2596send "help step\n"
2597expect {
2598	-re "Step program until it reaches a different source line..*
2599Argument N means do this N times .or till program stops for another reason...*$prompt $"\
2600			{ pass "help step" }
2601	-re "$prompt $"	{ fail "help step" }
2602	timeout		{ fail "(timeout) help step" }
2603	}
2604
2605# test help stepi "si" abbreviation
2606send "help si\n"
2607expect {
2608	-re "Step one instruction exactly..*
2609Argument N means do this N times .or till program stops for another reason...*$prompt $"\
2610			{ pass "help stepi \"si\" abbreviation" }
2611	-re "$prompt $"	{ fail "help stepi \"si\" abbreviation" }
2612	timeout		{ fail "(timeout) help stepi \"si\" abbreviation" }
2613	}
2614
2615
2616# test help stepi
2617send "help stepi\n"
2618expect {
2619	-re "Step one instruction exactly..*
2620Argument N means do this N times .or till program stops for another reason...*$prompt $"\
2621			{ pass "help stepi" }
2622	-re "$prompt $"	{ fail "help stepi" }
2623	timeout		{ fail "(timeout) help stepi" }
2624	}
2625
2626
2627# test help signal
2628send "help signal\n"
2629expect {
2630	-re "Continue program giving it signal.*$prompt $"\
2631			{ pass "help signal" }
2632	-re "$prompt $"	{ fail "help signal" }
2633	timeout		{ fail "(timeout) help signal" }
2634	}
2635
2636
2637# test help source
2638# vxgdb reads .vxgdbinit
2639send "help source\n"
2640expect {
2641	-re "Read commands from a file named FILE..*
2642Note that the file \".(vx)?gdbinit\" is read automatically in this way.*
2643when gdb is started..*$prompt $"\
2644			{ pass "help source" }
2645	-re "$prompt $"	{ fail "help source" }
2646	timeout		{ fail "(timeout) help source" }
2647	}
2648
2649
2650# test help stack
2651send "help stack\n"
2652expect {
2653	-re "Examining the stack..*
2654The stack is made up of stack frames.  Gdb assigns numbers to stack frames.*
2655counting from zero for the innermost .currently executing. frame..*
2656At any time gdb identifies one frame as the \"selected\" frame..*
2657Variable lookups are done with respect to the selected frame..*
2658When the program being debugged stops, gdb selects the innermost frame..*
2659The commands below can be used to select other frames by number or address..*
2660List of commands:.*
2661bt -- Print backtrace of all stack frames.*
2662backtrace -- Print backtrace of all stack frames.*
2663select-frame -- Select a stack frame without printing anything.*
2664frame -- Select and print a stack frame.*
2665down -- Select and print stack frame called by this one.*
2666up -- Select and print stack frame that called this one.*
2667return -- Make selected stack frame return to its caller.*
2668Type \"help\" followed by command name for full documentation..*
2669Command name abbreviations are allowed if unambiguous..*$prompt $"\
2670			{ pass "help stack" }
2671	-re "$prompt $"	{ fail "help stack" }
2672	timeout		{ fail "(timeout) help stack" }
2673	}
2674
2675
2676# test help status
2677send "help status\n"
2678expect {
2679	-re "Status inquiries..*
2680List of commands:.*
2681show -- Generic command for showing things about the debugger.*
2682info -- Generic command for showing things about the program being debugged.*
2683Type \"help\" followed by command name for full documentation..*
2684Command name abbreviations are allowed if unambiguous..*$prompt $"\
2685			{ pass "help status" }
2686	-re "$prompt $"	{ fail "help status" }
2687	timeout		{ fail "(timeout) help status" }
2688	}
2689
2690
2691# test help support
2692# FIXME -- Ultrix hangs randomly on this very long output from gdb and
2693# continues with its output only if something is sent to gdb.
2694# This behaviour throws expect and gdb out of sync, so we better skip this
2695# test.
2696# Also, if the system is slow, it may time out because the output is large.
2697# Just skip the test rather than bothering with increasing the timeout.
2698if 0 then {
2699send "help support\n"
2700expect {
2701	-re "Support facilities..*
2702List of commands:.*
2703show confirm -- Show whether to confirm potentially dangerous operations.*
2704show history -- Generic command for showing command history parameters.*
2705down-silently -- Same as the `down' command.*
2706up-silently -- Same as the `up' command.*
2707Type \"help\" followed by command name for full documentation..*
2708Command name abbreviations are allowed if unambiguous..*$prompt $"\
2709			{ pass "help support" }
2710	-re "$prompt $"	{ fail "help support" }
2711	timeout		{ fail "(timeout) help support" }
2712	}
2713}
2714
2715# test help symbol-file
2716send "help symbol-file\n"
2717expect {
2718	-re "Load symbol table from executable file FILE..*
2719The `file' command can also load symbol tables, as well as setting the file.*
2720to execute..*$prompt $"\
2721			{ pass "help symbol-file" }
2722	-re "$prompt $"	{ fail "help symbol-file" }
2723	timeout		{ fail "(timeout) help symbol-file" }
2724	}
2725
2726
2727# test help target child
2728send "help target child\n"
2729expect {
2730	-re "Unix child process .started by the \"run\" command...*$prompt $"\
2731	    { pass "help target child (non-procfs version)" }
2732	-re "Undefined target command: \"child\".  Try \"help target\"..*$prompt $"\
2733	    { pass "help target child (procfs version)" }
2734	-re "$prompt $"	{ fail "help target child" }
2735	timeout		{ fail "(timeout) help target child" }
2736	}
2737
2738
2739# test help target procfs
2740send "help target procfs\n"
2741expect {
2742	-re "Unix /proc child process .started by the \"run\" command...*$prompt $"\
2743	    { pass "help target procfs (procfs version)" }
2744	-re "Undefined target command: \"procfs\".  Try \"help target\"..*$prompt $"\
2745	    { pass "help target procfs (non-procfs version)" }
2746	-re "$prompt $"	{ fail "help target procfs" }
2747	timeout		{ fail "(timeout) help target procfs" }
2748	}
2749
2750
2751# test help target core
2752send "help target core\n"
2753expect {
2754	-re "Use a core file as a target.  Specify the filename of the core file..*$prompt $"\
2755			{ pass "help target core" }
2756	-re "Undefined target command: \"core\".  Try \"help target\"..*$prompt $"\
2757			{ pass "help target core" }
2758	-re "$prompt $"	{ fail "help target core" }
2759	timeout		{ fail "(timeout) help target core" }
2760	}
2761
2762
2763# test help target exec
2764send "help target exec\n"
2765expect {
2766	-re "Use an executable file as a target..*
2767Specify the filename of the executable file..*$prompt $"\
2768			{ pass "help target exec" }
2769	-re "$prompt $"	{ fail "help target exec" }
2770	timeout		{ fail "(timeout) help target exec" }
2771	}
2772
2773
2774# test help target remote
2775if ![istarget "*-*-udi*"] then {
2776    send "help target remote\n"
2777    expect {
2778	-re "Use a remote computer via a serial line, using a gdb-specific protocol..*
2779Specify the serial device it is connected to .e.g. /dev/ttya...*$prompt $"\
2780			{ pass "help target remote" }
2781	-re "$prompt $"	{ fail "help target remote" }
2782	timeout		{ fail "(timeout) help target remote" }
2783    }
2784}
2785
2786# test help target
2787# the child process target may be "target child" or "target procfs"
2788send "help target\n"
2789expect {
2790	-re "Connect to a target machine or process..*
2791The first argument is the type or protocol of the target machine..*
2792Remaining arguments are interpreted by the target protocol.  For more.*
2793information on the arguments for a particular protocol, type.*
2794`help target ' followed by the protocol name..*
2795List of target subcommands:.*
2796target exec -- Use an executable file as a target.*
2797Type \"help target\" followed by target subcommand name for full documentation..*
2798Command name abbreviations are allowed if unambiguous..*$prompt $"\
2799			{ pass "help target" }
2800	-re "$prompt $"	{ fail "help target" }
2801	timeout		{ fail "(timeout) help target" }
2802	}
2803
2804
2805# test help tbreak
2806send "help tbreak\n"
2807expect {
2808	-re "Set a temporary breakpoint.*$prompt $"\
2809			{ pass "help tbreak" }
2810	-re "$prompt $"	{ fail "help tbreak" }
2811	timeout		{ fail "(timeout) help tbreak" }
2812	}
2813
2814
2815# test help tty
2816send "help tty\n"
2817expect {
2818	-re "Set terminal for future runs of program being debugged..*$prompt $"\
2819			{ pass "help tty" }
2820	-re "$prompt $"	{ fail "help tty" }
2821	timeout		{ fail "(timeout) help tty" }
2822	}
2823
2824
2825# test help until "u" abbreviation
2826send "help u\n"
2827expect {
2828	-re "Execute until the program reaches a source line greater than the current.*
2829or a specified line or address or function .same args as break command...*
2830Execution will also stop upon exit from the current stack frame..*$prompt $"\
2831			{ pass "help until \"u\" abbreviation" }
2832	-re "$prompt $"	{ fail "help until \"u\" abbreviation" }
2833	timeout		{ fail "(timeout) help until \"u\" abbreviation" }
2834	}
2835
2836
2837# test help until
2838send "help until\n"
2839expect {
2840	-re "Execute until the program reaches a source line greater than the current.*
2841or a specified line or address or function .same args as break command...*
2842Execution will also stop upon exit from the current stack frame..*$prompt $"\
2843			{ pass "help until" }
2844	-re "$prompt $"	{ fail "help until" }
2845	timeout		{ fail "(timeout) help until" }
2846	}
2847
2848
2849# test help undisplay
2850send "help undisplay\n"
2851expect {
2852	-re "Cancel some expressions to be displayed when program stops..*
2853Arguments are the code numbers of the expressions to stop displaying..*
2854No argument means cancel all automatic-display expressions..*
2855\"delete display\" has the same effect as this command..*
2856Do \"info display\" to see current list of code numbers..*$prompt $"\
2857			{ pass "help undisplay" }
2858	-re "$prompt $"	{ fail "help undisplay" }
2859	timeout		{ fail "(timeout) help undisplay" }
2860	}
2861
2862
2863# test help unset environment
2864send "help unset environment\n"
2865expect {
2866	-re "Cancel environment variable VAR for the program..*
2867This does not affect the program until the next \"run\" command..*$prompt $"\
2868			{ pass "help unset environment" }
2869	-re "$prompt $"	{ fail "help unset environment" }
2870	timeout		{ fail "(timeout) help unset environment" }
2871	}
2872
2873
2874# test help unset
2875send "help unset\n"
2876expect {
2877	-re "Complement to certain \"set\" commands.*
2878List of unset subcommands:.*
2879unset environment -- Cancel environment variable VAR for the program.*
2880Type \"help unset\" followed by unset subcommand name for full documentation..*
2881Command name abbreviations are allowed if unambiguous..*$prompt $"\
2882			{ pass "help unset" }
2883	-re "$prompt $"	{ fail "help unset" }
2884	timeout		{ fail "(timeout) help unset" }
2885	}
2886
2887
2888# test help up
2889send "help up\n"
2890expect {
2891	-re "Select and print stack frame that called this one..*
2892An argument says how many frames up to go..*$prompt $"\
2893			{ pass "help up" }
2894	-re "$prompt $"	{ fail "help up" }
2895	timeout		{ fail "(timeout) help up" }
2896	}
2897
2898
2899# test help up-silently
2900send "help up-silently\n"
2901expect {
2902	-re "Same as the `up' command, but does not print anything..*
2903This is useful in command scripts..*$prompt $"\
2904			{ pass "help up-silently" }
2905	-re "$prompt $"	{ fail "help up-silently" }
2906	timeout		{ fail "(timeout) help up-silently" }
2907	}
2908
2909
2910# test help user-defined
2911send "help user-defined\n"
2912expect {
2913	-re "User-defined commands..*
2914The commands in this class are those defined by the user..*
2915Use the \"define\" command to define a command..*
2916List of commands:.*
2917Type \"help\" followed by command name for full documentation..*
2918Command name abbreviations are allowed if unambiguous..*$prompt $"\
2919			{ pass "help user-defined" }
2920	-re "$prompt $"	{ fail "help user-defined" }
2921	timeout		{ fail "(timeout) help user-defined" }
2922	}
2923
2924
2925# test help watch
2926send "help watch\n"
2927expect {
2928	-re "Set a watchpoint for an expression..*
2929A watchpoint stops execution of your program whenever the value of.*
2930an expression changes..*$prompt $"\
2931			{ pass "help watch" }
2932	-re "$prompt $"	{ fail "help watch" }
2933	timeout		{ fail "(timeout) help watch" }
2934	}
2935
2936
2937# test help whatis
2938send "help whatis\n"
2939expect {
2940	-re "Print data type of expression EXP..*$prompt $"\
2941			{ pass "help whatis" }
2942	-re "$prompt $"	{ fail "help whatis" }
2943	timeout		{ fail "(timeout) help whatis" }
2944	}
2945
2946
2947# test help where
2948send "help where\n"
2949expect {
2950	-re "Print backtrace of all stack frames, or innermost COUNT frames..*
2951With a negative argument, print outermost -COUNT frames..*$prompt $"\
2952			{ pass "help where" }
2953	-re "$prompt $"	{ fail "help where" }
2954	timeout		{ fail "(timeout) help where" }
2955	}
2956
2957
2958# test help x
2959send "help x\n"
2960expect {
2961	-re "Examine memory: x/FMT ADDRESS..*
2962ADDRESS is an expression for the memory address to examine..*
2963FMT is a repeat count followed by a format letter and a size letter..*
2964Defaults for format and size letters are those previously used..*
2965Default count is 1.  Default address is following last thing printed.*
2966with this command or \"print\"..*$prompt $"\
2967			{ pass "help x" }
2968	-re "$prompt $"	{ fail "help x" }
2969	timeout		{ fail "(timeout) help x" }
2970	}
2971
2972
2973# test help info bogus-gdb-command
2974send "help info bogus-gdb-command\n"
2975expect {
2976	-re "Undefined info command: \"bogus-gdb-command\".  Try \"help info\"..*$prompt $"\
2977			{ pass "help info bogus-gdb-command" }
2978	-re "$prompt $"	{ fail "help info bogus-gdb-command" }
2979	timeout		{ fail "(timeout) help info bogus-gdb-command" }
2980	}
2981
2982
2983# test help gotcha
2984send "help gotcha\n"
2985expect {
2986	-re "Undefined command: \"gotcha\".  Try \"help\"..*$prompt $"\
2987			{ pass "help gotcha" }
2988	-re "$prompt $"	{ fail "help gotcha" }
2989	timeout		{ fail "(timeout) help gotcha" }
2990	}
2991
2992