* gdb.base/{corefile.exp,default.exp}: Make names of "up" tests unique.
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / default.exp
1 # Start with a fresh gdb
2
3 gdb_exit
4 gdb_start
5
6 #
7 # test default actions of gdb commands
8 #
9
10 load_lib gdb.exp
11
12 gdb_test "add-symbol-file" "add-symbol-file takes a file name and an address"
13
14 setup_xfail "mips-idt-*"
15 send "attach\n"
16 expect {
17 -re "Argument required .(process-id|program) to attach.*$prompt $"\
18 { pass "attach" }
19 -re "You can't do that when your target is `None'.*$prompt $"\
20 { pass "attach" }
21 -re "Don't know how to attach. Try \"help target\"..*$prompt $"\
22 { pass "attach" }
23 -re "Kill it. .y or n." {
24 send "y\n"
25 exp_continue
26 }
27 -re "$prompt $" { fail "attach" }
28 timeout { fail "(timeout) attach" }
29 }
30
31 # FIXME: attach kills the udi connection
32 if [istarget "a29k-*-udi"] then {
33 gdb_exit
34 gdb_start
35 }
36
37 gdb_test "break" "No default breakpoint address now."
38 foreach i "b br bre brea" {
39 gdb_test $i "No default breakpoint address now." "break \"$i\" abbreviation"
40 }
41
42 setup_xfail "mips-idt-*" "a29k-*-udi" "h8300-*-hms"
43 gdb_test "backtrace" "No stack."
44 foreach i "bt ba bac" {
45 setup_xfail "mips-idt-*" "a29k-*-udi" "h8300-*-hms"
46 gdb_test $i "No stack." "backtrace \"$i\" abbreviation"
47 }
48
49 # This works on the MIPS IDT board, but confuses future tests.
50 if ![istarget "mips-idt-*"] then {
51 setup_xfail "a29k-*-udi"
52 gdb_test "continue" "The program is not being run."
53 setup_xfail "a29k-*-udi"
54 gdb_test "c" "The program is not being run." "continue \"c\" abbreviation"
55 }
56
57 # FIXME: continue kills the udi connection
58 if [istarget "a29k-*-udi"] then {
59 gdb_exit
60 gdb_start
61 }
62
63 #test call
64 send "call\n"
65 expect {
66 -re "The history is empty..*$prompt $"\
67 { pass "call" }
68 -re ".*$prompt $" { fail "call" }
69 timeout { fail "(timeout) call" }
70 }
71
72
73 #test catch
74 send "catch\n"
75 expect {
76 -re "No selected frame..*$prompt $"\
77 { pass "catch" }
78 -re ".*$prompt $" { fail "catch" }
79 timeout { fail "(timeout) catch" }
80 }
81
82
83 #test cd
84 send "cd\n"
85 expect {
86 -re "Argument required .new working directory.*$prompt $"\
87 { pass "cd" }
88 -re ".*$prompt $" { fail "cd" }
89 timeout { fail "(timeout) cd" }
90 }
91
92
93 #test clear
94 send "clear\n"
95 expect {
96 -re "No source file specified..*$prompt $"\
97 { pass "clear" }
98 -re ".*$prompt $" { fail "clear" }
99 timeout { fail "(timeout) clear" }
100 }
101
102
103 #test commands
104 send "commands\n"
105 expect {
106 -re "No breakpoint number 0..*$prompt $"\
107 { pass "commands" }
108 -re ".*$prompt $" { fail "commands" }
109 timeout { fail "(timeout) commands" }
110 }
111
112
113 #test condition
114 send "condition\n"
115 expect {
116 -re "Argument required .breakpoint number.*$prompt $"\
117 { pass "condition" }
118 -re ".*$prompt $" { fail "condition" }
119 timeout { fail "(timeout) condition" }
120 }
121
122
123 #test core-file
124 send "core-file\n"
125 expect {
126 -re "No core file now..*$prompt $"\
127 { pass "core-file" }
128 -re "GDB can't read core files on this machine..*$prompt $"\
129 { pass "core-file" }
130 -re ".*$prompt $" { fail "core-file" }
131 timeout { fail "(timeout) core-file" }
132 }
133
134
135 #test delete "d" abbreviation
136 send "d\n"
137 expect {
138 -re "$prompt $"\
139 { pass "delete \"d\" abbreviation" }
140 timeout { fail "(timeout) delete \"d\" abbreviation" }
141 }
142
143
144 #test delete
145 send "delete\n"
146 expect {
147 -re "$prompt $"\
148 { pass "delete" }
149 timeout { fail "(timeout) delete" }
150 }
151
152
153 #test define
154 send "define\n"
155 expect {
156 -re "Argument required \[(\]name of command to define\[)\]..*$prompt $"\
157 { pass "define" }
158 timeout { fail "(timeout) define" }
159 }
160
161
162 #test delete breakpoints
163 send "delete breakpoints\n"
164 expect {
165 -re "$prompt $"\
166 { pass "delete breakpoints" }
167 timeout { fail "(timeout) delete breakpoints" }
168 }
169
170
171 #test delete display
172 # FIXME -- need to dump full output to detailed log
173 send "delete display\n"
174 expect {
175 -re "delete display.*Delete all auto-display expressions.*y or n. $"\
176 { send "y\n"
177 expect {
178 -re "$prompt $"\
179 { pass "delete display prompt" }
180 timeout { fail "(timeout) delete display prompt" }
181 }
182 }
183 timeout { fail "(timeout) delete display prompt" }
184
185 }
186
187
188 #test detach
189 gdb_test "detach" ""
190 #send "detach\n"
191 #expect {
192 # -re "$prompt $"\
193 # { pass "detach" }
194 # timeout { fail "(timeout) detach" }
195 # }
196
197 # FIXME: continue kills the udi connection
198 if [istarget "a29k-*-udi"] then {
199 gdb_exit
200 gdb_start
201 }
202 if [istarget "h8300-*-hms"] then {
203 gdb_exit
204 gdb_start
205 }
206
207 #test directory
208 # FIXME -- need to dump full output to detailed log
209 send "directory\n"
210 expect {
211 -re "Reinitialize source path to empty.*y or n. $"\
212 { send "y\n"
213 expect {
214 -re "Source directories searched: .cdir:.cwd.*$prompt $"\
215 { pass "directory prompt" }
216 timeout { fail "(timeout) directory prompt" }
217 }
218 }
219 }
220
221
222 #test disable "dis" abbreviation
223 send "dis\n"
224 expect {
225 -re "$prompt $"\
226 { pass "disable \"dis\" abbreviation" }
227 timeout { fail "(timeout) disable \"dis\" abbreviation" }
228 }
229
230
231 #test disable "disa" abbreviation
232 send "disa\n"
233 expect {
234 -re "$prompt $"\
235 { pass "disable \"disa\" abbreviation" }
236 timeout { fail "(timeout) disable \"disa\" abbreviation" }
237 }
238
239
240 #test disable
241 send "disable\n"
242 expect {
243 -re "$prompt $"\
244 { pass "disable" }
245 timeout { fail "(timeout) disable" }
246 }
247
248
249 #test disable breakpoints
250 send "disable breakpoints\n"
251 expect {
252 -re "$prompt $"\
253 { pass "disable breakpoints" }
254 timeout { fail "(timeout) disable breakpoints" }
255 }
256
257
258 #test disable display
259 send "disable display\n"
260 expect {
261 -re "$prompt $"\
262 { pass "disable display" }
263 timeout { fail "(timeout) disable display" }
264 }
265
266
267 #test disassemble
268 send "disassemble\n"
269 expect {
270 -re "No frame selected..*$prompt $"\
271 { pass "disassemble" }
272 -re ".*$prompt $" { fail "disassemble" }
273 timeout { fail "(timeout) disassemble" }
274 }
275
276
277 #test display
278 send "display\n"
279 expect {
280 -re "$prompt $"\
281 { pass "display" }
282 timeout { fail "(timeout) display" }
283 }
284
285
286 #test do
287 send "do\n"
288 expect {
289 -re "No stack..*$prompt $"\
290 { pass "do" }
291 -re ".*$prompt $" { fail "do" }
292 timeout { fail "(timeout) do" }
293 }
294
295
296 #test document
297 send "document\n"
298 expect {
299 -re "Argument required .name of command to define.*$prompt $"\
300 { pass "document" }
301 -re ".*$prompt $" { fail "document" }
302 timeout { fail "(timeout) document" }
303 }
304
305
306 #test down
307 send "down\n"
308 expect {
309 -re "No stack.*$prompt $"\
310 { pass "down" }
311 -re ".*$prompt $" { fail "down" }
312 timeout { fail "(timeout) down" }
313 }
314
315
316 #test down-silently
317 send "down-silently\n"
318 expect {
319 -re "No stack..*$prompt $"\
320 { pass "down-silently" }
321 -re ".*$prompt $" { fail "down-silently" }
322 timeout { fail "(timeout) down-silently" }
323 }
324
325
326 #test echo
327 send "echo\n"
328 expect {
329 -re "$prompt $"\
330 { pass "echo" }
331 timeout { fail "(timeout) echo" }
332 }
333
334
335 #test enable breakpoints delete
336 send "enable breakpoints delete\n"
337 expect {
338 -re "Argument required .one or more breakpoint numbers.*$prompt $"\
339 { pass "enable breakpoints delete" }
340 -re ".*$prompt $" { fail "enable breakpoints delete" }
341 timeout { fail "(timeout) enable breakpoints delete" }
342 }
343
344
345 #test enable breakpoints once
346 send "enable breakpoints once\n"
347 expect {
348 -re "Argument required .one or more breakpoint numbers.*$prompt $"\
349 { pass "enable breakpoints once" }
350 -re ".*$prompt $" { fail "enable breakpoints once" }
351 timeout { fail "(timeout) enable breakpoints once" }
352 }
353
354
355 #test enable breakpoints
356 send "enable breakpoints\n"
357 expect {
358 -re "$prompt $"\
359 { pass "enable breakpoints" }
360 timeout { fail "(timeout) enable breakpoints" }
361 }
362
363
364 #test enable delete
365 send "enable delete\n"
366 expect {
367 -re "Argument required .one or more breakpoint numbers.*$prompt $"\
368 { pass "enable delete" }
369 -re ".*$prompt $" { fail "enable delete" }
370 timeout { fail "(timeout) enable delete" }
371 }
372
373
374 #test enable display
375 send "enable display\n"
376 expect {
377 -re "$prompt $"\
378 { pass "enable display" }
379 timeout { fail "(timeout) enable display" }
380 }
381
382
383 #test enable once
384 send "enable once\n"
385 expect {
386 -re "Argument required .one or more breakpoint numbers.*$prompt $"\
387 { pass "enable once" }
388 -re ".*$prompt $" { fail "enable once" }
389 timeout { fail "(timeout) enable once" }
390 }
391
392
393 #test enable
394 send "enable\n"
395 expect {
396 -re "$prompt $"\
397 { pass "enable" }
398 timeout { fail "(timeout) enable" }
399 }
400
401
402 #test exec-file
403 send "exec-file\n"
404 expect {
405 -re "No exec file now..*$prompt $" {
406 pass "exec-file"
407 }
408 -re "exec-file.*A program is being debugged already. Kill it. .y or n.*$" {
409 send "n\n"
410 if $verbose>1 then {
411 send_user "\tDidn't kill program being debugged\n"
412 }
413 expect -re "$prompt $" { }
414 pass "exec-file"
415 }
416 -re "$prompt $" { fail "exec-file" }
417 timeout { fail "(timeout) exec-file" }
418 }
419
420
421 #test frame "f" abbreviation
422 setup_xfail "a29k-*-udi"
423 send "f\n"
424 expect {
425 -re "No stack..*$prompt $"\
426 { pass "frame \"f\" abbreviation" }
427 -re ".*$prompt $" { fail "frame \"f\" abbreviation" }
428 timeout { fail "(timeout) frame \"f\" abbreviation" }
429 }
430
431
432 #test frame
433 setup_xfail "a29k-*-udi"
434 send "frame\n"
435 expect {
436 -re "No stack..*$prompt $"\
437 { pass "frame" }
438 -re ".*$prompt $" { fail "frame" }
439 timeout { fail "(timeout) frame" }
440 }
441
442
443 #test fg
444 setup_xfail "a29k-*-udi"
445 send "fg\n"
446 expect {
447 -re "The program is not being run..*$prompt $"\
448 { pass "fg" }
449 -re ".*$prompt $" { fail "fg" }
450 timeout { fail "(timeout) fg" }
451 }
452
453 # FIXME: fg kills the udi connection
454 if [istarget "a29k-*-udi"] then {
455 gdb_exit
456 gdb_start
457 }
458
459 #test file
460 send "file\n"
461 expect {
462 -re "No exec file now..*$prompt $"\
463 { pass "file" }
464 -re ".*A program is being debugged already. Kill it. .y or n.*$" {
465 send "n\n"
466 if $verbose>1 then {
467 send_user "\t\tDidn't kill program being debugged\n"
468 }
469 expect -re "$prompt $" { }
470 pass "file"
471 }
472 -re ".*$prompt $" { fail "file" }
473 timeout { fail "(timeout) file" }
474 }
475
476
477 #test finish
478 setup_xfail "a29k-*-udi"
479 send "finish\n"
480 expect {
481 -re "The program is not running..*$prompt $"\
482 { pass "finish" }
483 -re ".*$prompt $" { fail "finish" }
484 timeout { fail "(timeout) finish" }
485 }
486
487
488 #test forward-search
489 # The message here comes from the regexp library, not gdb, and so can
490 # vary on different systems.
491 send "forward-search\n"
492 expect {
493 -re "No previous regular expression.*$prompt $"\
494 { pass "forward-search" }
495 -re "There is no previous regular expression.*$prompt $"\
496 { pass "forward-search" }
497 -re ".*$prompt $" { fail "forward-search" }
498 timeout { fail "(timeout) forward-search" }
499 }
500
501
502 #test help "h" abbreviation
503 send "h\n"
504 expect {
505 -re "List of classes of commands:.*
506 running -- Running the program.*
507 stack -- Examining the stack.*
508 data -- Examining data.*
509 breakpoints -- Making program stop at certain points.*
510 files -- Specifying and examining files.*
511 status -- Status inquiries.*
512 support -- Support facilities.*
513 user-defined -- User-defined commands.*
514 aliases -- Aliases of other commands.*
515 obscure -- Obscure features.*
516 Type \"help\" followed by a class name for a list of commands in that class..*
517 Type \"help\" followed by command name for full documentation..*
518 Command name abbreviations are allowed if unambiguous..*$prompt $"\
519 { pass "help \"h\" abbreviation" }
520 -re ".*$prompt $" { fail "help \"h\" abbreviation" }
521 timeout { fail "(timeout) help \"h\" abbreviation" }
522 }
523
524
525 #test help
526 send "help\n"
527 expect {
528 -re "List of classes of commands:.*
529 running -- Running the program.*
530 stack -- Examining the stack.*
531 data -- Examining data.*
532 breakpoints -- Making program stop at certain points.*
533 files -- Specifying and examining files.*
534 status -- Status inquiries.*
535 support -- Support facilities.*
536 user-defined -- User-defined commands.*
537 aliases -- Aliases of other commands.*
538 obscure -- Obscure features.*
539 Type \"help\" followed by a class name for a list of commands in that class..*
540 Type \"help\" followed by command name for full documentation..*
541 Command name abbreviations are allowed if unambiguous..*$prompt $"\
542 { pass "help" }
543 -re ".*$prompt $" { fail "help" }
544 timeout { fail "(timeout) help" }
545 }
546
547
548 #test handle
549 send "handle\n"
550 expect {
551 -re "Argument required .signal to handle.*$prompt $"\
552 { pass "handle" }
553 -re ".*$prompt $" { fail "handle" }
554 timeout { fail "(timeout) handle" }
555 }
556
557
558 #test info "i" abbreviation
559 send "i\n"
560 expect {
561 -re "\"info\" must be followed by the name of an info command..*
562 List of info subcommands:.*
563 Type \"help info\" followed by info subcommand name for full documentation..*
564 Command name abbreviations are allowed if unambiguous..*$prompt $"\
565 { pass "info \"i\" abbreviation" }
566 -re ".*$prompt $" { fail "info \"i\" abbreviation" }
567 timeout { fail "(timeout) info \"i\" abbreviation" }
568 }
569
570
571 #test info
572 send "info\n"
573 expect {
574 -re "\"info\" must be followed by the name of an info command..*
575 List of info subcommands:.*
576 Type \"help info\" followed by info subcommand name for full documentation..*
577 Command name abbreviations are allowed if unambiguous..*$prompt $"\
578 { pass "info" }
579 -re ".*$prompt $" { fail "info" }
580 timeout { fail "(timeout) info" }
581 }
582
583
584 #test ignore
585 send "ignore\n"
586 expect {
587 -re "Argument required .a breakpoint number.*$prompt $"\
588 { pass "ignore" }
589 -re ".*$prompt $" { fail "ignore" }
590 timeout { fail "(timeout) ignore" }
591 }
592
593
594 #test info address
595 send "info address\n"
596 expect {
597 -re "Argument required..*$prompt $"\
598 { pass "info address" }
599 -re ".*$prompt $" { fail "info address" }
600 timeout { fail "(timeout) info address" }
601 }
602
603
604 #test info all-registers
605 setup_xfail "a29k-*-udi"
606 send "info all-registers\n"
607 expect {
608 -re "The program has no registers now..*$prompt $"\
609 { pass "info all-registers" }
610 -re ".*$prompt $" { fail "info all-registers" }
611 timeout { fail "(timeout) info all-registers" }
612 }
613
614
615 #test info args
616 send "info args\n"
617 expect {
618 -re "No frame selected..*$prompt $"\
619 { pass "info args" }
620 -re ".*$prompt $" { fail "info args" }
621 timeout { fail "(timeout) info args" }
622 }
623
624
625 #test info bogus-gdb-command
626 send "info bogus-gdb-command\n"
627 expect {
628 -re "Undefined info command: \"bogus-gdb-command\". Try \"help info\"..*$prompt $"\
629 { pass "info bogus-gdb-command" }
630 -re ".*$prompt $" { fail "info bogus-gdb-command" }
631 timeout { fail "(timeout) info bogus-gdb-command" }
632 }
633
634
635 #test info breakpoints
636 send "info breakpoints\n"
637 expect {
638 -re "No breakpoints or watchpoints..*$prompt $"\
639 { pass "info breakpoints" }
640 -re ".*$prompt $" { fail "info breakpoints" }
641 timeout { fail "(timeout) info breakpoints" }
642 }
643
644
645 #test info catch
646 send "info catch\n"
647 expect {
648 -re "No frame selected..*$prompt $"\
649 { pass "info catch" }
650 -re ".*$prompt $" { fail "info catch" }
651 timeout { fail "(timeout) info catch" }
652 }
653
654
655 #test info copying
656 # FIXME -- doesn't work worth a shit
657 #send "info copying\n"
658 #expect {
659 # -re "GNU GENERAL PUBLIC LICENSE.*\
660 #of preserving the free status of all derivatives of our free software and.*\
661 #of promoting the sharing and reuse of software generally..*$prompt $"\
662 # { pass "info copying" }
663 # timeout { fail "(timeout) info copying" }
664 # }
665 #
666 #
667
668 #test info display
669 send "info display\n"
670 expect {
671 -re "There are no auto-display expressions now..*$prompt $"\
672 { pass "info display" }
673 -re ".*$prompt $" { fail "info display" }
674 timeout { fail "(timeout) info display" }
675 }
676
677
678 #test info frame "f" abbreviation
679 send "info f\n"
680 expect {
681 -re "No stack..*$prompt $"\
682 { pass "info frame \"f\" abbreviation" }
683 -re "No selected frame..*$prompt $"\
684 { pass "info frame \"f\" abbreviation" }
685 -re ".*$prompt $" { fail "info frame \"f\" abbreviation" }
686 timeout { fail "(timeout) info frame \"f\" abbreviation" }
687 }
688
689
690 #test info frame
691 send "info frame\n"
692 expect {
693 -re "No stack..*$prompt $"\
694 { pass "info frame" }
695 -re "No selected frame..*$prompt $"\
696 { pass "info frame" }
697 -re ".*$prompt $" { fail "info frame" }
698 timeout { fail "(timeout) info frame" }
699 }
700
701
702 #test info files
703 send "info files\n"
704 expect {
705 -re "$prompt $"\
706 { pass "info files" }
707 timeout { fail "(timeout) info files" }
708 }
709
710
711 #test info float
712 send "info float\n"
713 expect {
714 -re "No floating point info available for this processor..*$prompt $"\
715 { pass "info float" }
716 -re ".*$prompt $" { fail "info float" }
717 timeout { fail "(timeout) info float" }
718 }
719
720
721 #test info functions
722 send "info functions\n"
723 expect {
724 -re "All defined functions:.*$prompt $"\
725 { pass "info functions" }
726 -re ".*$prompt $" { fail "info functions" }
727 timeout { fail "(timeout) info functions" }
728 }
729
730 gdb_test "info line" "No line number information.*" "info line"
731
732 #test info locals
733 send "info locals\n"
734 expect {
735 -re "No frame selected..*$prompt $"\
736 { pass "info locals" }
737 -re ".*$prompt $" { fail "info locals" }
738 timeout { fail "(timeout) info locals" }
739 }
740
741
742 #test info program
743 setup_xfail "a29k-*-udi"
744 send "info program\n"
745 expect {
746 -re "The program being debugged is not being run..*$prompt $"\
747 { pass "info program" }
748 -re ".*$prompt $" { fail "info program" }
749 timeout { fail "(timeout) info program" }
750 }
751
752
753 #test info registers
754 setup_xfail "a29k-*-udi"
755 send "info registers\n"
756 expect {
757 -re "The program has no registers now..*$prompt $"\
758 { pass "info registers" }
759 -re ".*$prompt $" { fail "info registers" }
760 timeout { fail "(timeout) info registers" }
761 }
762
763
764 #test info stack "s" abbreviation
765 setup_xfail "a29k-*-udi"
766 send "info s\n"
767 expect {
768 -re "No stack..*$prompt $"\
769 { pass "info stack \"s\" abbreviation" }
770 -re ".*$prompt $" { fail "info stack \"s\" abbreviation" }
771 timeout { fail "(timeout) info stack \"s\" abbreviation" }
772 }
773
774
775 #test info stack
776 setup_xfail "a29k-*-udi"
777 send "info stack\n"
778 expect {
779 -re "No stack..*$prompt $"\
780 { pass "info stack" }
781 -re ".*$prompt $" { fail "info stack" }
782 timeout { fail "(timeout) info stack" }
783 }
784
785
786 #test info set
787 # FIXME -- needs to match the entire output
788 send "info set\n"
789 expect {
790 -re "confirm: Whether to confirm potentially dangerous operations is on..*
791 history filename: The filename in which to record the command history is .*
792 listsize: Number of source lines gdb will list by default is 10..*$prompt $"\
793 { pass "info set" }
794 -re "\n$prompt $" { fail "info set" }
795 timeout { fail "(timeout) info set" }
796 }
797
798
799 #test info source
800 send "info source\n"
801 expect {
802 -re "No current source file..*$prompt $"\
803 { pass "info source" }
804 -re ".*$prompt $" { fail "info source" }
805 timeout { fail "(timeout) info source" }
806 }
807
808
809 #test info sources
810 send "info sources\n"
811 expect {
812 -re "No symbol table is loaded. Use the \"file\" command..*$prompt $"\
813 { pass "info sources" }
814 -re ".*$prompt $" { fail "info sources" }
815 timeout { fail "(timeout) info sources" }
816 }
817
818
819 #test info target
820 send "info target\n"
821 expect {
822 -re "$prompt $"\
823 { pass "info target" }
824 timeout { fail "(timeout) info target" }
825 }
826
827
828 #test info terminal
829 send "info terminal\n"
830 expect {
831 -re "No saved terminal information..*$prompt $"\
832 { pass "info terminal" }
833 -re ".*$prompt $" { fail "info terminal" }
834 timeout { fail "(timeout) info terminal" }
835 }
836
837
838 #test info types
839 send "info types\n"
840 expect {
841 -re "All defined types:.*$prompt $"\
842 { pass "info types" }
843 -re ".*$prompt $" { fail "info types" }
844 timeout { fail "(timeout) info types" }
845 }
846
847
848 #test info variables
849 send "info variables\n"
850 expect {
851 -re "All defined variables:.*$prompt $"\
852 { pass "info variables" }
853 -re ".*$prompt $" { fail "info variables" }
854 timeout { fail "(timeout) info variables" }
855 }
856
857
858 #test info warranty
859 send "info warranty\n"
860 expect {
861 -re "NO WARRANTY.*
862 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY.*
863 FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN.*
864 OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES.*
865 PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED.*
866 OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF.*
867 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS.*
868 TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE.*
869 PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,.*
870 REPAIR OR CORRECTION..*
871 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING.*
872 WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR.*
873 REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,.*
874 INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING.*
875 OUT OF THE USE OR INABILITY TO USE THE PROGRAM .INCLUDING BUT NOT LIMITED.*
876 TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY.*
877 YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER.*
878 PROGRAMS., EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE.*
879 POSSIBILITY OF SUCH DAMAGES..*$prompt $"\
880 { pass "info warranty" }
881 -re ".*$prompt $" { fail "info warranty" }
882 timeout { fail "(timeout) info warranty" }
883 }
884
885
886 #test info watchpoints
887 send "info watchpoints\n"
888 expect {
889 -re "No breakpoints or watchpoints..*$prompt $"\
890 { pass "info watchpoints" }
891 -re ".*$prompt $" { fail "info watchpoints" }
892 timeout { fail "(timeout) info watchpoints" }
893 }
894
895
896 #test inspect
897 send "inspect\n"
898 expect {
899 -re "The history is empty..*$prompt $"\
900 { pass "inspect" }
901 -re ".*$prompt $" { fail "inspect" }
902 timeout { fail "(timeout) inspect" }
903 }
904
905
906 #test jump
907 setup_xfail "a29k-*-udi"
908 send "jump\n"
909 expect {
910 -re "The program is not being run..*$prompt $"\
911 { pass "jump" }
912 -re ".*$prompt $" { fail "jump" }
913 timeout { fail "(timeout) jump" }
914 }
915
916
917 #test kill
918 send "kill\n"
919 expect {
920 -re "The program is not being run..*$prompt $"\
921 { pass "kill" }
922 -re ".*$prompt $" { fail "kill" }
923 timeout { fail "(timeout) kill" }
924 }
925
926
927 #test list "l" abbreviation
928 send "l\n"
929 expect {
930 -re "No symbol table is loaded. Use the \"file\" command..*$prompt $"\
931 { pass "list \"l\" abbreviation" }
932 -re ".*$prompt $" { fail "list \"l\" abbreviation" }
933 timeout { fail "(timeout) list \"l\" abbreviation" }
934 }
935
936
937 #test list
938 send "list\n"
939 expect {
940 -re "No symbol table is loaded. Use the \"file\" command..*$prompt $"\
941 { pass "list" }
942 -re ".*$prompt $" { fail "list" }
943 timeout { fail "(timeout) list" }
944 }
945
946
947 #test load
948 # The ``takes a file name'' case is for vxgdb.
949 # The ``Use the "file" command'' case is for newer GDB versions which try
950 # to deduce the filename from the exec file.
951 send "load\n"
952 expect {
953 -re "You can't do that when your target is `None'.*$prompt $"\
954 { pass "load" }
955 -re "The load command takes a file name.*$prompt $"\
956 { pass "load" }
957 -re "Must specify at least a file name with the load command.*$prompt $"\
958 { pass "load" }
959 -re "Use the .file. or .exec-file. command.*$prompt $"\
960 { pass "load" }
961 -re ".*$prompt $" { fail "load" }
962 timeout { fail "(timeout) load" }
963 }
964
965
966 #test next "n" abbreviation
967 setup_xfail "a29k-*-udi"
968 send "n\n"
969 expect {
970 -re "The program is not being run..*$prompt $"\
971 { pass "next \"n\" abbreviation" }
972 -re ".*$prompt $" { fail "next \"n\" abbreviation" }
973 timeout { fail "(timeout) next \"n\" abbreviation" }
974 }
975
976
977 #test next
978 setup_xfail "a29k-*-udi"
979 send "next\n"
980 expect {
981 -re "The program is not being run..*$prompt $"\
982 { pass "next" }
983 -re ".*$prompt $" { fail "next" }
984 timeout { fail "(timeout) next" }
985 }
986
987
988 #test nexti "ni" abbreviation
989 setup_xfail "a29k-*-udi"
990 send "ni\n"
991 expect {
992 -re "The program is not being run..*$prompt $"\
993 { pass "nexti \"ni\" abbreviation" }
994 -re ".*$prompt $" { fail "nexti \"ni\" abbreviation" }
995 timeout { fail "(timeout) nexti \"ni\" abbreviation" }
996 }
997
998
999 #test nexti
1000 setup_xfail "a29k-*-udi"
1001 send "nexti\n"
1002 expect {
1003 -re "The program is not being run..*$prompt $"\
1004 { pass "nexti" }
1005 -re ".*$prompt $" { fail "nexti" }
1006 timeout { fail "(timeout) nexti" }
1007 }
1008
1009
1010 #test output
1011 send "output\n"
1012 expect {
1013 -re "Argument required .expression to compute.*$prompt $"\
1014 { pass "output" }
1015 -re ".*$prompt $" { fail "output" }
1016 timeout { fail "(timeout) output" }
1017 }
1018
1019
1020 #test print "p" abbreviation
1021 send "p\n"
1022 expect {
1023 -re "The history is empty..*$prompt $"\
1024 { pass "print \"p\" abbreviation" }
1025 -re ".*$prompt $" { fail "print \"p\" abbreviation" }
1026 timeout { fail "(timeout) print \"p\" abbreviation" }
1027 }
1028
1029
1030 #test print
1031 send "print\n"
1032 expect {
1033 -re "The history is empty..*$prompt $"\
1034 { pass "print" }
1035 -re ".*$prompt $" { fail "print" }
1036 timeout { fail "(timeout) print" }
1037 }
1038
1039
1040 #test printf
1041 send "printf\n"
1042 expect {
1043 -re "Argument required .format-control string and values to print.*$prompt $"\
1044 { pass "printf" }
1045 -re ".*$prompt $" { fail "printf" }
1046 timeout { fail "(timeout) printf" }
1047 }
1048
1049
1050 # this command was removed from GDB 4.5.8
1051 #test printsyms
1052 #send "printsyms\n"
1053 #expect {
1054 # -re "printsyms takes an output file name and optional symbol file name.*$prompt $"\
1055 # { pass "printsyms" }
1056 # -re ".*$prompt $" { fail "printsyms" }
1057 # timeout { fail "(timeout) printsyms" }
1058 # }
1059
1060 #test ptype
1061 send "ptype\n"
1062 expect {
1063 -re "The history is empty..*$prompt $"\
1064 { pass "ptype" }
1065 -re ".*$prompt $" { fail "ptype" }
1066 timeout { fail "(timeout) ptype" }
1067 }
1068
1069
1070 #test pwd
1071 send "pwd\n"
1072 expect {
1073 -re "Working directory .*$prompt $"\
1074 { pass "pwd" }
1075 -re ".*$prompt $" { fail "pwd" }
1076 timeout { fail "(timeout) pwd" }
1077 }
1078
1079
1080 #test run "r" abbreviation
1081 if [istarget "*-*-vxworks"] then {
1082 send "set args\n"
1083 expect -re "$prompt $" {}
1084 gdb_test "r" "Starting program: .*
1085 You must specify a function name to run, and arguments if any"\
1086 "run \"r\" abbreviation"
1087 send "set args main\n"
1088 expect -re "$prompt $" {}
1089 } else {
1090 send "r\n"
1091 expect {
1092 -re "Starting program: .*
1093 You can't do that when your target is `None'.*$prompt $"\
1094 { pass "run \"r\" abbreviation" }
1095 -re "Starting program: .*
1096 No executable file specified.*
1097 Use the \"file\" or \"exec-file\" command.*$prompt $"\
1098 { pass "run \"r\" abbreviation" }
1099 -re "Starting program: .*
1100 No image loaded into target.*$prompt $"\
1101 { pass "run \"r\" abbreviation" }
1102 -re "Don't know how to run. Try \"help target\"..*$prompt $"\
1103 { pass "run \"r\" abbreviation" }
1104 -re ".*$prompt $" { fail "run \"r\" abbreviation" }
1105 timeout { fail "(timeout) run \"r\" abbreviation" }
1106 }
1107 }
1108
1109 #test run
1110 if [istarget "*-*-vxworks"] then {
1111 send "set args\n"
1112 expect -re "$prompt $" {}
1113 gdb_test "run" "Starting program: .*
1114 You must specify a function name to run, and arguments if any"
1115 send "set args main\n"
1116 expect -re "$prompt $" {}
1117 } else {
1118 send "run\n"
1119 expect {
1120 -re "Starting program:.*You can't do that when your target is `None'.*$prompt $" { pass "run" }
1121 -re "Starting program: .*
1122 No executable file specified.*
1123 Use the \"file\" or \"exec-file\" command.*$prompt $"\
1124 { pass "run" }
1125 -re "Starting program: .*
1126 No image loaded into target.*$prompt $"\
1127 { pass "run" }
1128 -re "Don't know how to run. Try \"help target\"..*$prompt $"\
1129 { pass "run" }
1130 -re ".*$prompt $" { fail "run" }
1131 timeout { fail "(timeout) run" }
1132 }
1133 }
1134
1135 #test rbreak
1136 send "rbreak\n"
1137 expect {
1138 -re "$prompt $"\
1139 { pass "rbreak" }
1140 timeout { fail "(timeout) rbreak" }
1141 }
1142
1143
1144 #test return
1145 # The middle case accommodates the a29k, where doing the "ni" above causes
1146 # an initial stack to be created.
1147 send "return\n"
1148 expect {
1149 -re "No selected frame..*$prompt $"\
1150 { pass "return" }
1151 -re "Make .* return now.*y or n. $" {
1152 send "y\n"
1153 exp_continue
1154 }
1155 -re ".*$prompt $" { fail "return" }
1156 timeout { fail "(timeout) return" }
1157 }
1158
1159
1160 #test reverse-search
1161 send "reverse-search\n"
1162 expect {
1163 -re "No previous regular expression.*$prompt $"\
1164 { pass "reverse-search" }
1165 -re "There is no previous regular expression.*$prompt $"\
1166 { pass "forward-search" }
1167 -re ".*$prompt $" { fail "reverse-search" }
1168 timeout { fail "(timeout) reverse-search" }
1169 }
1170
1171
1172 #test step "s" abbreviation
1173 setup_xfail "a29k-*-udi"
1174 send "s\n"
1175 expect {
1176 -re "The program is not being run..*$prompt $"\
1177 { pass "step \"s\" abbreviation" }
1178 -re ".*$prompt $" { fail "step \"s\" abbreviation" }
1179 timeout { fail "(timeout) step \"s\" abbreviation" }
1180 }
1181
1182
1183 #test step
1184 setup_xfail "a29k-*-udi"
1185 send "step\n"
1186 expect {
1187 -re "The program is not being run..*$prompt $"\
1188 { pass "step" }
1189 -re ".*$prompt $" { fail "step" }
1190 timeout { fail "(timeout) step" }
1191 }
1192
1193
1194 #test search
1195 send "search\n"
1196 expect {
1197 -re "No previous regular expression.*$prompt $"\
1198 { pass "search" }
1199 -re "There is no previous regular expression.*$prompt $"\
1200 { pass "forward-search" }
1201 -re ".*$prompt $" { fail "search" }
1202 timeout { fail "(timeout) search" }
1203 }
1204
1205
1206 #test section
1207 send "section\n"
1208 expect {
1209 -re "Must specify section name and its virtual address.*$prompt $"\
1210 { pass "section" }
1211 -re ".*$prompt $" { fail "section" }
1212 timeout { fail "(timeout) section" }
1213 }
1214
1215
1216 #test set args
1217 send "set args\n"
1218 expect {
1219 -re "$prompt $"\
1220 { pass "set args" }
1221 timeout { fail "(timeout) set args" }
1222 }
1223
1224
1225 #test set check "c" abbreviation
1226 send "set c\n"
1227 expect {
1228 -re "\"set check\" must be followed by the name of a check subcommand..*
1229 List of set check subcommands:.*
1230 set check range -- Set range checking.*
1231 set check type -- Set type checking.*
1232 Type \"help set check\" followed by set check subcommand name for full documentation..*
1233 Command name abbreviations are allowed if unambiguous..*$prompt $"\
1234 { pass "set check \"c\" abbreviation" }
1235 -re ".*$prompt $" { fail "set check \"c\" abbreviation" }
1236 timeout { fail "(timeout) set check \"c\" abbreviation" }
1237 }
1238
1239
1240 #test set check "ch" abbreviation
1241 send "set ch\n"
1242 expect {
1243 -re "\"set check\" must be followed by the name of a check subcommand..*
1244 List of set check subcommands:.*
1245 set check range -- Set range checking.*
1246 set check type -- Set type checking.*
1247 Type \"help set check\" followed by set check subcommand name for full documentation..*
1248 Command name abbreviations are allowed if unambiguous..*$prompt $"\
1249 { pass "set check \"ch\" abbreviation" }
1250 -re ".*$prompt $" { fail "set check \"ch\" abbreviation" }
1251 timeout { fail "(timeout) set check \"ch\" abbreviation" }
1252 }
1253
1254
1255 #test set check
1256 send "set check\n"
1257 expect {
1258 -re "\"set check\" must be followed by the name of a check subcommand..*
1259 List of set check subcommands:.*
1260 set check range -- Set range checking.*
1261 set check type -- Set type checking.*
1262 Type \"help set check\" followed by set check subcommand name for full documentation..*
1263 Command name abbreviations are allowed if unambiguous..*$prompt $"\
1264 { pass "set check" }
1265 -re ".*$prompt $" { fail "set check" }
1266 timeout { fail "(timeout) set check" }
1267 }
1268
1269
1270 #test set check range
1271 send "set check range\n"
1272 expect {
1273 -re "$prompt $"\
1274 { pass "set check range" }
1275 timeout { fail "(timeout) set check range" }
1276 }
1277
1278
1279 #test set check type
1280 send "set check type\n"
1281 expect {
1282 -re "$prompt $"\
1283 { pass "set check type" }
1284 timeout { fail "(timeout) set check type" }
1285 }
1286
1287
1288 #test set complaints
1289 send "set complaints\n"
1290 expect {
1291 -re "Argument required .integer to set it to.*$prompt $"\
1292 { pass "set complaints" }
1293 -re ".*$prompt $" { fail "set complaints" }
1294 timeout { fail "(timeout) set complaints" }
1295 }
1296
1297
1298 #test set confirm
1299 send "set confirm\n"
1300 expect {
1301 -re "$prompt $"\
1302 { pass "set confirm" }
1303 timeout { fail "(timeout) set confirm" }
1304 }
1305
1306
1307 #test set editing
1308 send "set editing\n"
1309 expect {
1310 -re "$prompt $"\
1311 { pass "set editing" }
1312 timeout { fail "(timeout) set editing" }
1313 }
1314
1315
1316
1317 #test set environment
1318 send "set environment\n"
1319 expect {
1320 -re "Argument required .environment variable and value.*$prompt $"\
1321 { pass "set environment" }
1322 -re ".*$prompt $" { fail "set environment" }
1323 timeout { fail "(timeout) set environment" }
1324 }
1325
1326
1327 #test set height
1328 send "set height\n"
1329 expect {
1330 -re "Argument required .integer to set it to.*$prompt $"\
1331 { pass "set height" }
1332 -re ".*$prompt $" { fail "set height" }
1333 timeout { fail "(timeout) set height" }
1334 }
1335
1336
1337 #test set history expansion
1338 send "set history expansion\n"
1339 expect {
1340 -re "$prompt $"\
1341 { pass "set history expansion" }
1342 timeout { fail "(timeout) set history expansion" }
1343 }
1344
1345
1346 #test set history filename
1347 send "set history filename\n"
1348 expect {
1349 -re "Argument required .filename to set it to.*$prompt $" {
1350 pass "set history filename"
1351 }
1352 -re ".*$prompt $" {
1353 fail "set history filename"
1354 }
1355 timeout {
1356 fail "(timeout) set history filename"
1357 }
1358 }
1359
1360
1361 #test set history save
1362 send "set history save\n"
1363 expect {
1364 -re "$prompt $"\
1365 { pass "set history save" }
1366 timeout { fail "(timeout) set history save" }
1367 }
1368
1369
1370 #test set history size
1371 send "set history size\n"
1372 expect {
1373 -re "Argument required .integer to set it to.*$prompt $"\
1374 { pass "set history size" }
1375 -re ".*$prompt $" { fail "set history size" }
1376 timeout { fail "(timeout) set history size" }
1377 }
1378
1379
1380 #test set history
1381 send "set history\n"
1382 expect {
1383 -re "\"set history\" must be followed by the name of a history subcommand..*
1384 List of set history subcommands:.*
1385 set history filename -- Set the filename in which to record the command history.*
1386 set history size -- Set the size of the command history.*
1387 set history save -- Set saving of the history record on exit.*
1388 set history expansion -- Set history expansion on command input.*
1389 Type \"help set history\" followed by set history subcommand name for full documentation..*
1390 Command name abbreviations are allowed if unambiguous..*$prompt $"\
1391 { pass "set history" }
1392 -re ".*$prompt $" { fail "set history" }
1393 timeout { fail "(timeout) set history" }
1394 }
1395
1396
1397 #test set language
1398 send "set language\n"
1399 expect {
1400 -re "The currently understood settings are:.*
1401 local or auto Automatic setting based on source file.*
1402 c Use the C language.*
1403 c\[+\]+ Use the C\[+\]+ language.*
1404 modula-2 Use the Modula-2 language.*$prompt $" {
1405 pass "set language"
1406 }
1407 -re ".*$prompt $" {
1408 fail "set language"
1409 }
1410 timeout {
1411 fail "(timeout) set language"
1412 }
1413 }
1414
1415
1416 #test set listsize
1417 send "set listsize\n"
1418 expect {
1419 -re "Argument required .integer to set it to.*$prompt $" {
1420 pass "set listsize"
1421 }
1422 -re ".*$prompt $" { fail "set listsize" }
1423 timeout { fail "(timeout) set listsize" }
1424 }
1425
1426
1427 #test set print "p" abbreviation
1428 send "set p\n"
1429 expect {
1430 -re "\"set print\" must be followed by the name of a print subcommand..*
1431 List of set print subcommands:.*
1432 Type \"help set print\" followed by set print subcommand name for full documentation..*
1433 Command name abbreviations are allowed if unambiguous..*$prompt $" {
1434 pass "set print \"p\" abbreviation"
1435 }
1436 -re ".*$prompt $" { fail "set print \"p\" abbreviation" }
1437 timeout { fail "(timeout) set print \"p\" abbreviation" }
1438 }
1439
1440
1441 #test set print "pr" abbreviation
1442 send "set pr\n"
1443 expect {
1444 -re "\"set print\" must be followed by the name of a print subcommand..*
1445 List of set print subcommands:.*
1446 Type \"help set print\" followed by set print subcommand name for full documentation..*
1447 Command name abbreviations are allowed if unambiguous..*$prompt $" {
1448 pass "set print \"pr\" abbreviation"
1449 }
1450 -re ".*$prompt $" { fail "set print \"pr\" abbreviation" }
1451 timeout { fail "(timeout) set print \"pr\" abbreviation" }
1452 }
1453
1454
1455 #test set print
1456 send "set print\n"
1457 expect {
1458 -re "\"set print\" must be followed by the name of a print subcommand..*
1459 List of set print subcommands:.*
1460 Type \"help set print\" followed by set print subcommand name for full documentation..*
1461 Command name abbreviations are allowed if unambiguous..*$prompt $" {
1462 pass "set print"
1463 }
1464 -re ".*$prompt $" { fail "set print" }
1465 timeout { fail "(timeout) set print" }
1466 }
1467
1468
1469 #test set print address
1470 send "set print address\n"
1471 expect {
1472 -re "$prompt $"\
1473 { pass "set print address" }
1474 timeout { fail "(timeout) set print address" }
1475 }
1476
1477
1478 #test set print array
1479 send "set print array\n"
1480 expect {
1481 -re "$prompt $"\
1482 { pass "set print array" }
1483 timeout { fail "(timeout) set print array" }
1484 }
1485
1486
1487 #test set print asm-demangle
1488 send "set print asm-demangle\n"
1489 expect {
1490 -re "$prompt $"\
1491 { pass "set print asm-demangle" }
1492 timeout { fail "(timeout) set print asm-demangle" }
1493 }
1494
1495
1496 #test set print demangle
1497 send "set print demangle\n"
1498 expect {
1499 -re "$prompt $"\
1500 { pass "set print demangle" }
1501 timeout { fail "(timeout) set print demangle" }
1502 }
1503
1504
1505 #test set print elements
1506 send "set print elements\n"
1507 expect {
1508 -re "Argument required .integer to set it to.*$prompt $"\
1509 { pass "set print elements" }
1510 -re ".*$prompt $" { fail "set print elements" }
1511 timeout { fail "(timeout) set print elements" }
1512 }
1513
1514
1515 #test set print object
1516 send "set print object\n"
1517 expect {
1518 -re "$prompt $"\
1519 { pass "set print object" }
1520 timeout { fail "(timeout) set print object" }
1521 }
1522
1523
1524 #test set print pretty
1525 send "set print pretty\n"
1526 expect {
1527 -re "$prompt $"\
1528 { pass "set print pretty" }
1529 timeout { fail "(timeout) set print pretty" }
1530 }
1531
1532
1533 #test set print sevenbit-strings
1534 send "set print sevenbit-strings\n"
1535 expect {
1536 -re "$prompt $"\
1537 { pass "set print sevenbit-strings" }
1538 timeout { fail "(timeout) set print sevenbit-strings" }
1539 }
1540
1541
1542 #test set print union
1543 send "set print union\n"
1544 expect {
1545 -re "$prompt $"\
1546 { pass "set print union" }
1547 timeout { fail "(timeout) set print union" }
1548 }
1549
1550
1551 #test set print vtbl
1552 send "set print vtbl\n"
1553 expect {
1554 -re "$prompt $"\
1555 { pass "set print vtbl" }
1556 timeout { fail "(timeout) set print vtbl" }
1557 }
1558
1559
1560 # FIXME -- need a test for "set prompt"
1561 #test set radix
1562 send "set radix\n"
1563 expect {
1564 -re "Input and output radices now set to decimal 10, hex a, octal 12.*$prompt $"\
1565 { pass "set radix" }
1566 -re "Argument required .integer to set it to.*$prompt $"\
1567 { fail "set radix (obsolete radix support)" }
1568 -re ".*$prompt $" { fail "set radix" }
1569 timeout { fail "(timeout) set radix" }
1570 }
1571
1572
1573 #test set symbol-reloading
1574 send "set symbol-reloading\n"
1575 expect {
1576 -re "$prompt $"\
1577 { pass "set symbol-reloading" }
1578 timeout { fail "(timeout) set symbol-reloading" }
1579 }
1580
1581
1582 #test set variable
1583 send "set variable\n"
1584 expect {
1585 -re "Argument required .expression to compute.*$prompt $"\
1586 { pass "set variable" }
1587 -re ".*$prompt $" { fail "set variable" }
1588 timeout { fail "(timeout) set variable" }
1589 }
1590
1591
1592 #test set verbose
1593 send "set verbose\n"
1594 expect {
1595 -re "$prompt $"\
1596 { pass "set verbose" }
1597 timeout { fail "(timeout) set verbose" }
1598 }
1599
1600
1601 #test set width
1602 send "set width\n"
1603 expect {
1604 -re "Argument required .integer to set it to.*$prompt $"\
1605 { pass "set width" }
1606 -re ".*$prompt $" { fail "set width" }
1607 timeout { fail "(timeout) set width" }
1608 }
1609
1610
1611 #test set write
1612 # This is only supported on targets which use exec.o.
1613 if ![istarget "rs6000-*-*"] then {
1614 send "set write\n"
1615 expect {
1616 -re "set write\[\r\n\]*$prompt $"\
1617 { pass "set write" }
1618 -re "$prompt $" { fail "set write" }
1619 timeout { fail "(timeout) set write" }
1620 }
1621 gdb_test "set write off" ""
1622 }
1623
1624 #test set
1625 send "set\n"
1626 expect {
1627 -re "Argument required .expression to compute.*$prompt $"\
1628 { pass "set" }
1629 -re ".*$prompt $" { fail "set" }
1630 timeout { fail "(timeout) set" }
1631 }
1632
1633
1634 #test shell echo Hi dad!
1635 send "shell echo Hi dad!\n"
1636 expect {
1637 -re "Hi dad!.*$prompt $"\
1638 { pass "shell echo Hi dad!" }
1639 -re ".*$prompt $" { fail "shell echo Hi dad!" }
1640 timeout { fail "(timeout) shell echo Hi dad!" }
1641 }
1642
1643
1644 #test show args
1645 send "show args\n"
1646 expect {
1647 -re "Arguments to give program being debugged when it is started is \"\"..*$prompt $"\
1648 { pass "show args" }
1649 -re ".*$prompt $" { fail "show args" }
1650 timeout { fail "(timeout) show args" }
1651 }
1652
1653
1654 #test show check "c" abbreviation
1655 send "show c\n"
1656 expect {
1657 -re "range: Range checking is \"auto; currently off\"..*
1658 type: Type checking is \"auto; currently off\"..*$prompt $"\
1659 { pass "show check \"c\" abbreviation" }
1660 -re ".*$prompt $" { fail "show check \"c\" abbreviation" }
1661 timeout { fail "(timeout) show check \"c\" abbreviation" }
1662 }
1663
1664
1665 #test show check "ch" abbreviation
1666 send "show ch\n"
1667 expect {
1668 -re "range: Range checking is \"auto; currently off\"..*
1669 type: Type checking is \"auto; currently off\"..*$prompt $"\
1670 { pass "show check \"ch\" abbreviation" }
1671 -re ".*$prompt $" { fail "show check \"ch\" abbreviation" }
1672 timeout { fail "(timeout) show check \"ch\" abbreviation" }
1673 }
1674
1675
1676 #test show check
1677 send "show check\n"
1678 expect {
1679 -re "range: Range checking is \"auto; currently off\"..*
1680 type: Type checking is \"auto; currently off\"..*$prompt $"\
1681 { pass "show check" }
1682 -re ".*$prompt $" { fail "show check" }
1683 timeout { fail "(timeout) show check" }
1684 }
1685
1686
1687 #test show check range
1688 send "show check range\n"
1689 expect {
1690 -re "Range checking is \"auto; currently off\"..*$prompt $"\
1691 { pass "show check range" }
1692 -re ".*$prompt $" { fail "show check range" }
1693 timeout { fail "(timeout) show check range" }
1694 }
1695
1696
1697 #test show check type
1698 send "show check type\n"
1699 expect {
1700 -re "Type checking is \"auto; currently off\"..*$prompt $"\
1701 { pass "show check type" }
1702 -re ".*$prompt $" { fail "show check type" }
1703 timeout { fail "(timeout) show check type" }
1704 }
1705
1706
1707 #test show commands
1708 send "show commands\n"
1709 expect {
1710 -re "$prompt $"\
1711 { pass "show commands" }
1712 timeout { fail "(timeout) show commands" }
1713 }
1714
1715
1716 #test show complaints
1717 send "show complaints\n"
1718 expect {
1719 -re "Max number of complaints about incorrect symbols is 0..*$prompt $"\
1720 { pass "show complaints" }
1721 -re ".*$prompt $" { fail "show complaints" }
1722 timeout { fail "(timeout) show complaints" }
1723 }
1724
1725
1726 #test show confirm
1727 send "show confirm\n"
1728 expect {
1729 -re "Whether to confirm potentially dangerous operations is on..*$prompt $"\
1730 { pass "show confirm" }
1731 -re ".*$prompt $" { fail "show confirm" }
1732 timeout { fail "(timeout) show confirm" }
1733 }
1734
1735
1736 #test show convenience
1737 send "show convenience\n"
1738 expect {
1739 -re "No debugger convenience variables now defined..*
1740 Convenience variables have names starting with \".\";.*
1741 use \"set\" as in \"set .foo = 5\" to define them..*$prompt $"\
1742 { pass "show convenience" }
1743 -re ".*$prompt $" { fail "show convenience" }
1744 timeout { fail "(timeout) show convenience" }
1745 }
1746
1747
1748 #test show directories
1749 send "show directories\n"
1750 expect {
1751 -re "Source directories searched: .cdir:.cwd.*$prompt $"\
1752 { pass "show directories" }
1753 -re ".*$prompt $" { fail "show directories" }
1754 timeout { fail "(timeout) show directories" }
1755 }
1756
1757
1758 #test show editing
1759 send "show editing\n"
1760 expect {
1761 -re "Editing of command lines as they are typed is on..*$prompt $"\
1762 { pass "show editing" }
1763 -re ".*$prompt $" { fail "show editing" }
1764 timeout { fail "(timeout) show editing" }
1765 }
1766
1767
1768 #test show height
1769 send "show height\n"
1770 expect {
1771 -re "Number of lines gdb thinks are in a page is.*$prompt $"\
1772 { pass "show height" }
1773 -re ".*$prompt $" { fail "show height" }
1774 timeout { fail "(timeout) show height" }
1775 }
1776
1777
1778 #test show history expansion
1779 send "show history expansion\n"
1780 expect {
1781 -re "History expansion on command input is on.*$prompt $"\
1782 { pass "show history expansion" }
1783 -re ".*$prompt $" { fail "show history expansion" }
1784 timeout { fail "(timeout) show history expansion" }
1785 }
1786
1787
1788 #test show history filename
1789 send "show history filename\n"
1790 expect {
1791 -re "The filename in which to record the command history is.*.gdb_history.*$prompt $" { pass "show history filename" }
1792 -re ".*$prompt $" { fail "show history filename" }
1793 timeout { fail "(timeout) show history filename" }
1794 }
1795
1796
1797 #test show history save
1798 send "show history save\n"
1799 expect {
1800 -re "Saving of the history record on exit is on..*$prompt $" {
1801 pass "show history save"
1802 }
1803 -re ".*$prompt $" { fail "show history save" }
1804 timeout { fail "(timeout) show history save" }
1805 }
1806
1807
1808 #test show history size
1809 send "show history size\n"
1810 expect {
1811 -re "The size of the command history is.*$prompt $"\
1812 { pass "show history size" }
1813 -re ".*$prompt $" { fail "show history size" }
1814 timeout { fail "(timeout) show history size" }
1815 }
1816
1817
1818 #test show history
1819 send "show history\n"
1820 expect {
1821 -re "filename: The filename in which to record the command history is.*.gdb_history.*
1822 size: The size of the command history is.*
1823 save: Saving of the history record on exit is o.*
1824 expansion: History expansion on command input is o.*$prompt $"
1825 { pass "show history" }
1826 -re ".*$prompt $" { fail "show history" }
1827 timeout { fail "(timeout) show history" }
1828 }
1829
1830
1831 #test show language
1832 send "show language\n"
1833 expect {
1834 -re "The current source language is \"auto; currently c\"..*$prompt $"\
1835 { pass "show language" }
1836 -re ".*$prompt $" { fail "show language" }
1837 timeout { fail "(timeout) show language" }
1838 }
1839
1840
1841 #test show listsize
1842 send "show listsize\n"
1843 expect {
1844 -re "Number of source lines gdb will list by default is 10..*$prompt $"\
1845 { pass "show listsize" }
1846 -re ".*$prompt $" { fail "show listsize" }
1847 timeout { fail "(timeout) show listsize" }
1848 }
1849
1850
1851 #test show print "p" abbreviation
1852 send "show p\n"
1853 expect {
1854 -re ".*$prompt $"\
1855 { pass "show print \"p\" abbreviation" }
1856 timeout { fail "(timeout) show print \"p\" abbreviation" }
1857 }
1858
1859
1860 #test show print "pr" abbreviation
1861 send "show pr\n"
1862 expect {
1863 -re ".*$prompt $"\
1864 { pass "show print \"pr\" abbreviation" }
1865 timeout { fail "(timeout) show print \"pr\" abbreviation" }
1866 }
1867
1868
1869
1870 #test show print
1871 send "show print\n"
1872 expect {
1873 -re ".*$prompt $"\
1874 { pass "show print" }
1875 timeout { fail "(timeout) show print" }
1876 }
1877
1878
1879 #test show paths
1880 send "show paths\n"
1881 expect {
1882 -re "Executable and object file path:.*$prompt $"\
1883 { pass "show paths" }
1884 -re ".*$prompt $" { fail "show paths" }
1885 timeout { fail "(timeout) show paths" }
1886 }
1887
1888
1889 #test show print address
1890 send "show print address\n"
1891 expect {
1892 -re "Printing of addresses is on..*$prompt $"\
1893 { pass "show print address" }
1894 -re ".*$prompt $" { fail "show print address" }
1895 timeout { fail "(timeout) show print address" }
1896 }
1897
1898
1899 #test show print array
1900 send "show print array\n"
1901 expect {
1902 -re "Prettyprinting of arrays is on..*$prompt $"\
1903 { pass "show print array" }
1904 -re ".*$prompt $" { fail "show print array" }
1905 timeout { fail "(timeout) show print array" }
1906 }
1907
1908
1909 #test show print asm-demangle
1910 send "show print asm-demangle\n"
1911 expect {
1912 -re "Demangling of C\[+\]+ names in disassembly listings is on..*$prompt $"\
1913 { pass "show print asm-demangle" }
1914 -re ".*$prompt $" { fail "show print asm-demangle" }
1915 timeout { fail "(timeout) show print asm-demangle" }
1916 }
1917
1918
1919 #test show print demangle
1920 send "show print demangle\n"
1921 expect {
1922 -re "Demangling of encoded C\[+\]+ names when displaying symbols is on..*$prompt $"\
1923 { pass "show print demangle" }
1924 -re ".*$prompt $" { fail "show print demangle" }
1925 timeout { fail "(timeout) show print demangle" }
1926 }
1927
1928
1929 #test show print elements
1930 send "show print elements\n"
1931 expect {
1932 -re "Limit on string chars or array elements to print is 200..*$prompt $"\
1933 { pass "show print elements" }
1934 -re ".*$prompt $" { fail "show print elements" }
1935 timeout { fail "(timeout) show print elements" }
1936 }
1937
1938
1939 #test show print object
1940 send "show print object\n"
1941 expect {
1942 -re "Printing of object's derived type based on vtable info is on..*$prompt $"\
1943 { pass "show print object" }
1944 -re ".*$prompt $" { fail "show print object" }
1945 timeout { fail "(timeout) show print object" }
1946 }
1947
1948
1949 #test show print pretty
1950 send "show print pretty\n"
1951 expect {
1952 -re "Prettyprinting of structures is on..*$prompt $"\
1953 { pass "show print pretty" }
1954 -re ".*$prompt $" { fail "show print pretty" }
1955 timeout { fail "(timeout) show print pretty" }
1956 }
1957
1958
1959 #test show print sevenbit-strings
1960 send "show print sevenbit-strings\n"
1961 expect {
1962 -re "Printing of 8-bit characters in strings as .nnn is on..*$prompt $"\
1963 { pass "show print sevenbit-strings" }
1964 -re ".*$prompt $" { fail "show print sevenbit-strings" }
1965 timeout { fail "(timeout) show print sevenbit-strings" }
1966 }
1967
1968
1969 #test show print union
1970 send "show print union\n"
1971 expect {
1972 -re "Printing of unions interior to structures is on..*$prompt $"\
1973 { pass "show print union" }
1974 -re ".*$prompt $" { fail "show print union" }
1975 timeout { fail "(timeout) show print union" }
1976 }
1977
1978
1979 #test show print vtbl
1980 send "show print vtbl\n"
1981 expect {
1982 -re "Printing of C\[+\]+ virtual function tables is on..*$prompt $"\
1983 { pass "show print vtbl" }
1984 -re ".*$prompt $" { fail "show print vtbl" }
1985 timeout { fail "(timeout) show print vtbl" }
1986 }
1987
1988
1989 #test show prompt
1990 # In the FAIL case, can't just look for $prompt because that will match
1991 # the output, rather than the prompt. So look for $prompt at the start
1992 # of a line.
1993 send "show prompt\n"
1994 expect {
1995 -re "Gdb's prompt is \"$prompt \".*$prompt $"\
1996 { pass "show prompt" }
1997 -re ".*\r\n$prompt $" { fail "show prompt" }
1998 timeout { fail "(timeout) show prompt" }
1999 }
2000
2001
2002 #test show radix
2003 send "show radix\n"
2004 expect {
2005 -re "Input and output radices set to decimal 10, hex a, octal 12..*$prompt $"\
2006 { pass "show radix" }
2007 -re "Default input and output number radix is 10..*$prompt $"\
2008 { fail "show radix (obsolete radix support)" }
2009 -re ".*$prompt $" { fail "show radix" }
2010 timeout { fail "(timeout) show radix" }
2011 }
2012
2013
2014 #test show symbol-reloading
2015 send "show symbol-reloading\n"
2016 expect {
2017 -re "Dynamic symbol table reloading multiple times in one run is on..*$prompt $"\
2018 { pass "show symbol-reloading" }
2019 -re ".*$prompt $" { fail "show symbol-reloading" }
2020 timeout { fail "(timeout) show symbol-reloading" }
2021 }
2022
2023
2024 #test show user
2025 send "show user\n"
2026 expect {
2027 -re "$prompt $"\
2028 { pass "show user" }
2029 timeout { fail "(timeout) show user" }
2030 }
2031
2032
2033 #test show values
2034 send "show values\n"
2035 expect {
2036 -re "$prompt $"\
2037 { pass "show values" }
2038 timeout { fail "(timeout) show values" }
2039 }
2040
2041
2042 #test show verbose
2043 send "show verbose\n"
2044 expect {
2045 -re "Verbose printing of informational messages is on..*$prompt $"\
2046 { pass "show verbose" }
2047 -re ".*$prompt $" { fail "show verbose" }
2048 timeout { fail "(timeout) show verbose" }
2049 }
2050
2051
2052 #test show version
2053 send "show version\n"
2054 expect {
2055 -re "GDB is free software and you are welcome to distribute copies of it.*
2056 under certain conditions; type \"show copying\" to see the conditions..*
2057 There is absolutely no warranty for GDB; type \"show warranty\" for details..*
2058 GDB.*Copyright \[0-9\]* Free Software Foundation, Inc..*$prompt $"\
2059 { pass "show version" }
2060 -re ".*$prompt $" { fail "show version" }
2061 timeout { fail "(timeout) show version" }
2062 }
2063
2064
2065 #test show width
2066 send "show width\n"
2067 expect {
2068 -re "Number of characters gdb thinks are in a line is.*$prompt $"\
2069 { pass "show width" }
2070 -re ".*$prompt $" { fail "show width" }
2071 timeout { fail "(timeout) show width" }
2072 }
2073
2074
2075 #test show write
2076 # This is only supported on targets which use exec.o.
2077 if ![istarget "rs6000-*-*"] then {
2078 send "show write\n"
2079 expect {
2080 -re "Writing into executable and core files is off..*$prompt $"\
2081 { pass "show write" }
2082 -re ".*$prompt $" { fail "show write" }
2083 timeout { fail "(timeout) show write" }
2084 }
2085 }
2086
2087 #test show
2088 send "show\n"
2089 expect {
2090 -re "confirm: Whether to confirm potentially dangerous operations is on..*
2091 history filename: The filename in which to record the command history is .*
2092 history size: The size of the command history is.*
2093 history save: Saving of the history record on exit is on..*
2094 print elements: Limit on string chars or array elements to print is 200..*
2095 listsize: Number of source lines gdb will list by default is 10.*$prompt $"\
2096 { pass "show" }
2097 -re "\n$prompt $" { fail "show" }
2098 timeout { fail "(timeout) show" }
2099 }
2100
2101
2102 #test stepi "si" abbreviation
2103 setup_xfail "a29k-*-udi"
2104 send "si\n"
2105 expect {
2106 -re "The program is not being run..*$prompt $"\
2107 { pass "stepi \"si\" abbreviation" }
2108 -re ".*$prompt $" { fail "stepi \"si\" abbreviation" }
2109 timeout { fail "(timeout) stepi \"si\" abbreviation" }
2110 }
2111
2112
2113 #test stepi
2114 setup_xfail "a29k-*-udi"
2115 send "stepi\n"
2116 expect {
2117 -re "The program is not being run..*$prompt $"\
2118 { pass "stepi" }
2119 -re ".*$prompt $" { fail "stepi" }
2120 timeout { fail "(timeout) stepi" }
2121 }
2122
2123
2124 #test signal
2125 setup_xfail "a29k-*-udi"
2126 send "signal\n"
2127 expect {
2128 -re "The program is not being run..*$prompt $"\
2129 { pass "signal" }
2130 -re ".*$prompt $" { fail "signal" }
2131 timeout { fail "(timeout) signal" }
2132 }
2133
2134
2135 #test source
2136 send "source\n"
2137 expect {
2138 -re "source command requires pathname of file to source..*$prompt"
2139 { pass "source" }
2140 -re "No such file or directory.*$prompt $" { pass "source" }
2141 -re ".*$prompt $" { fail "source" }
2142 timeout { fail "(timeout) source" }
2143 }
2144
2145 #test step "s" abbreviation
2146 setup_xfail "a29k-*-udi"
2147 send "s\n"
2148 expect {
2149 -re "The program is not being run..*$prompt $"\
2150 { pass "step \"s\" abbreviation" }
2151 -re ".*$prompt $" { fail "step \"s\" abbreviation" }
2152 timeout { fail "(timeout) step \"s\" abbreviation" }
2153 }
2154
2155
2156 #test step
2157 setup_xfail "a29k-*-udi"
2158 send "step\n"
2159 expect {
2160 -re "The program is not being run..*$prompt $"\
2161 { pass "step" }
2162 -re ".*$prompt $" { fail "step" }
2163 timeout { fail "(timeout) step" }
2164 }
2165
2166
2167 #test symbol-file
2168 send "symbol-file\n"
2169 expect {
2170 -re "$prompt $"\
2171 { pass "symbol-file" }
2172 timeout { fail "(timeout) symbol-file" }
2173 }
2174
2175
2176 #test target child
2177 send "target child\n"
2178 expect {
2179 -re "Use the \"run\" command to start a Unix child process..*$prompt $"\
2180 { pass "target child (non-procfs version)" }
2181 -re "Undefined target command: \"child\". Try \"help target\"..*$prompt $"\
2182 { pass "target child (procfs version)" }
2183
2184 -re ".*$prompt $" { fail "target child" }
2185 timeout { fail "(timeout) target child" }
2186 }
2187
2188
2189 #test target procfs
2190 send "target procfs\n"
2191 expect {
2192 -re "Use the \"run\" command to start a Unix child process..*$prompt $"\
2193 { pass "target procfs (procfs version)" }
2194 -re "Undefined target command: \"procfs\". Try \"help target\"..*$prompt $"\
2195 { pass "target procfs (non-procfs version)" }
2196
2197 -re ".*$prompt $" { fail "target procfs" }
2198 timeout { fail "(timeout) target procfs" }
2199 }
2200
2201
2202 #test target core
2203 send "target core\n"
2204 expect {
2205 -re "No core file specified..*$prompt $"\
2206 { pass "target core" }
2207 -re ".*A program is being debugged already. Kill it. .y or n.*$" {
2208 send "n\n"
2209 if $verbose>1 then {
2210 send_user "\t\tDidn't kill program being debugged\n"
2211 }
2212 expect -re "$prompt $" { }
2213 pass "target core"
2214 }
2215 -re "Undefined target command: \"core\". Try \"help target\"..*$prompt $"\
2216 { pass "target core" }
2217 -re ".*$prompt $" { fail "target core" }
2218 timeout { fail "(timeout) target core" }
2219 }
2220
2221
2222 #test target exec
2223 send "target exec\n"
2224 expect {
2225 -re "No exec file now..*$prompt $"\
2226 { pass "target exec" }
2227 -re ".*A program is being debugged already. Kill it. .y or n.*$" {
2228 send "n\n"
2229 if $verbose>1 then {
2230 send_user "\t\tDidn't kill program being debugged\n"
2231 }
2232 expect -re "$prompt $" { }
2233 pass "target exec"
2234 }
2235 -re ".*$prompt $" { fail "target exec" }
2236 timeout { fail "(timeout) target exec" }
2237 }
2238
2239
2240 #test target remote
2241 if ![istarget "*-*-udi*"] then {
2242 send "target remote\n"
2243 expect {
2244 -re "To open a remote debug connection, you need to specify what serial.*
2245 device is attached to the remote system .e.g. /dev/ttya.*$prompt $"\
2246 { pass "target remote" }
2247 -re ".*A program is being debugged already. Kill it. .y or n.*$" {
2248 send "n\n"
2249 if $verbose>1 then {
2250 send_user "\t\tDidn't kill program being debugged\n"
2251 }
2252 expect -re "$prompt $" { }
2253 pass "target remote"
2254 }
2255 -re ".*$prompt $" { fail "target remote" }
2256 timeout { fail "(timeout) target remote" }
2257 }
2258 }
2259
2260 #test target
2261 send "target\n"
2262 expect {
2263 -re "Argument required .target name.*$prompt $"\
2264 { pass "target" }
2265 -re ".*$prompt $" { fail "target" }
2266 timeout { fail "(timeout) target" }
2267 }
2268
2269
2270 #test tbreak
2271 send "tbreak\n"
2272 expect {
2273 -re "No default breakpoint address now..*$prompt $"\
2274 { pass "tbreak" }
2275 -re ".*$prompt $" { fail "tbreak" }
2276 timeout { fail "(timeout) tbreak" }
2277 }
2278
2279
2280 #test tty
2281 send "tty\n"
2282 expect {
2283 -re "Argument required .terminal name for running target process.*$prompt $"\
2284 { pass "tty" }
2285 -re ".*$prompt $" { fail "tty" }
2286 timeout { fail "(timeout) tty" }
2287 }
2288
2289
2290 #test until "u" abbreviation
2291 setup_xfail "a29k-*-udi"
2292 send "u\n"
2293 expect {
2294 -re "The program is not running..*$prompt $"\
2295 { pass "until \"u\" abbreviation" }
2296 -re ".*$prompt $" { fail "until \"u\" abbreviation" }
2297 timeout { fail "(timeout) until \"u\" abbreviation" }
2298 }
2299
2300
2301 #test until
2302 setup_xfail "a29k-*-udi"
2303 send "until\n"
2304 expect {
2305 -re "The program is not running..*$prompt $"\
2306 { pass "until" }
2307 -re ".*$prompt $" { fail "until" }
2308 timeout { fail "(timeout) until" }
2309 }
2310
2311
2312 #test undisplay
2313 # FIXME -- need to dump full output to detailed log
2314 send "undisplay\n"
2315 expect {
2316 -re "Delete all auto-display expressions.*y or n. $"\
2317 { send "y\n"
2318 expect {
2319 -re "$prompt $"\
2320 { pass "undisplay prompt" }
2321 timeout { fail "(timeout) (timeout) undisplay prompt" }
2322 }
2323 }
2324 timeout { fail "(timeout) (timeout) undisplay prompt" }
2325 }
2326
2327
2328 #test unset environment
2329 send "unset environment\n"
2330 expect {
2331 -re "Delete all environment variables?.*y or n. $"\
2332 { send "y\n"
2333 expect {
2334 -re "$prompt $"\
2335 { pass "unset environmentprompt" }
2336 timeout { fail "(timeout) (timeout) unset environment prompt" }
2337 }
2338 }
2339 timeout { fail "(timeout) (timeout) unset environment prompt" }
2340 }
2341
2342
2343
2344 #test unset
2345 send "unset\n"
2346 expect {
2347 -re "\"unset\" must be followed by the name of an unset subcommand..*
2348 List of unset subcommands:.*
2349 unset environment -- Cancel environment variable VAR for the program.*
2350 Type \"help unset\" followed by unset subcommand name for full documentation..*
2351 Command name abbreviations are allowed if unambiguous..*$prompt $"\
2352 { pass "unset" }
2353 -re ".*$prompt $" { fail "unset" }
2354 timeout { fail "(timeout) unset" }
2355 }
2356
2357
2358 #test up
2359 gdb_test "up" "No stack\\." "up in default.exp"
2360
2361 #test up-silently
2362 send "up-silently\n"
2363 expect {
2364 -re "No stack..*$prompt $"\
2365 { pass "up-silently" }
2366 -re ".*$prompt $" { fail "up-silently" }
2367 timeout { fail "(timeout) up-silently" }
2368 }
2369
2370
2371 #test watch
2372 send "watch\n"
2373 expect {
2374 -re "Argument required .expression to compute.*$prompt $"\
2375 { pass "watch" }
2376 -re ".*$prompt $" { fail "watch" }
2377 timeout { fail "(timeout) watch" }
2378 }
2379
2380
2381 #test whatis
2382 send "whatis\n"
2383 expect {
2384 -re "The history is empty..*$prompt $"\
2385 { pass "whatis" }
2386 -re ".*$prompt $" { fail "whatis" }
2387 timeout { fail "(timeout) whatis" }
2388 }
2389
2390
2391 #test where
2392 setup_xfail "a29k-*-udi"
2393 send "where\n"
2394 expect {
2395 -re "No stack..*$prompt $"\
2396 { pass "where" }
2397 -re ".*$prompt $" { fail "where" }
2398 timeout { fail "(timeout) where" }
2399 }
2400
2401
2402 #test x
2403 #The case in which it prints a number is for vxgdb.
2404 send "x\n"
2405 expect {
2406 -re "0x0:.*Cannot access memory at address 0x0..*$prompt $"\
2407 { pass "x" }
2408 -re "0x0:.*0x\[0-9\]*.*$prompt $"\
2409 { pass "x" }
2410 -re ".*$prompt $" { fail "x" }
2411 timeout { fail "(timeout) x" }
2412 }
2413
This page took 0.083888 seconds and 5 git commands to generate.