1 # Start with a fresh gdb
7 # test default actions of gdb commands
12 gdb_test "add-symbol-file" "add-symbol-file takes a file name and an address"
14 setup_xfail "mips-idt-*"
17 -re "Argument required .(process-id|program) to attach.*$prompt $"\
19 -re "You can't do that when your target is `None'.*$prompt $"\
21 -re "Don't know how to attach. Try \"help target\"..*$prompt $"\
23 -re "Kill it. .y or n." {
27 -re "$prompt $" { fail "attach" }
28 timeout { fail "(timeout) attach" }
31 # FIXME: attach kills the udi connection
32 if [istarget "a29k-*-udi"] then {
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"
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"
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"
57 # FIXME: continue kills the udi connection
58 if [istarget "a29k-*-udi"] then {
66 -re "The history is empty..*$prompt $"\
68 -re ".*$prompt $" { fail "call" }
69 timeout { fail "(timeout) call" }
76 -re "No selected frame..*$prompt $"\
78 -re ".*$prompt $" { fail "catch" }
79 timeout { fail "(timeout) catch" }
86 -re "Argument required .new working directory.*$prompt $"\
88 -re ".*$prompt $" { fail "cd" }
89 timeout { fail "(timeout) cd" }
96 -re "No source file specified..*$prompt $"\
98 -re ".*$prompt $" { fail "clear" }
99 timeout { fail "(timeout) clear" }
106 -re "No breakpoint number 0..*$prompt $"\
108 -re ".*$prompt $" { fail "commands" }
109 timeout { fail "(timeout) commands" }
116 -re "Argument required .breakpoint number.*$prompt $"\
118 -re ".*$prompt $" { fail "condition" }
119 timeout { fail "(timeout) condition" }
126 -re "No core file now..*$prompt $"\
128 -re "GDB can't read core files on this machine..*$prompt $"\
130 -re ".*$prompt $" { fail "core-file" }
131 timeout { fail "(timeout) core-file" }
135 #test delete "d" abbreviation
139 { pass "delete \"d\" abbreviation" }
140 timeout { fail "(timeout) delete \"d\" abbreviation" }
149 timeout { fail "(timeout) delete" }
156 -re "Argument required \[(\]name of command to define\[)\]..*$prompt $"\
158 timeout { fail "(timeout) define" }
162 #test delete breakpoints
163 send "delete breakpoints\n"
166 { pass "delete breakpoints" }
167 timeout { fail "(timeout) delete breakpoints" }
172 # FIXME -- need to dump full output to detailed log
173 send "delete display\n"
175 -re "delete display.*Delete all auto-display expressions.*y or n. $"\
179 { pass "delete display prompt" }
180 timeout { fail "(timeout) delete display prompt" }
183 timeout { fail "(timeout) delete display prompt" }
194 # timeout { fail "(timeout) detach" }
197 # FIXME: continue kills the udi connection
198 if [istarget "a29k-*-udi"] then {
202 if [istarget "h8300-*-hms"] then {
208 # FIXME -- need to dump full output to detailed log
211 -re "Reinitialize source path to empty.*y or n. $"\
214 -re "Source directories searched: .cdir:.cwd.*$prompt $"\
215 { pass "directory prompt" }
216 timeout { fail "(timeout) directory prompt" }
222 #test disable "dis" abbreviation
226 { pass "disable \"dis\" abbreviation" }
227 timeout { fail "(timeout) disable \"dis\" abbreviation" }
231 #test disable "disa" abbreviation
235 { pass "disable \"disa\" abbreviation" }
236 timeout { fail "(timeout) disable \"disa\" abbreviation" }
245 timeout { fail "(timeout) disable" }
249 #test disable breakpoints
250 send "disable breakpoints\n"
253 { pass "disable breakpoints" }
254 timeout { fail "(timeout) disable breakpoints" }
258 #test disable display
259 send "disable display\n"
262 { pass "disable display" }
263 timeout { fail "(timeout) disable display" }
270 -re "No frame selected..*$prompt $"\
271 { pass "disassemble" }
272 -re ".*$prompt $" { fail "disassemble" }
273 timeout { fail "(timeout) disassemble" }
282 timeout { fail "(timeout) display" }
289 -re "No stack..*$prompt $"\
291 -re ".*$prompt $" { fail "do" }
292 timeout { fail "(timeout) do" }
299 -re "Argument required .name of command to define.*$prompt $"\
301 -re ".*$prompt $" { fail "document" }
302 timeout { fail "(timeout) document" }
309 -re "No stack.*$prompt $"\
311 -re ".*$prompt $" { fail "down" }
312 timeout { fail "(timeout) down" }
317 send "down-silently\n"
319 -re "No stack..*$prompt $"\
320 { pass "down-silently" }
321 -re ".*$prompt $" { fail "down-silently" }
322 timeout { fail "(timeout) down-silently" }
331 timeout { fail "(timeout) echo" }
335 #test enable breakpoints delete
336 send "enable breakpoints delete\n"
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" }
345 #test enable breakpoints once
346 send "enable breakpoints once\n"
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" }
355 #test enable breakpoints
356 send "enable breakpoints\n"
359 { pass "enable breakpoints" }
360 timeout { fail "(timeout) enable breakpoints" }
365 send "enable delete\n"
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" }
375 send "enable display\n"
378 { pass "enable display" }
379 timeout { fail "(timeout) enable display" }
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" }
398 timeout { fail "(timeout) enable" }
405 -re "No exec file now..*$prompt $" {
408 -re "exec-file.*A program is being debugged already. Kill it. .y or n.*$" {
411 send_user "\tDidn't kill program being debugged\n"
413 expect -re "$prompt $" { }
416 -re "$prompt $" { fail "exec-file" }
417 timeout { fail "(timeout) exec-file" }
421 #test frame "f" abbreviation
422 setup_xfail "a29k-*-udi"
425 -re "No stack..*$prompt $"\
426 { pass "frame \"f\" abbreviation" }
427 -re ".*$prompt $" { fail "frame \"f\" abbreviation" }
428 timeout { fail "(timeout) frame \"f\" abbreviation" }
433 setup_xfail "a29k-*-udi"
436 -re "No stack..*$prompt $"\
438 -re ".*$prompt $" { fail "frame" }
439 timeout { fail "(timeout) frame" }
444 setup_xfail "a29k-*-udi"
447 -re "The program is not being run..*$prompt $"\
449 -re ".*$prompt $" { fail "fg" }
450 timeout { fail "(timeout) fg" }
453 # FIXME: fg kills the udi connection
454 if [istarget "a29k-*-udi"] then {
462 -re "No exec file now..*$prompt $"\
464 -re ".*A program is being debugged already. Kill it. .y or n.*$" {
467 send_user "\t\tDidn't kill program being debugged\n"
469 expect -re "$prompt $" { }
472 -re ".*$prompt $" { fail "file" }
473 timeout { fail "(timeout) file" }
478 setup_xfail "a29k-*-udi"
481 -re "The program is not running..*$prompt $"\
483 -re ".*$prompt $" { fail "finish" }
484 timeout { fail "(timeout) finish" }
489 # The message here comes from the regexp library, not gdb, and so can
490 # vary on different systems.
491 send "forward-search\n"
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" }
502 #test help "h" abbreviation
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" }
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 $"\
543 -re ".*$prompt $" { fail "help" }
544 timeout { fail "(timeout) help" }
551 -re "Argument required .signal to handle.*$prompt $"\
553 -re ".*$prompt $" { fail "handle" }
554 timeout { fail "(timeout) handle" }
558 #test info "i" abbreviation
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" }
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 $"\
579 -re ".*$prompt $" { fail "info" }
580 timeout { fail "(timeout) info" }
587 -re "Argument required .a breakpoint number.*$prompt $"\
589 -re ".*$prompt $" { fail "ignore" }
590 timeout { fail "(timeout) ignore" }
595 send "info address\n"
597 -re "Argument required..*$prompt $"\
598 { pass "info address" }
599 -re ".*$prompt $" { fail "info address" }
600 timeout { fail "(timeout) info address" }
604 #test info all-registers
605 setup_xfail "a29k-*-udi"
606 send "info all-registers\n"
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" }
618 -re "No frame selected..*$prompt $"\
620 -re ".*$prompt $" { fail "info args" }
621 timeout { fail "(timeout) info args" }
625 #test info bogus-gdb-command
626 send "info bogus-gdb-command\n"
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" }
635 #test info breakpoints
636 send "info breakpoints\n"
638 -re "No breakpoints or watchpoints..*$prompt $"\
639 { pass "info breakpoints" }
640 -re ".*$prompt $" { fail "info breakpoints" }
641 timeout { fail "(timeout) info breakpoints" }
648 -re "No frame selected..*$prompt $"\
649 { pass "info catch" }
650 -re ".*$prompt $" { fail "info catch" }
651 timeout { fail "(timeout) info catch" }
656 # FIXME -- doesn't work worth a shit
657 #send "info copying\n"
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" }
669 send "info display\n"
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" }
678 #test info frame "f" abbreviation
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" }
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" }
706 { pass "info files" }
707 timeout { fail "(timeout) info files" }
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" }
722 send "info functions\n"
724 -re "All defined functions:.*$prompt $"\
725 { pass "info functions" }
726 -re ".*$prompt $" { fail "info functions" }
727 timeout { fail "(timeout) info functions" }
730 gdb_test "info line" "No line number information.*" "info line"
735 -re "No frame selected..*$prompt $"\
736 { pass "info locals" }
737 -re ".*$prompt $" { fail "info locals" }
738 timeout { fail "(timeout) info locals" }
743 setup_xfail "a29k-*-udi"
744 send "info program\n"
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" }
754 setup_xfail "a29k-*-udi"
755 send "info registers\n"
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" }
764 #test info stack "s" abbreviation
765 setup_xfail "a29k-*-udi"
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" }
776 setup_xfail "a29k-*-udi"
779 -re "No stack..*$prompt $"\
780 { pass "info stack" }
781 -re ".*$prompt $" { fail "info stack" }
782 timeout { fail "(timeout) info stack" }
787 # FIXME -- needs to match the entire output
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 $"\
794 -re "\n$prompt $" { fail "info set" }
795 timeout { fail "(timeout) info set" }
802 -re "No current source file..*$prompt $"\
803 { pass "info source" }
804 -re ".*$prompt $" { fail "info source" }
805 timeout { fail "(timeout) info source" }
810 send "info sources\n"
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" }
823 { pass "info target" }
824 timeout { fail "(timeout) info target" }
829 send "info terminal\n"
831 -re "No saved terminal information..*$prompt $"\
832 { pass "info terminal" }
833 -re ".*$prompt $" { fail "info terminal" }
834 timeout { fail "(timeout) info terminal" }
841 -re "All defined types:.*$prompt $"\
842 { pass "info types" }
843 -re ".*$prompt $" { fail "info types" }
844 timeout { fail "(timeout) info types" }
849 send "info variables\n"
851 -re "All defined variables:.*$prompt $"\
852 { pass "info variables" }
853 -re ".*$prompt $" { fail "info variables" }
854 timeout { fail "(timeout) info variables" }
859 send "info warranty\n"
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" }
886 #test info watchpoints
887 send "info watchpoints\n"
889 -re "No breakpoints or watchpoints..*$prompt $"\
890 { pass "info watchpoints" }
891 -re ".*$prompt $" { fail "info watchpoints" }
892 timeout { fail "(timeout) info watchpoints" }
899 -re "The history is empty..*$prompt $"\
901 -re ".*$prompt $" { fail "inspect" }
902 timeout { fail "(timeout) inspect" }
907 setup_xfail "a29k-*-udi"
910 -re "The program is not being run..*$prompt $"\
912 -re ".*$prompt $" { fail "jump" }
913 timeout { fail "(timeout) jump" }
920 -re "The program is not being run..*$prompt $"\
922 -re ".*$prompt $" { fail "kill" }
923 timeout { fail "(timeout) kill" }
927 #test list "l" abbreviation
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" }
940 -re "No symbol table is loaded. Use the \"file\" command..*$prompt $"\
942 -re ".*$prompt $" { fail "list" }
943 timeout { fail "(timeout) list" }
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.
953 -re "You can't do that when your target is `None'.*$prompt $"\
955 -re "The load command takes a file name.*$prompt $"\
957 -re "Must specify at least a file name with the load command.*$prompt $"\
959 -re "Use the .file. or .exec-file. command.*$prompt $"\
961 -re ".*$prompt $" { fail "load" }
962 timeout { fail "(timeout) load" }
966 #test next "n" abbreviation
967 setup_xfail "a29k-*-udi"
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" }
978 setup_xfail "a29k-*-udi"
981 -re "The program is not being run..*$prompt $"\
983 -re ".*$prompt $" { fail "next" }
984 timeout { fail "(timeout) next" }
988 #test nexti "ni" abbreviation
989 setup_xfail "a29k-*-udi"
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" }
1000 setup_xfail "a29k-*-udi"
1003 -re "The program is not being run..*$prompt $"\
1005 -re ".*$prompt $" { fail "nexti" }
1006 timeout { fail "(timeout) nexti" }
1013 -re "Argument required .expression to compute.*$prompt $"\
1015 -re ".*$prompt $" { fail "output" }
1016 timeout { fail "(timeout) output" }
1020 #test print "p" abbreviation
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" }
1033 -re "The history is empty..*$prompt $"\
1035 -re ".*$prompt $" { fail "print" }
1036 timeout { fail "(timeout) print" }
1043 -re "Argument required .format-control string and values to print.*$prompt $"\
1045 -re ".*$prompt $" { fail "printf" }
1046 timeout { fail "(timeout) printf" }
1050 # this command was removed from GDB 4.5.8
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" }
1063 -re "The history is empty..*$prompt $"\
1065 -re ".*$prompt $" { fail "ptype" }
1066 timeout { fail "(timeout) ptype" }
1073 -re "Working directory .*$prompt $"\
1075 -re ".*$prompt $" { fail "pwd" }
1076 timeout { fail "(timeout) pwd" }
1080 #test run "r" abbreviation
1081 if [istarget "*-*-vxworks"] then {
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 $" {}
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" }
1110 if [istarget "*-*-vxworks"] then {
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 $" {}
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 $"\
1125 -re "Starting program: .*
1126 No image loaded into target.*$prompt $"\
1128 -re "Don't know how to run. Try \"help target\"..*$prompt $"\
1130 -re ".*$prompt $" { fail "run" }
1131 timeout { fail "(timeout) run" }
1140 timeout { fail "(timeout) rbreak" }
1145 # The middle case accommodates the a29k, where doing the "ni" above causes
1146 # an initial stack to be created.
1149 -re "No selected frame..*$prompt $"\
1151 -re "Make .* return now.*y or n. $" {
1155 -re ".*$prompt $" { fail "return" }
1156 timeout { fail "(timeout) return" }
1160 #test reverse-search
1161 send "reverse-search\n"
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" }
1172 #test step "s" abbreviation
1173 setup_xfail "a29k-*-udi"
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" }
1184 setup_xfail "a29k-*-udi"
1187 -re "The program is not being run..*$prompt $"\
1189 -re ".*$prompt $" { fail "step" }
1190 timeout { fail "(timeout) step" }
1197 -re "No previous regular expression.*$prompt $"\
1199 -re "There is no previous regular expression.*$prompt $"\
1200 { pass "forward-search" }
1201 -re ".*$prompt $" { fail "search" }
1202 timeout { fail "(timeout) search" }
1209 -re "Must specify section name and its virtual address.*$prompt $"\
1211 -re ".*$prompt $" { fail "section" }
1212 timeout { fail "(timeout) section" }
1221 timeout { fail "(timeout) set args" }
1225 #test set check "c" abbreviation
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" }
1240 #test set check "ch" abbreviation
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" }
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" }
1270 #test set check range
1271 send "set check range\n"
1274 { pass "set check range" }
1275 timeout { fail "(timeout) set check range" }
1279 #test set check type
1280 send "set check type\n"
1283 { pass "set check type" }
1284 timeout { fail "(timeout) set check type" }
1288 #test set complaints
1289 send "set complaints\n"
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" }
1299 send "set confirm\n"
1302 { pass "set confirm" }
1303 timeout { fail "(timeout) set confirm" }
1308 send "set editing\n"
1311 { pass "set editing" }
1312 timeout { fail "(timeout) set editing" }
1317 #test set environment
1318 send "set environment\n"
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" }
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" }
1337 #test set history expansion
1338 send "set history expansion\n"
1341 { pass "set history expansion" }
1342 timeout { fail "(timeout) set history expansion" }
1346 #test set history filename
1347 send "set history filename\n"
1349 -re "Argument required .filename to set it to.*$prompt $" {
1350 pass "set history filename"
1353 fail "set history filename"
1356 fail "(timeout) set history filename"
1361 #test set history save
1362 send "set history save\n"
1365 { pass "set history save" }
1366 timeout { fail "(timeout) set history save" }
1370 #test set history size
1371 send "set history size\n"
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" }
1381 send "set history\n"
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" }
1398 send "set language\n"
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 $" {
1411 fail "(timeout) set language"
1417 send "set listsize\n"
1419 -re "Argument required .integer to set it to.*$prompt $" {
1422 -re ".*$prompt $" { fail "set listsize" }
1423 timeout { fail "(timeout) set listsize" }
1427 #test set print "p" abbreviation
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"
1436 -re ".*$prompt $" { fail "set print \"p\" abbreviation" }
1437 timeout { fail "(timeout) set print \"p\" abbreviation" }
1441 #test set print "pr" abbreviation
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"
1450 -re ".*$prompt $" { fail "set print \"pr\" abbreviation" }
1451 timeout { fail "(timeout) set print \"pr\" abbreviation" }
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 $" {
1464 -re ".*$prompt $" { fail "set print" }
1465 timeout { fail "(timeout) set print" }
1469 #test set print address
1470 send "set print address\n"
1473 { pass "set print address" }
1474 timeout { fail "(timeout) set print address" }
1478 #test set print array
1479 send "set print array\n"
1482 { pass "set print array" }
1483 timeout { fail "(timeout) set print array" }
1487 #test set print asm-demangle
1488 send "set print asm-demangle\n"
1491 { pass "set print asm-demangle" }
1492 timeout { fail "(timeout) set print asm-demangle" }
1496 #test set print demangle
1497 send "set print demangle\n"
1500 { pass "set print demangle" }
1501 timeout { fail "(timeout) set print demangle" }
1505 #test set print elements
1506 send "set print elements\n"
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" }
1515 #test set print object
1516 send "set print object\n"
1519 { pass "set print object" }
1520 timeout { fail "(timeout) set print object" }
1524 #test set print pretty
1525 send "set print pretty\n"
1528 { pass "set print pretty" }
1529 timeout { fail "(timeout) set print pretty" }
1533 #test set print sevenbit-strings
1534 send "set print sevenbit-strings\n"
1537 { pass "set print sevenbit-strings" }
1538 timeout { fail "(timeout) set print sevenbit-strings" }
1542 #test set print union
1543 send "set print union\n"
1546 { pass "set print union" }
1547 timeout { fail "(timeout) set print union" }
1551 #test set print vtbl
1552 send "set print vtbl\n"
1555 { pass "set print vtbl" }
1556 timeout { fail "(timeout) set print vtbl" }
1560 # FIXME -- need a test for "set prompt"
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" }
1573 #test set symbol-reloading
1574 send "set symbol-reloading\n"
1577 { pass "set symbol-reloading" }
1578 timeout { fail "(timeout) set symbol-reloading" }
1583 send "set variable\n"
1585 -re "Argument required .expression to compute.*$prompt $"\
1586 { pass "set variable" }
1587 -re ".*$prompt $" { fail "set variable" }
1588 timeout { fail "(timeout) set variable" }
1593 send "set verbose\n"
1596 { pass "set verbose" }
1597 timeout { fail "(timeout) set verbose" }
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" }
1612 # This is only supported on targets which use exec.o.
1613 if ![istarget "rs6000-*-*"] then {
1616 -re "set write\[\r\n\]*$prompt $"\
1617 { pass "set write" }
1618 -re "$prompt $" { fail "set write" }
1619 timeout { fail "(timeout) set write" }
1621 gdb_test "set write off" ""
1627 -re "Argument required .expression to compute.*$prompt $"\
1629 -re ".*$prompt $" { fail "set" }
1630 timeout { fail "(timeout) set" }
1634 #test shell echo Hi dad!
1635 send "shell echo Hi dad!\n"
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!" }
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" }
1654 #test show check "c" abbreviation
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" }
1665 #test show check "ch" abbreviation
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" }
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" }
1687 #test show check range
1688 send "show check range\n"
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" }
1697 #test show check type
1698 send "show check type\n"
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" }
1708 send "show commands\n"
1711 { pass "show commands" }
1712 timeout { fail "(timeout) show commands" }
1716 #test show complaints
1717 send "show complaints\n"
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" }
1727 send "show confirm\n"
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" }
1736 #test show convenience
1737 send "show convenience\n"
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" }
1748 #test show directories
1749 send "show directories\n"
1751 -re "Source directories searched: .cdir:.cwd.*$prompt $"\
1752 { pass "show directories" }
1753 -re ".*$prompt $" { fail "show directories" }
1754 timeout { fail "(timeout) show directories" }
1759 send "show editing\n"
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" }
1769 send "show height\n"
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" }
1778 #test show history expansion
1779 send "show history expansion\n"
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" }
1788 #test show history filename
1789 send "show history filename\n"
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" }
1797 #test show history save
1798 send "show history save\n"
1800 -re "Saving of the history record on exit is on..*$prompt $" {
1801 pass "show history save"
1803 -re ".*$prompt $" { fail "show history save" }
1804 timeout { fail "(timeout) show history save" }
1808 #test show history size
1809 send "show history size\n"
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" }
1819 send "show history\n"
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" }
1832 send "show language\n"
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" }
1842 send "show listsize\n"
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" }
1851 #test show print "p" abbreviation
1855 { pass "show print \"p\" abbreviation" }
1856 timeout { fail "(timeout) show print \"p\" abbreviation" }
1860 #test show print "pr" abbreviation
1864 { pass "show print \"pr\" abbreviation" }
1865 timeout { fail "(timeout) show print \"pr\" abbreviation" }
1874 { pass "show print" }
1875 timeout { fail "(timeout) show print" }
1882 -re "Executable and object file path:.*$prompt $"\
1883 { pass "show paths" }
1884 -re ".*$prompt $" { fail "show paths" }
1885 timeout { fail "(timeout) show paths" }
1889 #test show print address
1890 send "show print address\n"
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" }
1899 #test show print array
1900 send "show print array\n"
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" }
1909 #test show print asm-demangle
1910 send "show print asm-demangle\n"
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" }
1919 #test show print demangle
1920 send "show print demangle\n"
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" }
1929 #test show print elements
1930 send "show print elements\n"
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" }
1939 #test show print object
1940 send "show print object\n"
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" }
1949 #test show print pretty
1950 send "show print pretty\n"
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" }
1959 #test show print sevenbit-strings
1960 send "show print sevenbit-strings\n"
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" }
1969 #test show print union
1970 send "show print union\n"
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" }
1979 #test show print vtbl
1980 send "show print vtbl\n"
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" }
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
1993 send "show prompt\n"
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" }
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" }
2014 #test show symbol-reloading
2015 send "show symbol-reloading\n"
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" }
2028 { pass "show user" }
2029 timeout { fail "(timeout) show user" }
2034 send "show values\n"
2037 { pass "show values" }
2038 timeout { fail "(timeout) show values" }
2043 send "show verbose\n"
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" }
2053 send "show version\n"
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" }
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" }
2076 # This is only supported on targets which use exec.o.
2077 if ![istarget "rs6000-*-*"] then {
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" }
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 $"\
2097 -re "\n$prompt $" { fail "show" }
2098 timeout { fail "(timeout) show" }
2102 #test stepi "si" abbreviation
2103 setup_xfail "a29k-*-udi"
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" }
2114 setup_xfail "a29k-*-udi"
2117 -re "The program is not being run..*$prompt $"\
2119 -re ".*$prompt $" { fail "stepi" }
2120 timeout { fail "(timeout) stepi" }
2125 setup_xfail "a29k-*-udi"
2128 -re "The program is not being run..*$prompt $"\
2130 -re ".*$prompt $" { fail "signal" }
2131 timeout { fail "(timeout) signal" }
2138 -re "source command requires pathname of file to source..*$prompt"
2140 -re "No such file or directory.*$prompt $" { pass "source" }
2141 -re ".*$prompt $" { fail "source" }
2142 timeout { fail "(timeout) source" }
2145 #test step "s" abbreviation
2146 setup_xfail "a29k-*-udi"
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" }
2157 setup_xfail "a29k-*-udi"
2160 -re "The program is not being run..*$prompt $"\
2162 -re ".*$prompt $" { fail "step" }
2163 timeout { fail "(timeout) step" }
2168 send "symbol-file\n"
2171 { pass "symbol-file" }
2172 timeout { fail "(timeout) symbol-file" }
2177 send "target child\n"
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)" }
2184 -re ".*$prompt $" { fail "target child" }
2185 timeout { fail "(timeout) target child" }
2190 send "target procfs\n"
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)" }
2197 -re ".*$prompt $" { fail "target procfs" }
2198 timeout { fail "(timeout) target procfs" }
2203 send "target core\n"
2205 -re "No core file specified..*$prompt $"\
2206 { pass "target core" }
2207 -re ".*A program is being debugged already. Kill it. .y or n.*$" {
2209 if $verbose>1 then {
2210 send_user "\t\tDidn't kill program being debugged\n"
2212 expect -re "$prompt $" { }
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" }
2223 send "target exec\n"
2225 -re "No exec file now..*$prompt $"\
2226 { pass "target exec" }
2227 -re ".*A program is being debugged already. Kill it. .y or n.*$" {
2229 if $verbose>1 then {
2230 send_user "\t\tDidn't kill program being debugged\n"
2232 expect -re "$prompt $" { }
2235 -re ".*$prompt $" { fail "target exec" }
2236 timeout { fail "(timeout) target exec" }
2241 if ![istarget "*-*-udi*"] then {
2242 send "target remote\n"
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.*$" {
2249 if $verbose>1 then {
2250 send_user "\t\tDidn't kill program being debugged\n"
2252 expect -re "$prompt $" { }
2253 pass "target remote"
2255 -re ".*$prompt $" { fail "target remote" }
2256 timeout { fail "(timeout) target remote" }
2263 -re "Argument required .target name.*$prompt $"\
2265 -re ".*$prompt $" { fail "target" }
2266 timeout { fail "(timeout) target" }
2273 -re "No default breakpoint address now..*$prompt $"\
2275 -re ".*$prompt $" { fail "tbreak" }
2276 timeout { fail "(timeout) tbreak" }
2283 -re "Argument required .terminal name for running target process.*$prompt $"\
2285 -re ".*$prompt $" { fail "tty" }
2286 timeout { fail "(timeout) tty" }
2290 #test until "u" abbreviation
2291 setup_xfail "a29k-*-udi"
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" }
2302 setup_xfail "a29k-*-udi"
2305 -re "The program is not running..*$prompt $"\
2307 -re ".*$prompt $" { fail "until" }
2308 timeout { fail "(timeout) until" }
2313 # FIXME -- need to dump full output to detailed log
2316 -re "Delete all auto-display expressions.*y or n. $"\
2320 { pass "undisplay prompt" }
2321 timeout { fail "(timeout) (timeout) undisplay prompt" }
2324 timeout { fail "(timeout) (timeout) undisplay prompt" }
2328 #test unset environment
2329 send "unset environment\n"
2331 -re "Delete all environment variables?.*y or n. $"\
2335 { pass "unset environmentprompt" }
2336 timeout { fail "(timeout) (timeout) unset environment prompt" }
2339 timeout { fail "(timeout) (timeout) unset environment prompt" }
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 $"\
2353 -re ".*$prompt $" { fail "unset" }
2354 timeout { fail "(timeout) unset" }
2359 gdb_test "up" "No stack\\." "up in default.exp"
2362 send "up-silently\n"
2364 -re "No stack..*$prompt $"\
2365 { pass "up-silently" }
2366 -re ".*$prompt $" { fail "up-silently" }
2367 timeout { fail "(timeout) up-silently" }
2374 -re "Argument required .expression to compute.*$prompt $"\
2376 -re ".*$prompt $" { fail "watch" }
2377 timeout { fail "(timeout) watch" }
2384 -re "The history is empty..*$prompt $"\
2386 -re ".*$prompt $" { fail "whatis" }
2387 timeout { fail "(timeout) whatis" }
2392 setup_xfail "a29k-*-udi"
2395 -re "No stack..*$prompt $"\
2397 -re ".*$prompt $" { fail "where" }
2398 timeout { fail "(timeout) where" }
2403 #The case in which it prints a number is for vxgdb.
2406 -re "0x0:.*Cannot access memory at address 0x0..*$prompt $"\
2408 -re "0x0:.*0x\[0-9\]*.*$prompt $"\
2410 -re ".*$prompt $" { fail "x" }
2411 timeout { fail "(timeout) x" }