1 # Start with a fresh gdb
9 # test default actions of gdb commands
14 gdb_test "add-symbol-file" "add-symbol-file takes a file name and an address" "add-symbol-file"
16 setup_xfail "mips-idt-*"
19 -re "Argument required .(process-id|program) to attach.*$prompt $"\
21 -re "You can't do that when your target is `None'.*$prompt $"\
23 -re "Don't know how to attach. Try \"help target\"..*$prompt $"\
25 -re "Kill it. .y or n." {
29 -re "$prompt $" { fail "attach" }
30 timeout { fail "(timeout) attach" }
33 # FIXME: attach kills the udi connection
34 if { [istarget "a29k-*-udi"] } {
39 if ![target_info exists use_gdb_stub] {
40 gdb_test "break" "No default breakpoint address now." "break"
41 foreach i "b br bre brea" {
42 gdb_test $i "No default breakpoint address now." "break \"$i\" abbreviation"
46 setup_xfail "mips-idt-*" "a29k-*-udi"
47 gdb_test "backtrace" "No stack."
48 foreach i "bt ba bac" {
49 setup_xfail "mips-idt-*" "a29k-*-udi"
50 gdb_test $i "No stack." "backtrace \"$i\" abbreviation"
53 warning "Skipping backtrace and break tests because of GDB stub."
56 # This works on the MIPS IDT board, but confuses future tests.
57 if ![istarget "mips-idt-*"] then {
58 setup_xfail "a29k-*-udi"
59 gdb_test "continue" "The program is not being run." "continue"
60 setup_xfail "a29k-*-udi"
61 gdb_test "c" "The program is not being run." "continue \"c\" abbreviation"
64 # FIXME: continue kills the udi connection
65 if [istarget "a29k-*-udi"] then {
71 gdb_test "call" "The history is empty..*" "call"
75 gdb_test "catch" "No selected frame..*" "catch"
78 gdb_test "cd" "Argument required .new working directory.*" "cd"
81 gdb_test "clear" "No source file specified..*" "clear"
84 gdb_test "commands" "No breakpoint number 0..*" "commands"
87 gdb_test "condition" "Argument required .breakpoint number.*" "condition"
90 gdb_test "core-file" "No core file now.|GDB can't read core files on this machine." "core-file"
91 #test delete "d" abbreviation
92 gdb_test "d" "" "delete \"d\" abbreviation"
94 gdb_test "delete" "" "delete"
96 gdb_test "define" "Argument required \[(\]name of command to define\[)\]." "define"
97 #test delete breakpoints
98 gdb_test "delete breakpoints" "" "delete breakpoints"
100 # FIXME -- need to dump full output to detailed log
101 send_gdb "delete display\n"
103 -re "Delete all auto-display expressions.*y or n. $" {
106 -re "$prompt $" { pass "delete display prompt" }
107 timeout { fail "(timeout) delete display prompt" }
110 timeout { fail "(timeout) delete display prompt" }
115 gdb_test "detach" "" "detach"
117 # FIXME: continue kills the udi connection
118 if [istarget "a29k-*-udi"] then {
122 if [istarget "h8300-*-hms"] then {
128 # FIXME -- need to dump full output to detailed log
130 send_gdb "directory\n"
132 -re "Reinitialize source path to empty.*y or n. $" {
135 -re "Source directories searched: .cdir:.cwd.*$prompt $"\
136 { pass "directory prompt" }
137 timeout { fail "(timeout) directory prompt" }
142 #test disable "dis" abbreviation
143 gdb_test "dis" "" "disable \"dis\" abbreviation"
144 #test disable "disa" abbreviation
145 gdb_test "disa" "" "disable \"disa\" abbreviation"
147 gdb_test "disable" "" "disable"
148 #test disable breakpoints
149 gdb_test "disable breakpoints" "" "disable breakpoints"
150 #test disable display
151 gdb_test "disable display" "" "disable display"
153 gdb_test "disassemble" "No frame selected." "disassemble"
155 gdb_test "display" "" "display"
157 gdb_test "do" "No stack." "do"
159 gdb_test "document" "Argument required .name of command to define.*" "document"
161 gdb_test "down" "No stack.*" "down"
163 gdb_test "down-silently" "No stack." "down-silently"
165 gdb_test "echo" "" "echo"
166 #test enable breakpoints delete
167 gdb_test "enable breakpoints delete" "Argument required .one or more breakpoint numbers.*" "enable breakpoints delete"
168 #test enable breakpoints once
169 gdb_test "enable breakpoints once" "Argument required .one or more breakpoint numbers.*" "enable breakpoints once"
170 #test enable breakpoints
171 gdb_test "enable breakpoints" "" "enable breakpoints"
173 gdb_test "enable delete" "Argument required .one or more breakpoint numbers.*" "enable delete"
175 gdb_test "enable display" "" "enable display"
177 gdb_test "enable once" "Argument required .one or more breakpoint numbers.*" "enable once"
179 gdb_test "enable" "" "enable"
181 send_gdb "exec-file\n"
183 -re "No exec file now..*$prompt $" {
186 -re "exec-file.*A program is being debugged already. Kill it. .y or n.*$" {
189 send_user "\tDidn't kill program being debugged\n"
191 expect -re "$prompt $" { }
194 -re "$prompt $" { fail "exec-file" }
195 timeout { fail "(timeout) exec-file" }
198 #test frame "f" abbreviation
199 setup_xfail "a29k-*-udi"
200 gdb_test "f" "No stack." "frame \"f\" abbreviation"
202 setup_xfail "a29k-*-udi"
203 gdb_test "frame" "No stack." "frame"
205 setup_xfail "a29k-*-udi"
206 gdb_test "fg" "The program is not being run." "fg"
207 # FIXME: fg kills the udi connection
211 -re "No exec file now..*$prompt $"\
213 -re ".*A program is being debugged already. Kill it. .y or n.*$" {
216 send_user "\t\tDidn't kill program being debugged\n"
218 expect -re "$prompt $" { }
221 -re ".*$prompt $" { fail "file" }
222 timeout { fail "(timeout) file" }
226 setup_xfail "a29k-*-udi"
227 gdb_test "finish" "The program is not running." "finish"
229 # The message here comes from the regexp library, not gdb, and so can
230 # vary on different systems.
231 gdb_test "forward-search" "No previous regular expression.*|There is no previous regular expression.*" "forward-search"
232 #test help "h" abbreviation
233 gdb_test "h" "List of classes of commands:.*\[\r\n\]+running -- Running the program.*\[\r\n\]+stack -- Examining the stack.*\[\r\n\]+data -- Examining data.*\[\r\n\]+breakpoints -- Making program stop at certain points.*\[\r\n\]+files -- Specifying and examining files.*\[\r\n\]+status -- Status inquiries.*\[\r\n\]+support -- Support facilities.*\[\r\n\]+user-defined -- User-defined commands.*\[\r\n\]+aliases -- Aliases of other commands.*\[\r\n\]+obscure -- Obscure features.*\[\r\n\]+Type \"help\" followed by a class name for a list of commands in that class..*\[\r\n\]+Type \"help\" followed by command name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help \"h\" abbreviation"
235 gdb_test "help" "List of classes of commands:.*\[\r\n\]+running -- Running the program.*\[\r\n\]+stack -- Examining the stack.*\[\r\n\]+data -- Examining data.*\[\r\n\]+breakpoints -- Making program stop at certain points.*\[\r\n\]+files -- Specifying and examining files.*\[\r\n\]+status -- Status inquiries.*\[\r\n\]+support -- Support facilities.*\[\r\n\]+user-defined -- User-defined commands.*\[\r\n\]+aliases -- Aliases of other commands.*\[\r\n\]+obscure -- Obscure features.*\[\r\n\]+Type \"help\" followed by a class name for a list of commands in that class..*\[\r\n\]+Type \"help\" followed by command name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help"
237 gdb_test "handle" "Argument required .signal to handle.*" "handle"
238 #test info "i" abbreviation
239 gdb_test "i" "\"info\" must be followed by the name of an info command..*\[\r\n\]+List of info subcommands:.*\[\r\n\]+Type \"help info\" followed by info subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "info \"i\" abbreviation"
241 gdb_test "info" "\"info\" must be followed by the name of an info command..*\[\r\n\]+List of info subcommands:.*\[\r\n\]+Type \"help info\" followed by info subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "info"
243 gdb_test "ignore" "Argument required .a breakpoint number.*" "ignore"
245 gdb_test "info address" "Argument required." "info address"
246 #test info all-registers
247 setup_xfail "a29k-*-udi"
248 gdb_test "info all-registers" "The program has no registers now." "info all-registers"
250 gdb_test "info args" "No frame selected." "info args"
251 #test info bogus-gdb-command
252 gdb_test "info bogus-gdb-command" "Undefined info command: \"bogus-gdb-command\". Try \"help info\".*" "info bogus-gdb-command"
253 #test info breakpoints
254 gdb_test "info breakpoints" "No breakpoints or watchpoints." "info breakpoints"
256 gdb_test "info catch" "No frame selected." "info catch"
258 # FIXME -- doesn't work worth a shit
259 #send_gdb "info copying"
260 # -re "GNU GENERAL PUBLIC LICENSE.*#of preserving the free status of all derivatives of our free software and.*#of promoting the sharing and reuse of software generally."#
261 gdb_test "info copying"
266 gdb_test "info display" "There are no auto-display expressions now." "info display"
267 #test info frame "f" abbreviation
268 gdb_test "info f" "No stack.*|No selected frame.*" "info frame \"f\" abbreviation"
270 gdb_test "info frame" "No stack.|No selected frame." "info frame"
272 gdb_test "info files" "" "info files"
274 gdb_test "info float" "No floating point info available for this processor." "info float"
276 gdb_test "info functions" "All defined functions:" "info functions"
278 gdb_test "info locals" "No frame selected." "info locals"
280 setup_xfail "a29k-*-udi"
281 gdb_test "info program" "The program being debugged is not being run." "info program"
283 setup_xfail "a29k-*-udi"
284 gdb_test "info registers" "The program has no registers now." "info registers"
285 #test info stack "s" abbreviation
286 setup_xfail "a29k-*-udi"
287 gdb_test "info s" "No stack." "info stack \"s\" abbreviation"
289 setup_xfail "a29k-*-udi"
290 gdb_test "info stack" "No stack." "info stack"
292 # FIXME -- needs to match the entire output
293 gdb_test "info set" "confirm: Whether to confirm potentially dangerous operations is o\[a-z\]*..*\[\r\n\]+history filename: The filename in which to record the command history is .*\[\r\n\]+listsize: Number of source lines gdb will list by default is 10.*" "info set"
295 gdb_test "info source" "No current source file..*" "info source"
297 gdb_test "info sources" "No symbol table is loaded. Use the \"file\" command.*" "info sources"
299 gdb_test "info target" "" "info target"
301 gdb_test "info terminal" "No saved terminal information." "info terminal"
303 gdb_test "info types" "All defined types:" "info types"
305 gdb_test "info variables" "All defined variables:" "info variables"
307 gdb_test "info warranty" "NO WARRANTY.*\[\r\n\]+ *11. *BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY.*\[\r\n\]+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN.*\[\r\n\]+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES.*\[\r\n\]+PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED.*\[\r\n\]+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF.*\[\r\n\]+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS.*\[\r\n\]+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE.*\[\r\n\]+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,.*\[\r\n\]+REPAIR OR CORRECTION..*\[\r\n\]+ *12. *IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING.*\[\r\n\]+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR.*\[\r\n\]+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,.*\[\r\n\]+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING.*\[\r\n\]+OUT OF THE USE OR INABILITY TO USE THE PROGRAM .INCLUDING BUT NOT LIMITED.*\[\r\n\]+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY.*\[\r\n\]+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER.*\[\r\n\]+PROGRAMS., EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE.*\[\r\n\]+POSSIBILITY OF SUCH DAMAGES.*" "info warranty"
308 #test info watchpoints
309 gdb_test "info watchpoints" "No breakpoints or watchpoints." "info watchpoints"
311 gdb_test "inspect" "The history is empty." "inspect"
313 setup_xfail "a29k-*-udi"
314 gdb_test "jump" "The program is not being run." "jump"
316 gdb_test "kill" "The program is not being run." "kill"
317 #test list "l" abbreviation
318 gdb_test "l" "No symbol table is loaded. Use the \"file\" command.*" "list \"l\" abbreviation"
320 gdb_test "list" "No symbol table is loaded. Use the \"file\" command.*" "list"
322 # The ``takes a file name'' case is for vxgdb.
323 # The ``Use the "file" command'' case is for newer GDB versions which try
324 # to deduce the filename from the exec file.
325 gdb_test "load" "You can't do that when your target is `None'.*|The load command takes a file name.*|Must specify at least a file name with the load command.*|.*Use the .file. or .exec-file. command.*" "load"
326 #test next "n" abbreviation
327 setup_xfail "a29k-*-udi"
328 gdb_test "n" "The program is not being run." "next \"n\" abbreviation"
330 setup_xfail "a29k-*-udi"
331 gdb_test "next" "The program is not being run." "next"
332 #test nexti "ni" abbreviation
333 setup_xfail "a29k-*-udi"
334 gdb_test "ni" "The program is not being run." "nexti \"ni\" abbreviation"
336 setup_xfail "a29k-*-udi"
337 gdb_test "nexti" "The program is not being run." "nexti"
339 gdb_test "output" "Argument required .expression to compute.*" "output"
340 #test print "p" abbreviation
341 gdb_test "p" "The history is empty." "print \"p\" abbreviation"
343 gdb_test "print" "The history is empty." "print"
345 gdb_test "printf" "Argument required .format-control string and values to print.*" "printf"
347 gdb_test "ptype" "The history is empty." "ptype"
349 gdb_test "pwd" "Working directory .*" "pwd"
351 #test run "r" abbreviation
352 if [istarget "*-*-vxworks*"] then {
353 send_gdb "set args\n"
354 expect -re "$prompt $" {}
355 gdb_test "r" "Starting program: .*
356 You must specify a function name to run, and arguments if any"\
357 "run \"r\" abbreviation"
358 send_gdb "set args main\n"
359 expect -re "$prompt $" {}
363 -re "Starting program: .*
364 You can't do that when your target is `None'.*$prompt $"\
365 { pass "run \"r\" abbreviation" }
366 -re "Starting program: .*
367 No executable file specified.*
368 Use the \"file\" or \"exec-file\" command.*$prompt $"\
369 { pass "run \"r\" abbreviation" }
370 -re "Starting program: .*
371 No image loaded into target.*$prompt $"\
372 { pass "run \"r\" abbreviation" }
373 -re "Starting program: .*
374 No program loaded.*$prompt $"\
375 { pass "run \"r\" abbreviation" }
376 -re "Don't know how to run. Try \"help target\"..*$prompt $"\
377 { pass "run \"r\" abbreviation" }
378 -re ".*$prompt $" { fail "run \"r\" abbreviation" }
379 timeout { fail "(timeout) run \"r\" abbreviation" }
384 if [istarget "*-*-vxworks*"] then {
385 send_gdb "set args\n"
386 expect -re "$prompt $" {}
387 gdb_test "run" "Starting program: .*
388 You must specify a function name to run, and arguments if any"
389 send_gdb "set args main\n"
390 expect -re "$prompt $" {}
394 -re "Starting program:.*You can't do that when your target is `None'.*$prompt $" { pass "run" }
395 -re "Starting program: .*
396 No executable file specified.*
397 Use the \"file\" or \"exec-file\" command.*$prompt $"\
399 -re "Starting program: .*
400 No image loaded into target.*$prompt $"\
402 -re "Starting program: .*
403 No program loaded.*$prompt $"\
404 { pass "run \"r\" abbreviation" }
405 -re "Don't know how to run. Try \"help target\"..*$prompt $"\
407 -re ".*$prompt $" { fail "run" }
408 timeout { fail "(timeout) run" }
413 gdb_test "rbreak" "" "rbreak"
416 # The middle case accommodates the a29k, where doing the "ni" above causes
417 # an initial stack to be created.
420 -re "No selected frame..*$prompt $"\
422 -re "Make .* return now.*y or n. $" {
426 -re ".*$prompt $" { fail "return" }
427 timeout { fail "(timeout) return" }
431 gdb_test "reverse-search" "No previous regular expression.*|There is no previous regular expression.*" "reverse-search"
432 #test step "s" abbreviation
433 setup_xfail "a29k-*-udi"
434 gdb_test "s" "The program is not being run." "step \"s\" abbreviation"
436 setup_xfail "a29k-*-udi"
437 gdb_test "step" "The program is not being run." "step"
439 gdb_test "search" "No previous regular expression.*|There is no previous regular expression.*" "search"
441 gdb_test "section" "Must specify section name and its virtual address.*" "section"
443 gdb_test "set annotate" "Argument required .integer to set it to.*" "set annotate"
445 gdb_test "set args" "" "set args"
446 #test set check "c" abbreviation
447 gdb_test "set c" "\"set check\" must be followed by the name of a check subcommand..*\[\r\n\]+List of set check subcommands:.*\[\r\n\]+set check range -- Set range checking.*\[\r\n\]+set check type -- Set type checking.*\[\r\n\]+Type \"help set check\" followed by set check subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "set check \"c\" abbreviation"
448 #test set check "ch" abbreviation
449 gdb_test "set ch" "\"set check\" must be followed by the name of a check subcommand..*\[\r\n\]+List of set check subcommands:.*\[\r\n\]+set check range -- Set range checking.*\[\r\n\]+set check type -- Set type checking.*\[\r\n\]+Type \"help set check\" followed by set check subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "set check \"ch\" abbreviation"
451 gdb_test "set check" "\"set check\" must be followed by the name of a check subcommand..*\[\r\n\]+List of set check subcommands:.*\[\r\n\]+set check range -- Set range checking.*\[\r\n\]+set check type -- Set type checking.*\[\r\n\]+Type \"help set check\" followed by set check subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "set check"
452 #test set check range
453 gdb_test "set check range" "" "set check range"
455 gdb_test "set check type" "" "set check type"
457 gdb_test "set complaints" "Argument required .integer to set it to.*" "set complaints"
459 gdb_test "set confirm" "" "set confirm"
460 # Don't test set editing. What if we're talking to a gdb that
461 # won't do editing correctly while we're talking to it?
462 # gdb_test "set editing" "" "set editing"
464 #test set environment
465 gdb_test "set environment" "Argument required .environment variable and value.*" "set environment"
467 gdb_test "set height" "Argument required .integer to set it to.*" "set height"
468 #test set history expansion
469 gdb_test "set history expansion" "" "set history expansion"
470 #test set history filename
471 gdb_test "set history filename" "Argument required .filename to set it to.*" "set history filename"
472 #test set history save
473 gdb_test "set history save" "" "set history save"
474 #test set history size
475 gdb_test "set history size" "Argument required .integer to set it to.*" "set history size"
477 gdb_test "set history" "\"set history\" must be followed by the name of a history subcommand..*\[\r\n\]+List of set history subcommands:.*\[\r\n\]+set history filename -- Set the filename in which to record the command history.*\[\r\n\]+set history size -- Set the size of the command history.*\[\r\n\]+set history save -- Set saving of the history record on exit.*\[\r\n\]+set history expansion -- Set history expansion on command input.*\[\r\n\]+Type \"help set history\" followed by set history subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "set history"
479 gdb_test "set language" "The currently understood settings are:.*\[\r\n\]+local or auto *Automatic setting based on source file.*\[\r\n\]+c *Use the C language.*\[\r\n\]+c\[+\]+ *Use the C\[+\]+ language.*\[\r\n\]+modula-2 *Use the Modula-2 language.*" "set language"
481 gdb_test "set listsize" "Argument required .integer to set it to.*" "set listsize"
482 #test set print "p" abbreviation
483 gdb_test "set p" "\"set print\" must be followed by the name of a print subcommand..*\[\r\n\]+List of set print subcommands:.*\[\r\n\]+Type \"help set print\" followed by set print subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "set print \"p\" abbreviation"
484 #test set print "pr" abbreviation
485 gdb_test "set pr" "\"set print\" must be followed by the name of a print subcommand..*\[\r\n\]+List of set print subcommands:.*\[\r\n\]+Type \"help set print\" followed by set print subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "set print \"pr\" abbreviation"
487 gdb_test "set print" "\"set print\" must be followed by the name of a print subcommand..*\[\r\n\]+List of set print subcommands:.*\[\r\n\]+Type \"help set print\" followed by set print subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "set print"
488 #test set print address
489 gdb_test "set print address" "" "set print address"
490 #test set print array
491 gdb_test "set print array" "" "set print array"
492 #test set print asm-demangle
493 gdb_test "set print asm-demangle" "" "set print asm-demangle"
494 #test set print demangle
495 gdb_test "set print demangle" "" "set print demangle"
496 #test set print elements
497 gdb_test "set print elements" "Argument required .integer to set it to.*" "set print elements"
498 #test set print object
499 gdb_test "set print object" "" "set print object"
500 #test set print pretty
501 gdb_test "set print pretty" "" "set print pretty"
502 #test set print sevenbit-strings
503 gdb_test "set print sevenbit-strings" "" "set print sevenbit-strings"
504 #test set print union
505 gdb_test "set print union" "" "set print union"
507 gdb_test "set print vtbl" "" "set print vtbl"
508 # FIXME -- need a test for "set prompt"
510 gdb_test "set radix" "Input and output radices now set to decimal 10, hex a, octal 12.*" "set radix"
511 #test set symbol-reloading
512 gdb_test "set symbol-reloading" "" "set symbol-reloading"
514 gdb_test "set variable" "Argument required .expression to compute.*" "set variable"
516 gdb_test "set verbose" "" "set verbose"
518 gdb_test "set width" "Argument required .integer to set it to.*" "set width"
520 # This is only supported on targets which use exec.o.
521 gdb_test "set write" "" "set write"
523 gdb_test "set" "Argument required .expression to compute.*" "set"
524 #test shell echo Hi dad!
525 gdb_test "shell echo Hi dad!" "Hi dad!" "shell echo Hi dad!"
527 gdb_test "show annotate" "Annotation_level is 0." "show annotate"
529 gdb_test "show args" "Arguments to give program being debugged when it is started is \"\"." "show args"
530 #test show check "c" abbreviation
531 gdb_test "show c" "range: *Range checking is \"auto; currently off\"..*\[\r\n\]+type: *Type checking is \"auto; currently off\".*" "show check \"c\" abbreviation"
532 #test show check "ch" abbreviation
533 gdb_test "show ch" "range: *Range checking is \"auto; currently off\"..*\[\r\n\]+type: *Type checking is \"auto; currently off\"." "show check \"ch\" abbreviation"
535 gdb_test "show check" "range: *Range checking is \"auto; currently off\"..*\[\r\n\]+type: *Type checking is \"auto; currently off\"." "show check"
536 #test show check range
537 gdb_test "show check range" "Range checking is \"auto; currently off\"." "show check range"
538 #test show check type
539 gdb_test "show check type" "Type checking is \"auto; currently off\"." "show check type"
541 gdb_test "show commands" "" "show commands"
542 #test show complaints
543 gdb_test "show complaints" "Max number of complaints about incorrect symbols is 0." "show complaints"
545 gdb_test "show confirm" "Whether to confirm potentially dangerous operations is o\[a-z\]*." "show confirm"
546 #test show convenience
547 gdb_test "show convenience" "No debugger convenience variables now defined..*\[\r\n\]+Convenience variables have names starting with \".\";.*\[\r\n\]+use \"set\" as in \"set .foo = 5\" to define them." "show convenience"
548 #test show directories
549 gdb_test "show directories" "Source directories searched: .cdir:.cwd" "show directories"
551 gdb_test "show editing" "Editing of command lines as they are typed is o\[a-z\]*." "show editing"
553 gdb_test "show height" "Number of lines gdb thinks are in a page is.*" "show height"
554 #test show history expansion
555 gdb_test "show history expansion" "History expansion on command input is o\[a-z\]*.*" "show history expansion"
556 #test show history filename
557 gdb_test "show history filename" "The filename in which to record the command history is.*.gdb_history.*" "show history filename"
558 #test show history save
559 gdb_test "show history save" "Saving of the history record on exit is on." "show history save"
560 #test show history size
561 gdb_test "show history size" "The size of the command history is.*" "show history size"
563 gdb_test "show history" "filename: *The filename in which to record the command history is.*.gdb_history.*\[\r\n\]+size: * The size of the command history is.*\[\r\n\]+save: *Saving of the history record on exit is o.*\[\r\n\]+expansion: *History expansion on command input is o.*" "show history"
565 gdb_test "show language" "The current source language is \"auto; currently c\"." "show language"
567 gdb_test "show listsize" "Number of source lines gdb will list by default is 10." "show listsize"
568 #test show print "p" abbreviation
569 gdb_test "show p" ".*" "show p"
570 #test show print "pr" abbreviation
571 gdb_test "show pr" ".*" "show pr"
573 gdb_test "show print" "" "show print"
575 gdb_test "show paths" "Executable and object file path:.*" "show paths"
576 #test show print address
577 gdb_test "show print address" "Printing of addresses is on." "show print address"
578 #test show print array
579 gdb_test "show print array" "Prettyprinting of arrays is on." "show print array"
580 #test show print asm-demangle
581 gdb_test "show print asm-demangle" "Demangling of C\[+\]+ names in disassembly listings is on." "show print asm-demangle"
582 #test show print demangle
583 gdb_test "show print demangle" "Demangling of encoded C\[+\]+ names when displaying symbols is on." "show print demangle"
584 #test show print elements
585 gdb_test "show print elements" "Limit on string chars or array elements to print is 200." "show print elements"
586 #test show print object
587 gdb_test "show print object" "Printing of object's derived type based on vtable info is on." "show print object"
588 #test show print pretty
589 gdb_test "show print pretty" "Prettyprinting of structures is on." "show print pretty"
590 #test show print sevenbit-strings
591 gdb_test "show print sevenbit-strings" "Printing of 8-bit characters in strings as .nnn is on." "show print sevenbit-strings"
592 #test show print union
593 gdb_test "show print union" "Printing of unions interior to structures is on." "show print union"
594 #test show print vtbl
595 gdb_test "show print vtbl" "Printing of C\[+\]+ virtual function tables is on." "show print vtbl"
597 # In the FAIL case, can't just look for $prompt because that will match
598 # the output, rather than the prompt. So look for $prompt at the start
600 gdb_test "show prompt" "Gdb's prompt is \"$prompt \".*" "show prompt"
602 gdb_test "show radix" "Input and output radices set to decimal 10, hex a, octal 12." "show radix"
603 #test show symbol-reloading
604 gdb_test "show symbol-reloading" "Dynamic symbol table reloading multiple times in one run is on." "show symbol-reloading"
606 gdb_test "show user" "" "show user"
608 gdb_test "show values" "" "show values"
610 gdb_test "show verbose" "Verbose printing of informational messages is o.*|Verbosity is off.*" "show verbose"
613 gdb_test "show version" "GNU gdb \[0-9\.\]*.*\[\r\n\]+Copyright \[0-9\]* Free Software Foundation, Inc.*\[\r\n\]+GDB is free software, covered by the GNU General Public License, and you are.*\[\r\n\]+welcome to change it and/or distribute copies of it under certain conditions.*\[\r\n\]+Type \"show copying\" to see the conditions.*\[\r\n\]+There is absolutely no warranty for GDB. Type \"show warranty\" for details.*\[\r\n\]+This GDB was configured as .*|GDB is free software and you are welcome to distribute copies of it.*\[\r\n\]+ under certain conditions; type \"show copying\" to see the conditions..*\[\r\n\]+There is absolutely no warranty for GDB; type \"show warranty\" for details..*\[\r\n\]+GDB.*Copyright \[0-9\]* Free Software Foundation, Inc.*" "show version"
615 gdb_test "show width" "Number of characters gdb thinks are in a line is.*" "show width"
617 # This is only supported on targets which use exec.o.
618 gdb_test "show write" "Writing into executable and core files is o.*" "show write"
620 gdb_test "show" "confirm: *Whether to confirm potentially dangerous operations is on..*\[\r\n\]+history filename: *The filename in which to record the command history is .*\[\r\n\]+history size: *The size of the command history is.*\[\r\n\]+history save: *Saving of the history record on exit is on..*\[\r\n\]+print elements: *Limit on string chars or array elements to print is 200..*\[\r\n\]+listsize: *Number of source lines gdb will list by default is 10.*" "show"
621 #test stepi "si" abbreviation
622 setup_xfail "a29k-*-udi"
623 gdb_test "si" "The program is not being run." "stepi \"si\" abbreviation"
625 setup_xfail "a29k-*-udi"
626 gdb_test "stepi" "The program is not being run." "stepi"
628 setup_xfail "a29k-*-udi"
629 gdb_test "signal" "The program is not being run." "signal"
631 gdb_test "source" "source command requires pathname of file to source..*|No such file or directory.*" "source"
632 #test step "s" abbreviation
633 setup_xfail "a29k-*-udi"
634 gdb_test "s" "The program is not being run." "step \"s\" abbreviation"
636 setup_xfail "a29k-*-udi"
637 gdb_test "step" "The program is not being run." "step"
639 gdb_test "symbol-file" "" "symbol-file"
642 gdb_test "target child" "Use the \"run\" command to start a Unix child process.*|Undefined target command: \"child\". *Try \"help target\".*" "target child"
645 gdb_test "target procfs" "Use the \"run\" command to start a Unix child process.*|Undefined target command: \"procfs\". *Try \"help target\".*" "target procfs"
648 send_gdb "target core\n"
650 -re "No core file specified..*$prompt $" { pass "target core" }
651 -re ".*A program is being debugged already. Kill it. .y or n.*$" {
654 send_user "\t\tDidn't kill program being debugged\n"
656 expect -re "$prompt $" { }
659 -re "Undefined target command: \"core\". Try \"help target\"..*$prompt $" { pass "target core" }
660 -re ".*$prompt $" { fail "target core" }
661 timeout { fail "(timeout) target core" }
665 send_gdb "target exec\n"
667 -re "No exec file now..*$prompt $"\
668 { pass "target exec" }
669 -re ".*A program is being debugged already. Kill it. .y or n.*$" {
672 send_user "\t\tDidn't kill program being debugged\n"
674 expect -re "$prompt $" { }
677 -re ".*$prompt $" { fail "target exec" }
678 timeout { fail "(timeout) target exec" }
682 if ![istarget "*-*-udi*"] then {
683 send_gdb "target remote\n"
685 -re "To open a remote debug connection, you need to specify what serial.*
686 device is attached to the remote system .e.g. /dev/ttya.*$prompt $"\
687 { pass "target remote" }
688 -re ".*A program is being debugged already. Kill it. .y or n.*$" {
691 send_user "\t\tDidn't kill program being debugged\n"
693 expect -re "$prompt $" { }
696 -re ".*$prompt $" { fail "target remote" }
697 timeout { fail "(timeout) target remote" }
702 gdb_test "target" "Argument required .target name.*" "target"
704 gdb_test "tbreak" "No default breakpoint address now." "tbreak"
706 gdb_test "tty" "Argument required .terminal name for running target process.*" "tty"
707 #test until "u" abbreviation
708 setup_xfail "a29k-*-udi"
709 gdb_test "u" "The program is not running." "until \"u\" abbreviation"
711 setup_xfail "a29k-*-udi"
712 gdb_test "until" "The program is not running." "until"
714 # FIXME -- need to dump full output to detailed log
715 send_gdb "undisplay\n"
717 -re "Delete all auto-display expressions.*y or n. $" {
720 -re "$prompt $" { pass "undisplay prompt" }
721 timeout { fail "(timeout) (timeout) undisplay prompt" }
724 timeout { fail "(timeout) (timeout) undisplay prompt" }
727 #test unset environment
728 send_gdb "unset environment\n"
730 -re "Delete all environment variables?.*y or n. $" {
733 -re "$prompt $" { pass "unset environmentprompt" }
735 fail "(timeout) (timeout) unset environment prompt"
740 fail "(timeout) (timeout) unset environment prompt"
745 gdb_test "unset" "\"unset\" must be followed by the name of an unset subcommand..*\[\r\n\]+List of unset subcommands:.*\[\r\n\]+unset environment -- Cancel environment variable VAR for the program.*\[\r\n\]+Type \"help unset\" followed by unset subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "unset"
748 gdb_test "up-silently" "No stack." "up-silently"
750 gdb_test "watch" "Argument required .expression to compute.*" "watch"
752 gdb_test "whatis" "The history is empty." "whatis"
754 setup_xfail "a29k-*-udi"
755 gdb_test "where" "No stack." "where"
757 #The case in which it prints a number is for vxgdb.
758 gdb_test "x" "0x0:.*0x\[0-9\]*|0x0:.*Cannot access memory at address 0x0." "x"