f82849ea975dbbd0d75cecedd726734754ab4c2d
[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 match_max 8000
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 expect {
19 -re "Argument required .(process-id|program) to attach.*$prompt $"\
20 { pass "attach" }
21 -re "You can't do that when your target is `None'.*$prompt $"\
22 { pass "attach" }
23 -re "Don't know how to attach. Try \"help target\"..*$prompt $"\
24 { pass "attach" }
25 -re "Kill it. .y or n." {
26 send_gdb "y\n"
27 exp_continue
28 }
29 -re "$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 expect {
103 -re "Delete all auto-display expressions.*y or n. $" {
104 send_gdb "y\n"
105 expect {
106 -re "$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 expect {
132 -re "Reinitialize source path to empty.*y or n. $" {
133 send_gdb "y\n"
134 expect {
135 -re "Source directories searched: .cdir:.cwd.*$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 expect {
183 -re "No exec file now..*$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 expect -re "$prompt $" { }
192 pass "exec-file"
193 }
194 -re "$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 expect {
211 -re "No exec file now..*$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 expect -re "$prompt $" { }
219 pass "file"
220 }
221 -re ".*$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\]+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"
234 #test help
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"
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 gdb_test "info float" "No floating point info available for this processor." "info float"
275 #test info functions
276 gdb_test "info functions" "All defined functions:" "info functions"
277 #test info locals
278 gdb_test "info locals" "No frame selected." "info locals"
279 #test info program
280 setup_xfail "a29k-*-udi"
281 gdb_test "info program" "The program being debugged is not being run." "info program"
282 #test info registers
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"
288 #test info stack
289 setup_xfail "a29k-*-udi"
290 gdb_test "info stack" "No stack." "info stack"
291 #test info set
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"
294 #test info source
295 gdb_test "info source" "No current source file..*" "info source"
296 #test info sources
297 gdb_test "info sources" "No symbol table is loaded. Use the \"file\" command.*" "info sources"
298 #test info target
299 gdb_test "info target" "" "info target"
300 #test info terminal
301 gdb_test "info terminal" "No saved terminal information." "info terminal"
302 #test info types
303 gdb_test "info types" "All defined types:" "info types"
304 #test info variables
305 gdb_test "info variables" "All defined variables:" "info variables"
306 #test info warranty
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"
310 #test inspect
311 gdb_test "inspect" "The history is empty." "inspect"
312 #test jump
313 setup_xfail "a29k-*-udi"
314 gdb_test "jump" "The program is not being run." "jump"
315 #test kill
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"
319 #test list
320 gdb_test "list" "No symbol table is loaded. Use the \"file\" command.*" "list"
321 #test load
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"
329 #test next
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"
335 #test nexti
336 setup_xfail "a29k-*-udi"
337 gdb_test "nexti" "The program is not being run." "nexti"
338 #test output
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"
342 #test print
343 gdb_test "print" "The history is empty." "print"
344 #test printf
345 gdb_test "printf" "Argument required .format-control string and values to print.*" "printf"
346 #test ptype
347 gdb_test "ptype" "The history is empty." "ptype"
348 #test pwd
349 gdb_test "pwd" "Working directory .*" "pwd"
350
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 $" {}
360 } else {
361 send_gdb "r\n"
362 expect {
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" }
380 }
381 }
382
383 #test run
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 $" {}
391 } else {
392 send_gdb "run\n"
393 expect {
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 $"\
398 { pass "run" }
399 -re "Starting program: .*
400 No image loaded into target.*$prompt $"\
401 { pass "run" }
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 $"\
406 { pass "run" }
407 -re ".*$prompt $" { fail "run" }
408 timeout { fail "(timeout) run" }
409 }
410 }
411
412 #test rbreak
413 gdb_test "rbreak" "" "rbreak"
414
415 #test return
416 # The middle case accommodates the a29k, where doing the "ni" above causes
417 # an initial stack to be created.
418 send_gdb "return\n"
419 expect {
420 -re "No selected frame..*$prompt $"\
421 { pass "return" }
422 -re "Make .* return now.*y or n. $" {
423 send_gdb "y\n"
424 exp_continue
425 }
426 -re ".*$prompt $" { fail "return" }
427 timeout { fail "(timeout) return" }
428 }
429
430 #test reverse-search
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"
435 #test step
436 setup_xfail "a29k-*-udi"
437 gdb_test "step" "The program is not being run." "step"
438 #test search
439 gdb_test "search" "No previous regular expression.*|There is no previous regular expression.*" "search"
440 #test section
441 gdb_test "section" "Must specify section name and its virtual address.*" "section"
442 #test set annotate
443 gdb_test "set annotate" "Argument required .integer to set it to.*" "set annotate"
444 #test set args
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"
450 #test set check
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"
454 #test set check type
455 gdb_test "set check type" "" "set check type"
456 #test set complaints
457 gdb_test "set complaints" "Argument required .integer to set it to.*" "set complaints"
458 #test set confirm
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"
463
464 #test set environment
465 gdb_test "set environment" "Argument required .environment variable and value.*" "set environment"
466 #test set height
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"
476 #test set history
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"
478 #test set language
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"
480 #test set listsize
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"
486 #test set print
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"
506 #test set print vtbl
507 gdb_test "set print vtbl" "" "set print vtbl"
508 # FIXME -- need a test for "set prompt"
509 #test set radix
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"
513 #test set variable
514 gdb_test "set variable" "Argument required .expression to compute.*" "set variable"
515 #test set verbose
516 gdb_test "set verbose" "" "set verbose"
517 #test set width
518 gdb_test "set width" "Argument required .integer to set it to.*" "set width"
519 #test set write
520 # This is only supported on targets which use exec.o.
521 gdb_test "set write" "" "set write"
522 #test set
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!"
526 #test show annotate
527 gdb_test "show annotate" "Annotation_level is 0." "show annotate"
528 #test show args
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"
534 #test show check
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"
540 #test show commands
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"
544 #test show confirm
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"
550 #test show editing
551 gdb_test "show editing" "Editing of command lines as they are typed is o\[a-z\]*." "show editing"
552 #test show height
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"
562 #test show history
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"
564 #test show language
565 gdb_test "show language" "The current source language is \"auto; currently c\"." "show language"
566 #test show listsize
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"
572 #test show print
573 gdb_test "show print" "" "show print"
574 #test show paths
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"
596 #test show prompt
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
599 # of a line.
600 gdb_test "show prompt" "Gdb's prompt is \"$prompt \".*" "show prompt"
601 #test show radix
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"
605 #test show user
606 gdb_test "show user" "" "show user"
607 #test show values
608 gdb_test "show values" "" "show values"
609 #test show verbose
610 gdb_test "show verbose" "Verbose printing of informational messages is o.*|Verbosity is off.*" "show verbose"
611 #test show version
612
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"
614 #test show width
615 gdb_test "show width" "Number of characters gdb thinks are in a line is.*" "show width"
616 #test show write
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"
619 #test show
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"
624 #test stepi
625 setup_xfail "a29k-*-udi"
626 gdb_test "stepi" "The program is not being run." "stepi"
627 #test signal
628 setup_xfail "a29k-*-udi"
629 gdb_test "signal" "The program is not being run." "signal"
630 #test source
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"
635 #test step
636 setup_xfail "a29k-*-udi"
637 gdb_test "step" "The program is not being run." "step"
638 #test symbol-file
639 gdb_test "symbol-file" "" "symbol-file"
640
641 #test target child
642 gdb_test "target child" "Use the \"run\" command to start a Unix child process.*|Undefined target command: \"child\". *Try \"help target\".*" "target child"
643
644 #test target procfs
645 gdb_test "target procfs" "Use the \"run\" command to start a Unix child process.*|Undefined target command: \"procfs\". *Try \"help target\".*" "target procfs"
646
647 #test target core
648 send_gdb "target core\n"
649 expect {
650 -re "No core file specified..*$prompt $" { pass "target core" }
651 -re ".*A program is being debugged already. Kill it. .y or n.*$" {
652 send_gdb "n\n"
653 if $verbose>1 then {
654 send_user "\t\tDidn't kill program being debugged\n"
655 }
656 expect -re "$prompt $" { }
657 pass "target core"
658 }
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" }
662 }
663
664 #test target exec
665 send_gdb "target exec\n"
666 expect {
667 -re "No exec file now..*$prompt $"\
668 { pass "target exec" }
669 -re ".*A program is being debugged already. Kill it. .y or n.*$" {
670 send_gdb "n\n"
671 if $verbose>1 then {
672 send_user "\t\tDidn't kill program being debugged\n"
673 }
674 expect -re "$prompt $" { }
675 pass "target exec"
676 }
677 -re ".*$prompt $" { fail "target exec" }
678 timeout { fail "(timeout) target exec" }
679 }
680
681 #test target remote
682 if ![istarget "*-*-udi*"] then {
683 send_gdb "target remote\n"
684 expect {
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.*$" {
689 send_gdb "n\n"
690 if $verbose>1 then {
691 send_user "\t\tDidn't kill program being debugged\n"
692 }
693 expect -re "$prompt $" { }
694 pass "target remote"
695 }
696 -re ".*$prompt $" { fail "target remote" }
697 timeout { fail "(timeout) target remote" }
698 }
699 }
700
701 #test target
702 gdb_test "target" "Argument required .target name.*" "target"
703 #test tbreak
704 gdb_test "tbreak" "No default breakpoint address now." "tbreak"
705 #test tty
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"
710 #test until
711 setup_xfail "a29k-*-udi"
712 gdb_test "until" "The program is not running." "until"
713 #test undisplay
714 # FIXME -- need to dump full output to detailed log
715 send_gdb "undisplay\n"
716 expect {
717 -re "Delete all auto-display expressions.*y or n. $" {
718 send_gdb "y\n"
719 expect {
720 -re "$prompt $" { pass "undisplay prompt" }
721 timeout { fail "(timeout) (timeout) undisplay prompt" }
722 }
723 }
724 timeout { fail "(timeout) (timeout) undisplay prompt" }
725 }
726
727 #test unset environment
728 send_gdb "unset environment\n"
729 expect {
730 -re "Delete all environment variables?.*y or n. $" {
731 send_gdb "y\n"
732 expect {
733 -re "$prompt $" { pass "unset environmentprompt" }
734 timeout {
735 fail "(timeout) (timeout) unset environment prompt"
736 }
737 }
738 }
739 timeout {
740 fail "(timeout) (timeout) unset environment prompt"
741 }
742 }
743
744 #test unset
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"
746 #test up
747 #test up-silently
748 gdb_test "up-silently" "No stack." "up-silently"
749 #test watch
750 gdb_test "watch" "Argument required .expression to compute.*" "watch"
751 #test whatis
752 gdb_test "whatis" "The history is empty." "whatis"
753 #test where
754 setup_xfail "a29k-*-udi"
755 gdb_test "where" "No stack." "where"
756 #test x
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"
759
760 gdb_exit
This page took 0.046919 seconds and 4 git commands to generate.