This commit was generated by cvs2svn to track changes on a CVS vendor
[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 set timeout 60
7
8 #
9 # test default actions of gdb commands
10 #
11
12 #load_lib gdb.exp
13
14 gdb_test "add-symbol-file" "add-symbol-file takes a file name and an address" "add-symbol-file"
15
16 setup_xfail "mips-idt-*"
17 send_gdb "attach\n"
18 gdb_expect {
19 -re "Argument required .(process-id|program) to attach.*$gdb_prompt $"\
20 { pass "attach" }
21 -re "You can't do that when your target is `None'.*$gdb_prompt $"\
22 { pass "attach" }
23 -re "Don't know how to attach. Try \"help target\"..*$gdb_prompt $"\
24 { pass "attach" }
25 -re "Kill it. .y or n." {
26 send_gdb "y\n"
27 exp_continue
28 }
29 -re "$gdb_prompt $" { fail "attach" }
30 timeout { fail "(timeout) attach" }
31 }
32
33 # FIXME: attach kills the udi connection
34 if { [istarget "a29k-*-udi"] } {
35 gdb_exit
36 gdb_start
37 }
38
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"
43 }
44
45
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"
51 }
52 } else {
53 warning "Skipping backtrace and break tests because of GDB stub."
54 }
55
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"
62 }
63
64 # FIXME: continue kills the udi connection
65 if [istarget "a29k-*-udi"] then {
66 gdb_exit
67 gdb_start
68 }
69
70 #test call
71 gdb_test "call" "The history is empty..*" "call"
72
73
74 #test catch
75 gdb_test "catch" "No selected frame..*" "catch"
76
77 #test cd
78 gdb_test "cd" "Argument required .new working directory.*" "cd"
79
80 #test clear
81 gdb_test "clear" "No source file specified..*" "clear"
82
83 #test commands
84 gdb_test "commands" "No breakpoint number 0..*" "commands"
85
86 #test condition
87 gdb_test "condition" "Argument required .breakpoint number.*" "condition"
88
89 #test core-file
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"
93 #test delete
94 gdb_test "delete" "" "delete"
95 #test define
96 gdb_test "define" "Argument required \[(\]name of command to define\[)\]." "define"
97 #test delete breakpoints
98 gdb_test "delete breakpoints" "" "delete breakpoints"
99 #test delete display
100 # FIXME -- need to dump full output to detailed log
101 send_gdb "delete display\n"
102 gdb_expect {
103 -re "Delete all auto-display expressions.*y or n. $" {
104 send_gdb "y\n"
105 gdb_expect {
106 -re "$gdb_prompt $" { pass "delete display prompt" }
107 timeout { fail "(timeout) delete display prompt" }
108 }
109 }
110 timeout { fail "(timeout) delete display prompt" }
111
112 }
113
114 #test detach
115 gdb_test "detach" "" "detach"
116
117 # FIXME: continue kills the udi connection
118 if [istarget "a29k-*-udi"] then {
119 gdb_exit
120 gdb_start
121 }
122 if [istarget "h8300-*-hms"] then {
123 gdb_exit
124 gdb_start
125 }
126
127 #test directory
128 # FIXME -- need to dump full output to detailed log
129
130 send_gdb "directory\n"
131 gdb_expect {
132 -re "Reinitialize source path to empty.*y or n. $" {
133 send_gdb "y\n"
134 gdb_expect {
135 -re "Source directories searched: .cdir:.cwd.*$gdb_prompt $"\
136 { pass "directory prompt" }
137 timeout { fail "(timeout) directory prompt" }
138 }
139 }
140 }
141
142 #test disable "dis" abbreviation
143 gdb_test "dis" "" "disable \"dis\" abbreviation"
144 #test disable "disa" abbreviation
145 gdb_test "disa" "" "disable \"disa\" abbreviation"
146 #test disable
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"
152 #test disassemble
153 gdb_test "disassemble" "No frame selected." "disassemble"
154 #test display
155 gdb_test "display" "" "display"
156 #test do
157 gdb_test "do" "No stack." "do"
158 #test document
159 gdb_test "document" "Argument required .name of command to define.*" "document"
160 #test down
161 gdb_test "down" "No stack.*" "down"
162 #test down-silently
163 gdb_test "down-silently" "No stack." "down-silently"
164 #test echo
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"
172 #test enable delete
173 gdb_test "enable delete" "Argument required .one or more breakpoint numbers.*" "enable delete"
174 #test enable display
175 gdb_test "enable display" "" "enable display"
176 #test enable once
177 gdb_test "enable once" "Argument required .one or more breakpoint numbers.*" "enable once"
178 #test enable
179 gdb_test "enable" "" "enable"
180 #test exec-file
181 send_gdb "exec-file\n"
182 gdb_expect {
183 -re "No exec file now..*$gdb_prompt $" {
184 pass "exec-file"
185 }
186 -re "exec-file.*A program is being debugged already. Kill it. .y or n.*$" {
187 send_gdb "n\n"
188 if $verbose>1 then {
189 send_user "\tDidn't kill program being debugged\n"
190 }
191 gdb_expect -re "$gdb_prompt $" { }
192 pass "exec-file"
193 }
194 -re "$gdb_prompt $" { fail "exec-file" }
195 timeout { fail "(timeout) exec-file" }
196 }
197
198 #test frame "f" abbreviation
199 setup_xfail "a29k-*-udi"
200 gdb_test "f" "No stack." "frame \"f\" abbreviation"
201 #test frame
202 setup_xfail "a29k-*-udi"
203 gdb_test "frame" "No stack." "frame"
204 #test fg
205 setup_xfail "a29k-*-udi"
206 gdb_test "fg" "The program is not being run." "fg"
207 # FIXME: fg kills the udi connection
208 #test file
209 send_gdb "file\n"
210 gdb_expect {
211 -re "No exec file now..*$gdb_prompt $"\
212 { pass "file" }
213 -re ".*A program is being debugged already. Kill it. .y or n.*$" {
214 send_gdb "n\n"
215 if $verbose>1 then {
216 send_user "\t\tDidn't kill program being debugged\n"
217 }
218 gdb_expect -re "$gdb_prompt $" { }
219 pass "file"
220 }
221 -re ".*$gdb_prompt $" { fail "file" }
222 timeout { fail "(timeout) file" }
223 }
224
225 #test finish
226 setup_xfail "a29k-*-udi"
227 gdb_test "finish" "The program is not running." "finish"
228 #test forward-search
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\]+aliases -- Aliases of other commands.*\[\r\n\]+breakpoints -- Making program stop at certain points.*\[\r\n\]+data -- Examining data.*\[\r\n\]+files -- Specifying and examining files.*\[\r\n\]+obscure -- Obscure features.*\[\r\n\]+running -- Running the program.*\[\r\n\]+stack -- Examining the stack.*\[\r\n\]+status -- Status inquiries.*\[\r\n\]+support -- Support facilities.*\[\r\n\]+user-defined -- User-defined commands.*\[\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"
234 #test help
235 gdb_test "help" "List of classes of commands:.*\[\r\n\]+aliases -- Aliases of other commands.*\[\r\n\]+breakpoints -- Making program stop at certain points.*\[\r\n\]+data -- Examining data.*\[\r\n\]+files -- Specifying and examining files.*\[\r\n\]+obscure -- Obscure features.*\[\r\n\]+running -- Running the program.*\[\r\n\]+stack -- Examining the stack.*\[\r\n\]+status -- Status inquiries.*\[\r\n\]+support -- Support facilities.*\[\r\n\]+user-defined -- User-defined commands.*\[\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"
236 #test handle
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"
240 #test info
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"
242 #test ignore
243 gdb_test "ignore" "Argument required .a breakpoint number.*" "ignore"
244 #test info address
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"
249 #test info args
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"
255 #test info catch
256 gdb_test "info catch" "No frame selected." "info catch"
257 #test info copying
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"
262 # }
263 #
264 #
265 #test info display
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"
269 #test info frame
270 gdb_test "info frame" "No stack.|No selected frame." "info frame"
271 #test info files
272 gdb_test "info files" "" "info files"
273 #test info float
274 if [istarget "arm-*-*"] then {
275 gdb_test "info float" "Software FPU type.*mask:.*flags:.*" "info float"
276 } elseif [istarget "thumb-*-*"] then {
277 gdb_test "info float" "Software FPU type.*mask:.*flags:.*" "info float"
278 } else {
279 gdb_test "info float" "No floating point info available for this processor." "info float"
280 }
281 #test info functions
282 gdb_test "info functions" "All defined functions:" "info functions"
283 #test info locals
284 gdb_test "info locals" "No frame selected." "info locals"
285 #test info program
286 setup_xfail "a29k-*-udi"
287 gdb_test "info program" "The program being debugged is not being run." "info program"
288 #test info registers
289 setup_xfail "a29k-*-udi"
290 gdb_test "info registers" "The program has no registers now." "info registers"
291 #test info stack "s" abbreviation
292 setup_xfail "a29k-*-udi"
293 gdb_test "info s" "No stack." "info stack \"s\" abbreviation"
294 #test info stack
295 setup_xfail "a29k-*-udi"
296 gdb_test "info stack" "No stack." "info stack"
297 #test info set
298 # FIXME -- needs to match the entire output
299 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"
300 gdb_test "info symbol" "Argument required .address.."
301 #test info source
302 gdb_test "info source" "No current source file..*" "info source"
303 #test info sources
304 gdb_test "info sources" "No symbol table is loaded. Use the \"file\" command.*" "info sources"
305 #test info target
306 gdb_test "info target" "" "info target"
307 #test info terminal
308 gdb_test "info terminal" "No saved terminal information." "info terminal"
309 #test info types
310 gdb_test "info types" "All defined types:" "info types"
311 #test info variables
312 gdb_test "info variables" "All defined variables:" "info variables"
313 #test info warranty
314 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"
315 #test info watchpoints
316 gdb_test "info watchpoints" "No breakpoints or watchpoints." "info watchpoints"
317 #test inspect
318 gdb_test "inspect" "The history is empty." "inspect"
319 #test jump
320 setup_xfail "a29k-*-udi"
321 gdb_test "jump" "The program is not being run." "jump"
322 #test kill
323 gdb_test "kill" "The program is not being run." "kill"
324 #test list "l" abbreviation
325 gdb_test "l" "No symbol table is loaded. Use the \"file\" command.*" "list \"l\" abbreviation"
326 #test list
327 gdb_test "list" "No symbol table is loaded. Use the \"file\" command.*" "list"
328 #test load
329 # The ``takes a file name'' case is for vxgdb.
330 # The ``Use the "file" command'' case is for newer GDB versions which try
331 # to deduce the filename from the exec file.
332 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"
333 #test next "n" abbreviation
334 setup_xfail "a29k-*-udi"
335 gdb_test "n" "The program is not being run." "next \"n\" abbreviation"
336 #test next
337 setup_xfail "a29k-*-udi"
338 gdb_test "next" "The program is not being run." "next"
339 #test nexti "ni" abbreviation
340 setup_xfail "a29k-*-udi"
341 gdb_test "ni" "The program is not being run." "nexti \"ni\" abbreviation"
342 #test nexti
343 setup_xfail "a29k-*-udi"
344 gdb_test "nexti" "The program is not being run." "nexti"
345 #test output
346 gdb_test "output" "Argument required .expression to compute.*" "output"
347
348 #test overlay
349 gdb_test "overlay" "\"overlay\" must be followed by the name of .*"
350 #test a non-existant overlay subcommand
351 gdb_test "overlay on" "Undefined overlay command.* Try \"help overlay\"."
352 gdb_test "overlay manual" "" "overlay manual #1"
353 gdb_test "overlay auto" ""
354 gdb_test "overlay off" ""
355 gdb_test "overlay list" "No sections are mapped."
356 gdb_test "overlay map" "Overlay debugging not enabled.*" "overlay map #1"
357 gdb_test "overlay unmap" "Overlay debugging not enabled.*" "overlay unmap #2"
358 gdb_test "overlay manual" "" "overlay manual #2"
359 gdb_test "overlay map" "Argument required: name of an overlay section." "overlay map #2"
360 gdb_test "overlay unmap" "Argument required: name of an overlay section." "overlay unmap #2"
361
362 #test print "p" abbreviation
363 gdb_test "p" "The history is empty." "print \"p\" abbreviation"
364 #test print
365 gdb_test "print" "The history is empty." "print"
366 #test printf
367 gdb_test "printf" "Argument required .format-control string and values to print.*" "printf"
368 #test ptype
369 gdb_test "ptype" "The history is empty." "ptype"
370 #test pwd
371 gdb_test "pwd" "Working directory .*" "pwd"
372
373 #test run "r" abbreviation
374 if [istarget "*-*-vxworks*"] then {
375 gdb_test "set args" "" ""
376
377 gdb_test "r" "Starting program: .*
378 You must specify a function name to run, and arguments if any"\
379 "run \"r\" abbreviation"
380 gdb_test "set args main" "" ""
381
382 } else {
383 send_gdb "r\n"
384 gdb_expect {
385 -re "Starting program: .*
386 You can't do that when your target is `None'.*$gdb_prompt $"\
387 { pass "run \"r\" abbreviation" }
388 -re "Starting program: .*
389 No executable file specified.*
390 Use the \"file\" or \"exec-file\" command.*$gdb_prompt $"\
391 { pass "run \"r\" abbreviation" }
392 -re "Starting program: .*
393 No image loaded into target.*$gdb_prompt $"\
394 { pass "run \"r\" abbreviation" }
395 -re "Starting program: .*
396 No program loaded.*$gdb_prompt $"\
397 { pass "run \"r\" abbreviation" }
398 -re "Don't know how to run. Try \"help target\"..*$gdb_prompt $"\
399 { pass "run \"r\" abbreviation" }
400 -re ".*$gdb_prompt $" { fail "run \"r\" abbreviation" }
401 timeout { fail "(timeout) run \"r\" abbreviation" }
402 }
403 }
404
405 #test run
406 if [istarget "*-*-vxworks*"] then {
407 gdb_test "set args" "" ""
408
409 gdb_test "run" "Starting program: .*
410 You must specify a function name to run, and arguments if any"
411 gdb_test "set args main" "" ""
412
413 } else {
414 send_gdb "run\n"
415 gdb_expect {
416 -re "Starting program:.*You can't do that when your target is `None'.*$gdb_prompt $" { pass "run" }
417 -re "Starting program: .*
418 No executable file specified.*
419 Use the \"file\" or \"exec-file\" command.*$gdb_prompt $"\
420 { pass "run" }
421 -re "Starting program: .*
422 No image loaded into target.*$gdb_prompt $"\
423 { pass "run" }
424 -re "Starting program: .*
425 No program loaded.*$gdb_prompt $"\
426 { pass "run \"r\" abbreviation" }
427 -re "Don't know how to run. Try \"help target\"..*$gdb_prompt $"\
428 { pass "run" }
429 -re ".*$gdb_prompt $" { fail "run" }
430 timeout { fail "(timeout) run" }
431 }
432 }
433
434 #test rbreak
435 gdb_test "rbreak" "" "rbreak"
436
437 #test return
438 # The middle case accommodates the a29k, where doing the "ni" above causes
439 # an initial stack to be created.
440 gdb_test "return" "No selected frame..*" "return" "Make .* return now.*y or n. $" "y"
441
442
443 #test reverse-search
444 gdb_test "reverse-search" "No previous regular expression.*|There is no previous regular expression.*" "reverse-search"
445 #test step "s" abbreviation
446 setup_xfail "a29k-*-udi"
447 gdb_test "s" "The program is not being run." "step \"s\" abbreviation #1"
448 #test step
449 setup_xfail "a29k-*-udi"
450 gdb_test "step" "The program is not being run." "step #1"
451 #test search
452 gdb_test "search" "No previous regular expression.*|There is no previous regular expression.*" "search"
453 #test section
454 gdb_test "section" "Must specify section name and its virtual address.*" "section"
455 #test set annotate
456 gdb_test "set annotate" "Argument required .integer to set it to.*" "set annotate"
457 #test set args
458 gdb_test "set args" "" "set args"
459 #test set check "c" abbreviation
460 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"
461 #test set check "ch" abbreviation
462 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"
463 #test set check
464 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"
465 #test set check range
466 gdb_test "set check range" "" "set check range"
467 #test set check type
468 gdb_test "set check type" "" "set check type"
469 #test set complaints
470 gdb_test "set complaints" "Argument required .integer to set it to.*" "set complaints"
471 #test set confirm
472 gdb_test "set confirm" "" "set confirm"
473 # Don't test set editing. What if we're talking to a gdb that
474 # won't do editing correctly while we're talking to it?
475 # gdb_test "set editing" "" "set editing"
476
477 #test set environment
478 gdb_test "set environment" "Argument required .environment variable and value.*" "set environment"
479 #test set height
480 gdb_test "set height" "Argument required .integer to set it to.*" "set height"
481 #test set history expansion
482 gdb_test "set history expansion" "" "set history expansion"
483 #test set history filename
484 gdb_test "set history filename" "Argument required .filename to set it to.*" "set history filename"
485 #test set history save
486 gdb_test "set history save" "" "set history save"
487 #test set history size
488 gdb_test "set history size" "Argument required .integer to set it to.*" "set history size"
489 #test set history
490 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 expansion -- Set history expansion on command input.*\[\r\n\]+set history filename -- Set the filename in which to record the command history.*\[\r\n\]+set history save -- Set saving of the history record on exit.*\[\r\n\]+set history size -- Set the size of the command history.*\[\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"
491 #test set language
492 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"
493 #test set listsize
494 gdb_test "set listsize" "Argument required .integer to set it to.*" "set listsize"
495 #test set print "p" abbreviation
496 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"
497 #test set print "pr" abbreviation
498 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"
499 #test set print
500 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"
501 #test set print address
502 gdb_test "set print address" "" "set print address"
503 #test set print array
504 gdb_test "set print array" "" "set print array"
505 #test set print asm-demangle
506 gdb_test "set print asm-demangle" "" "set print asm-demangle"
507 #test set print demangle
508 gdb_test "set print demangle" "" "set print demangle"
509 #test set print elements
510 gdb_test "set print elements" "Argument required .integer to set it to.*" "set print elements"
511 #test set print object
512 gdb_test "set print object" "" "set print object"
513 #test set print pretty
514 gdb_test "set print pretty" "" "set print pretty"
515 #test set print sevenbit-strings
516 gdb_test "set print sevenbit-strings" "" "set print sevenbit-strings"
517 #test set print union
518 gdb_test "set print union" "" "set print union"
519 #test set print vtbl
520 gdb_test "set print vtbl" "" "set print vtbl"
521 # FIXME -- need a test for "set prompt"
522 #test set radix
523 gdb_test "set radix" "Input and output radices now set to decimal 10, hex a, octal 12.*" "set radix"
524 #test set symbol-reloading
525 gdb_test "set symbol-reloading" "" "set symbol-reloading"
526 #test set variable
527 gdb_test "set variable" "Argument required .expression to compute.*" "set variable"
528 #test set verbose
529 gdb_test "set verbose" "" "set verbose"
530 #test set width
531 gdb_test "set width" "Argument required .integer to set it to.*" "set width"
532 #test set write
533 # This is only supported on targets which use exec.o.
534 gdb_test "set write" "" "set write"
535 #test set
536 gdb_test "set" "Argument required .expression to compute.*" "set"
537 #test shell echo Hi dad!
538 gdb_test "shell echo Hi dad!" "Hi dad!" "shell echo Hi dad!"
539 #test show annotate
540 gdb_test "show annotate" "Annotation_level is 0." "show annotate"
541 #test show args
542 gdb_test "show args" "Argument list to give program being debugged when it is started is \"\"." "show args"
543 #test show check "c" abbreviation
544 gdb_test "show c" "range: *Range checking is \"auto; currently off\"..*\[\r\n\]+type: *Type checking is \"auto; currently off\".*" "show check \"c\" abbreviation"
545 #test show check "ch" abbreviation
546 gdb_test "show ch" "range: *Range checking is \"auto; currently off\"..*\[\r\n\]+type: *Type checking is \"auto; currently off\"." "show check \"ch\" abbreviation"
547 #test show check
548 gdb_test "show check" "range: *Range checking is \"auto; currently off\"..*\[\r\n\]+type: *Type checking is \"auto; currently off\"." "show check"
549 #test show check range
550 gdb_test "show check range" "Range checking is \"auto; currently off\"." "show check range"
551 #test show check type
552 gdb_test "show check type" "Type checking is \"auto; currently off\"." "show check type"
553 #test show commands
554 gdb_test "show commands" "" "show commands"
555 #test show complaints
556 gdb_test "show complaints" "Max number of complaints about incorrect symbols is 0." "show complaints"
557 #test show confirm
558 gdb_test "show confirm" "Whether to confirm potentially dangerous operations is o\[a-z\]*." "show confirm"
559 #test show convenience
560 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"
561 #test show directories
562 gdb_test "show directories" "Source directories searched: .cdir:.cwd" "show directories"
563 #test show editing
564 gdb_test "show editing" "Editing of command lines as they are typed is o\[a-z\]*." "show editing"
565 #test show height
566 gdb_test "show height" "Number of lines gdb thinks are in a page is.*" "show height"
567 #test show history expansion
568 gdb_test "show history expansion" "History expansion on command input is o\[a-z\]*.*" "show history expansion"
569 #test show history filename
570 gdb_test "show history filename" "The filename in which to record the command history is.*.gdb_history.*" "show history filename"
571 #test show history save
572 gdb_test "show history save" "Saving of the history record on exit is on." "show history save"
573 #test show history size
574 gdb_test "show history size" "The size of the command history is.*" "show history size"
575 #test show history
576 gdb_test "show history" "expansion: *History expansion on command input is o.*\[\r\n\]+filename: *The filename in which to record the command history is.*.gdb_history.*\[\r\n\]+save: *Saving of the history record on exit is o.*\[\r\n\]+size: * The size of the command history is.*" "show history"
577 #test show language
578 gdb_test "show language" "The current source language is \"auto; currently c\"." "show language"
579 #test show listsize
580 gdb_test "show listsize" "Number of source lines gdb will list by default is 10." "show listsize"
581 #test show print "p" abbreviation
582 gdb_test "show p" ".*" "show p"
583 #test show print "pr" abbreviation
584 gdb_test "show pr" ".*" "show pr"
585 #test show print
586 gdb_test "show print" "" "show print"
587 #test show paths
588 gdb_test "show paths" "Executable and object file path:.*" "show paths"
589 #test show print address
590 gdb_test "show print address" "Printing of addresses is on." "show print address"
591 #test show print array
592 gdb_test "show print array" "Prettyprinting of arrays is on." "show print array"
593 #test show print asm-demangle
594 gdb_test "show print asm-demangle" "Demangling of C\[+\]+ names in disassembly listings is on." "show print asm-demangle"
595 #test show print demangle
596 gdb_test "show print demangle" "Demangling of encoded C\[+\]+ names when displaying symbols is on." "show print demangle"
597 #test show print elements
598 gdb_test "show print elements" "Limit on string chars or array elements to print is 200." "show print elements"
599 #test show print object
600 gdb_test "show print object" "Printing of object's derived type based on vtable info is on." "show print object"
601 #test show print pretty
602 gdb_test "show print pretty" "Prettyprinting of structures is on." "show print pretty"
603 #test show print sevenbit-strings
604 gdb_test "show print sevenbit-strings" "Printing of 8-bit characters in strings as .nnn is on." "show print sevenbit-strings"
605 #test show print union
606 gdb_test "show print union" "Printing of unions interior to structures is on." "show print union"
607 #test show print vtbl
608 gdb_test "show print vtbl" "Printing of C\[+\]+ virtual function tables is on." "show print vtbl"
609 #test show prompt
610 # In the FAIL case, can't just look for $gdb_prompt because that will match
611 # the output, rather than the prompt. So look for $gdb_prompt at the start
612 # of a line.
613 gdb_test "show prompt" "Gdb's prompt is \"$gdb_prompt \".*" "show prompt"
614 #test show radix
615 gdb_test "show radix" "Input and output radices set to decimal 10, hex a, octal 12." "show radix"
616 #test show symbol-reloading
617 gdb_test "show symbol-reloading" "Dynamic symbol table reloading multiple times in one run is on." "show symbol-reloading"
618 #test show user
619 gdb_test "show user" "" "show user"
620 #test show values
621 gdb_test "show values" "" "show values"
622 #test show verbose
623 gdb_test "show verbose" "Verbose printing of informational messages is o.*|Verbosity is off.*" "show verbose"
624 #test show version
625
626 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"
627 #test show width
628 gdb_test "show width" "Number of characters gdb thinks are in a line is.*" "show width"
629 #test show write
630 # This is only supported on targets which use exec.o.
631 gdb_test "show write" "Writing into executable and core files is o.*" "show write"
632 #test show
633 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 save: *Saving of the history record on exit is on..*\[\r\n\]+history size: *The size of the command history is.*\[\r\n\]+listsize: *Number of source lines gdb will list by default is 10.*\[\r\n\]+print elements: *Limit on string chars or array elements to print is 200..*" "show"
634 #test stepi "si" abbreviation
635 setup_xfail "a29k-*-udi"
636 gdb_test "si" "The program is not being run." "stepi \"si\" abbreviation"
637 #test stepi
638 setup_xfail "a29k-*-udi"
639 gdb_test "stepi" "The program is not being run." "stepi"
640 #test signal
641 setup_xfail "a29k-*-udi"
642 gdb_test "signal" "The program is not being run." "signal"
643 #test source
644 gdb_test "source" "source command requires pathname of file to source..*|No such file or directory.*" "source"
645 #test step "s" abbreviation
646 setup_xfail "a29k-*-udi"
647 gdb_test "s" "The program is not being run." "step \"s\" abbreviation #2"
648 #test step
649 setup_xfail "a29k-*-udi"
650 gdb_test "step" "The program is not being run." "step #2"
651 #test symbol-file
652 gdb_test "symbol-file" "" "symbol-file"
653
654 #test target child
655 gdb_test "target child" "Use the \"run\" command to start a Unix child process.*|Undefined target command: \"child\". *Try \"help target\".*" "target child"
656
657 #test target procfs
658 gdb_test "target procfs" "Use the \"run\" command to start a Unix child process.*|Undefined target command: \"procfs\". *Try \"help target\".*" "target procfs"
659
660 #test target core
661 send_gdb "target core\n"
662 gdb_expect {
663 -re "No core file specified..*$gdb_prompt $" { pass "target core" }
664 -re ".*A program is being debugged already. Kill it. .y or n.*$" {
665 send_gdb "n\n"
666 if $verbose>1 then {
667 send_user "\t\tDidn't kill program being debugged\n"
668 }
669 gdb_expect -re "$gdb_prompt $" { }
670 pass "target core"
671 }
672 -re "Undefined target command: \"core\". Try \"help target\"..*$gdb_prompt $" { pass "target core" }
673 -re ".*$gdb_prompt $" { fail "target core" }
674 timeout { fail "(timeout) target core" }
675 }
676
677 #test target exec
678 send_gdb "target exec\n"
679 gdb_expect {
680 -re "No exec file now..*$gdb_prompt $"\
681 { pass "target exec" }
682 -re ".*A program is being debugged already. Kill it. .y or n.*$" {
683 send_gdb "n\n"
684 if $verbose>1 then {
685 send_user "\t\tDidn't kill program being debugged\n"
686 }
687 gdb_expect -re "$gdb_prompt $" { }
688 pass "target exec"
689 }
690 -re ".*$gdb_prompt $" { fail "target exec" }
691 timeout { fail "(timeout) target exec" }
692 }
693
694 #test target remote
695 if ![istarget "*-*-udi*"] then {
696 send_gdb "target remote\n"
697 gdb_expect {
698 -re "To open a remote debug connection, you need to specify what serial.*
699 device is attached to the remote system .e.g. /dev/ttya.*$gdb_prompt $"\
700 { pass "target remote" }
701 -re ".*A program is being debugged already. Kill it. .y or n.*$" {
702 send_gdb "n\n"
703 if $verbose>1 then {
704 send_user "\t\tDidn't kill program being debugged\n"
705 }
706 gdb_expect -re "$gdb_prompt $" { }
707 pass "target remote"
708 }
709 -re ".*$gdb_prompt $" { fail "target remote" }
710 timeout { fail "(timeout) target remote" }
711 }
712 }
713
714 #test target
715 gdb_test "target" "Argument required .target name.*" "target"
716 #test tbreak
717 gdb_test "tbreak" "No default breakpoint address now." "tbreak"
718 #test tty
719 gdb_test "tty" "Argument required .terminal name for running target process.*" "tty"
720 #test until "u" abbreviation
721 setup_xfail "a29k-*-udi"
722 gdb_test "u" "The program is not running." "until \"u\" abbreviation"
723 #test until
724 setup_xfail "a29k-*-udi"
725 gdb_test "until" "The program is not running." "until"
726 #test undisplay
727 # FIXME -- need to dump full output to detailed log
728 send_gdb "undisplay\n"
729 gdb_expect {
730 -re "Delete all auto-display expressions.*y or n. $" {
731 send_gdb "y\n"
732 gdb_expect {
733 -re "$gdb_prompt $" { pass "undisplay prompt" }
734 timeout { fail "(timeout) (timeout) undisplay prompt" }
735 }
736 }
737 timeout { fail "(timeout) (timeout) undisplay prompt" }
738 }
739
740 #test unset environment
741 send_gdb "unset environment\n"
742 gdb_expect {
743 -re "Delete all environment variables?.*y or n. $" {
744 send_gdb "y\n"
745 gdb_expect {
746 -re "$gdb_prompt $" { pass "unset environmentprompt" }
747 timeout {
748 fail "(timeout) (timeout) unset environment prompt"
749 }
750 }
751 }
752 timeout {
753 fail "(timeout) (timeout) unset environment prompt"
754 }
755 }
756
757 #test unset
758 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"
759 #test up
760 #test up-silently
761 gdb_test "up-silently" "No stack." "up-silently"
762 #test watch
763 gdb_test "watch" "Argument required .expression to compute.*" "watch"
764 #test whatis
765 gdb_test "whatis" "The history is empty." "whatis"
766 #test where
767 setup_xfail "a29k-*-udi"
768 gdb_test "where" "No stack." "where"
769 #test x
770 #The case in which it prints a number is for vxgdb.
771 gdb_test "x" "0x0:.*0x\[0-9\]*|0x0:.*Cannot access memory at address 0x0." "x"
772
773 gdb_exit
This page took 0.055078 seconds and 5 git commands to generate.