Check file exists before completion tests
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / completion.exp
1 # Copyright 1998-2014 Free Software Foundation, Inc.
2
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 3 of the License, or
6 # (at your option) any later version.
7 #
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
12 #
13 # You should have received a copy of the GNU General Public License
14 # along with this program. If not, see <http://www.gnu.org/licenses/>.
15
16 # This file was written by Elena Zannoni (ezannoni@cygnus.com)
17
18 # This file is part of the gdb testsuite.
19
20 #
21 # tests for command completion
22 #
23 # Here are some useful test cases for completion.
24 # They should be tested with both M-? and TAB.
25 #
26 # "show output-" "radix"
27 # "show output" "-radix"
28 # "p" ambiguous (commands starting with p--path, print, printf, etc.)
29 # "p " ambiguous (all symbols)
30 # "info t foo" no completions
31 # "info t " no completions
32 # "info t" ambiguous ("info target", "info terminal", etc.)
33 # "info ajksdlfk" no completions
34 # "info ajksdlfk " no completions
35 # "info" " "
36 # "info " ambiguous (all info commands)
37 # "p \"break1" unambiguous (completes to filename "break1.c")
38 # "p \"break1." unambiguous (should complete to "break1.c" but does not,
39 # due to readline limitations)
40 # "p 'arg" ambiguous (all symbols starting with arg)
41 # "p b-arg" ambiguous (all symbols starting with arg)
42 # "p b-" ambiguous (all symbols)
43 # "file Make" "file" (word break hard to screw up here)
44 # "file ../gdb.stabs/we" "ird" (needs to not break word at slash)
45 #
46
47
48
49 #
50 # test running programs
51 #
52
53 standard_testfile break.c break1.c
54
55 if [get_compiler_info] {
56 return -1
57 }
58
59 if {[prepare_for_testing $testfile.exp $testfile \
60 [list $srcfile $srcfile2] {debug nowarnings}]} {
61 untested $testfile.exp
62 return -1
63 }
64
65 if ![runto_main] then {
66 perror "tests suppressed"
67 }
68
69 set oldtimeout1 $timeout
70 set timeout 30
71
72 gdb_test_no_output "complete print values\[0\].x." \
73 "field completion with invalid field"
74
75 # If there is a non-deprecated completion, it should be returned.
76 gdb_test "complete sav" "save" "test non-deprecated completion"
77 # If there is only a deprecated completion, then it should be returned.
78 gdb_test "complete save-t" "save-tracepoints" "test deprecated completion"
79
80
81 #
82 # Tag name completion.
83 #
84
85 gdb_test "complete ptype struct some_" "ptype struct some_struct"
86 gdb_test "complete ptype enum some_" "ptype enum some_enum"
87 gdb_test "complete ptype union some_" "ptype union some_union"
88
89
90 gdb_test "complete set gnutarget aut" "set gnutarget auto"
91
92
93 gdb_test "complete set cp-abi aut" "set cp-abi auto"
94
95 # Test that completion of commands 'target FOO' works well.
96 set targets [list "core" "tfile" "exec"]
97
98 # Test that completion of command 'target ctf' if GDB supports ctf
99 # target.
100 gdb_test_multiple "target ctf" "" {
101 -re "Undefined target command: \"ctf\"\. Try \"help target\"\.\r\n$gdb_prompt $" {
102 }
103 -re "No CTF directory specified.*\r\n$gdb_prompt $" {
104 lappend targets "ctf"
105 }
106 }
107
108 # Test artifacts are put in different locations depending on test
109 # is a parallel run or not. Firstly check file exists, and then
110 # do the test on file completion.
111
112 foreach dir1 [ list "./gdb.base" "./outputs/gdb.base/completion" ] {
113 if [remote_file host exists ${dir1}/completion] {
114 foreach target_name ${targets} {
115 gdb_test "complete target ${target_name} ${dir1}/completion" \
116 "target ${target_name} ${dir1}/completion.*${dir1}/completion0\\.o.*${dir1}/completion1\\.o.*"
117 }
118 break
119 }
120 }
121
122 #
123 # "set foo unlimited" completion.
124 #
125
126 # A var_uinteger command.
127 gdb_test "complete set height " "set height unlimited"
128 gdb_test "complete set height u" "set height unlimited"
129
130 # A var_integer command.
131 gdb_test "complete set listsize " "set listsize unlimited"
132 gdb_test "complete set listsize unl" "set listsize unlimited"
133
134 # A var_zuinteger_unlimited command.
135 gdb_test "complete set trace-buffer-size " "set trace-buffer-size unlimited"
136 gdb_test "complete set trace-buffer-size unl" "set trace-buffer-size unlimited"
137
138 # Tests below are about tab-completion, which doesn't work if readline
139 # library isn't used. Check it first.
140
141 if { ![readline_is_used] } {
142 return -1
143 }
144
145 set test "complete 'hfgfh'"
146 send_gdb "hfgfh\t"
147 gdb_test_multiple "" "$test" {
148 -re "^hfgfh\\\x07$" {
149 send_gdb "\n"
150 gdb_test_multiple "" $test {
151 -re "Undefined command: \"hfgfh\"\\. Try \"help\"\\..*$gdb_prompt $" {
152 pass "$test"
153 }
154 }
155 }
156 }
157
158 #exp_internal 0
159
160 set test "complete 'show output'"
161 send_gdb "show output\t"
162 gdb_test_multiple "" "$test" {
163 -re "^show output-radix $" {
164 send_gdb "\n"
165 gdb_test_multiple "" "$test" {
166 -re "Default output radix for printing of values is 10\\..*$gdb_prompt $" {
167 pass "$test"
168 }
169 }
170 }
171 }
172
173 set test "complete 'show output-'"
174 send_gdb "show output-\t"
175 gdb_test_multiple "" "$test" {
176 -re "^show output-radix $" {
177 send_gdb "\n"
178 gdb_test_multiple "" "$test" {
179 -re "Default output radix for printing of values is 10\\..*$gdb_prompt $" {
180 pass "$test"
181 }
182 }
183 }
184 }
185
186 set test "complete 'p'"
187 send_gdb "p\t"
188 gdb_test_multiple "" "$test" {
189 -re "^p\\\x07$" {
190 send_gdb "\n"
191 gdb_test_multiple "" "$test" {
192 -re "The history is empty\\..*$gdb_prompt $" {
193 pass "$test"
194 }
195 }
196 }
197 }
198
199 set test "complete 'p '"
200 send_gdb "p \t"
201 gdb_test_multiple "" "$test" {
202 -re "^p \\\x07$" {
203 send_gdb "\n"
204 gdb_test_multiple "" "$test" {
205 -re "The history is empty\\..*$gdb_prompt $" {
206 pass "$test"
207 }
208 }
209 }
210 }
211
212 set test "complete 'info t foo'"
213 send_gdb "info t foo\t"
214 gdb_test_multiple "" "$test" {
215 -re "^info t foo\\\x07$" {
216 send_gdb "\n"
217 gdb_test_multiple "" "$test" {
218 -re "Ambiguous info command \"t foo\": target, tasks, terminal, threads, tp, tracepoints, tvariables, (type-printers, )?types\\..*$gdb_prompt $" {
219 pass "$test"
220 }
221 }
222 }
223 }
224
225 set test "complete 'info t'"
226 send_gdb "info t\t"
227 gdb_test_multiple "" "$test" {
228 -re "^info t\\\x07$" {
229 send_gdb "\n"
230 gdb_test_multiple "" "$test" {
231 -re "Ambiguous info command \"t\": target, tasks, terminal, threads, tp, tracepoints, tvariables, (type-printers, )?types\\..*$gdb_prompt $" {
232 pass "$test"
233 }
234 }
235 }
236 }
237
238 set test "complete 'info t '"
239 send_gdb "info t \t"
240 gdb_test_multiple "" "$test" {
241 -re "^info t \\\x07$" {
242 send_gdb "\n"
243 gdb_test_multiple "" "$test" {
244 -re "Ambiguous info command \"t \": target, tasks, terminal, threads, tp, tracepoints, tvariables, (type-printers, )?types\\..*$gdb_prompt $" {
245 pass "$test"
246 }
247 }
248 }
249 }
250
251 set test "complete 'info asdfgh'"
252 send_gdb "info asdfgh\t"
253 gdb_test_multiple "" "$test" {
254 -re "^info asdfgh\\\x07$" {
255 send_gdb "\n"
256 gdb_test_multiple "" "$test" {
257 -re "Undefined info command: \"asdfgh\". Try \"help info\"\\..*$gdb_prompt $" {
258 pass "$test"
259 }
260 }
261 }
262 }
263
264 set test "complete 'info asdfgh '"
265 send_gdb "info asdfgh \t"
266 gdb_test_multiple "" "$test" {
267 -re "^info asdfgh \\\x07$" {
268 send_gdb "\n"
269 gdb_test_multiple "" "$test" {
270 -re "Undefined info command: \"asdfgh \". Try \"help info\"\\..*$gdb_prompt $" {
271 pass "$test"
272 }
273 }
274 }
275 }
276
277 set test "complete 'info'"
278 send_gdb "info\t"
279 gdb_test_multiple "" "$test" {
280 -re "^info $" {
281 send_gdb "\n"
282 gdb_test_multiple "" "$test" {
283 -re "\"info\" must be followed by the name of an info command\\.\r\nList of info subcommands.*$gdb_prompt $" {
284 pass "$test"
285 }
286 }
287 }
288 }
289
290 set test "complete 'info '"
291 send_gdb "info \t"
292 gdb_test_multiple "" "$test" {
293 -re "^info \\\x07$" {
294 send_gdb "\n"
295 gdb_test_multiple "" "$test" {
296 -re "\"info\" must be followed by the name of an info command\\.\r\nList of info subcommands:\r\n\r\n.*$gdb_prompt $" {
297 pass "$test"
298 }
299 }
300 }
301 }
302
303 set test "complete (2) 'info '"
304 send_gdb "info \t"
305 gdb_test_multiple "" "$test" {
306 -re "^info \\\x07$" {
307 send_gdb "\t"
308 gdb_test_multiple "" "$test" {
309 -re "address.*types.*$gdb_prompt " {
310 send_gdb "\n"
311 gdb_test_multiple "" "$test" {
312 -re "\"info\".*unambiguous\\..*$gdb_prompt $" {
313 pass "$test"
314 }
315 }
316 }
317 }
318 }
319 }
320
321 set test "complete 'help info wat'"
322 send_gdb "help info wat\t"
323 gdb_test_multiple "" "$test" {
324 -re "^help info watchpoints $" {
325 send_gdb "\n"
326 gdb_test_multiple "" "$test" {
327 -re "Status of specified watchpoints.*\r\n.*$gdb_prompt $" {
328 pass "$test"
329 }
330 }
331 }
332 -re "^help info wat\\\x07$" {
333 fail "$test"
334 }
335 }
336
337 set test "complete 'p \"break1'"
338 send_gdb "p \"break1\t"
339 gdb_test_multiple "" "$test" {
340 -re "^p \"break1\\\x07$" {
341 send_gdb "\n"
342 gdb_test_multiple "" "$test" {}
343 }
344 -re "^p \"break1\\.c\"$" {
345 send_gdb "\n"
346 gdb_test_multiple "" "$test" {
347 -re "$gdb_prompt $" {
348 pass "$test"
349 }
350 }
351 }
352 }
353
354 setup_xfail "*-*-*"
355 set test "complete 'p \"break1.'"
356 send_gdb "p \"break1.\t"
357 gdb_test_multiple "" "$test" {
358 -re "^p \"break1\\.\\\x07$" {
359 send_gdb "\n"
360 gdb_test_multiple "" "$test" {}
361 }
362 -re "^p \"break1\\.c\"$" {
363 send_gdb "\n"
364 gdb_test_multiple "" "$test" {
365 -re "$gdb_prompt $" {
366 pass "$test"
367 }
368 }
369 }
370 -re "^p \"break1\\..*$" {
371 send_gdb "\n"
372 gdb_test_multiple "" "$test" {}
373 }
374 }
375
376 set test "complete 'p 'arg'"
377 send_gdb "p 'arg\t"
378 gdb_test_multiple "" "$test" {
379 -re "^p 'arg\\\x07$" {
380 send_gdb "\n"
381 gdb_test_multiple "" "$test" {
382 -re "(Invalid character constant\\.|Unmatched single quote\\.).*$gdb_prompt $" {
383 pass "$test"
384 }
385 }
386 }
387 }
388
389 set test "complete (2) 'p 'arg'"
390 send_gdb "p 'arg\t"
391 gdb_test_multiple "" "$test" {
392 -re "^p 'arg\\\x07$" {
393 send_gdb "\t"
394 gdb_test_multiple "" "$test" {
395 -re "argv.*$gdb_prompt " {
396 send_gdb "\n"
397 gdb_test_multiple "" "$test" {
398 -re "(Invalid character constant\\.|Unmatched single quote\\.).*$gdb_prompt $" {
399 pass "$test"
400 }
401 }
402 }
403 -re "(There are $decimal possibilities\\. Do you really\r\nwish to see them all.|Display all $decimal possibilities.) \\(y or n\\)$" {
404 send_gdb "n"
405 gdb_test_multiple "" "$test" {
406 -re "\\(gdb\\) p 'arg$" {
407 send_gdb "\n"
408 gdb_test_multiple "" "$test" {
409 -re "(Invalid character constant\\.|Unmatched single quote\\.).*$gdb_prompt $" {
410 pass "$test"
411 }
412 }
413 }
414 }
415 }
416 }
417 }
418 }
419
420 set test "complete 'handle signal'"
421 send_gdb "handle sigq\t"
422 gdb_test_multiple "" "$test" {
423 -re "^handle sigq\b\b\b\bSIGQUIT $" {
424 send_gdb "\n"
425 gdb_test_multiple "" "$test" {
426 -re "SIGQUIT.*Quit.*$gdb_prompt $" {
427 pass "$test"
428 }
429 }
430 }
431 }
432
433 set test "complete 'handle keyword'"
434 send_gdb "handle nos\t"
435 gdb_test_multiple "" "$test" {
436 -re "^handle nostop $" {
437 send_gdb "\n"
438 gdb_test_multiple "" "$test" {
439 -re "$gdb_prompt $" {
440 pass "$test"
441 }
442 }
443 }
444 }
445
446 set test "complete help aliases"
447 send_gdb "help user-define\t"
448 gdb_test_multiple "" "$test" {
449 -re "^help user-defined $" {
450 send_gdb "\n"
451 gdb_test_multiple "" "$test" {
452 -re "$gdb_prompt $" {
453 pass "$test"
454 }
455 }
456 }
457 }
458
459
460 # These tests used to try completing the shorter "p b-a".
461 # Unfortunately, on some systems, there are .o files in system
462 # libraries which declare static variables named `b'. Of course,
463 # those variables aren't really in scope, as far as the compiler is
464 # concerned. But GDB deliberately tries to be more liberal: if you
465 # enter an identifier that doesn't have any binding in scope, GDB will
466 # search all the program's compilation units for a static variable of
467 # the given name.
468 #
469 # This behavior can help avoid a lot of pedantry, so it's usually a
470 # good thing. But in this test case, it causes GDB to print the value
471 # of some random variable, instead of giving us the "No symbol..."
472 # error we were expecting.
473 #
474 # For example, on S/390 linux, the file s_atan.c in libm.a declares a
475 # `b', which is a structure containing an int and a float, so GDB says
476 # ``Argument to arithmetic operation not a number or boolean'' instead
477 # of ``No symbol ...''.
478 #
479 # So, I'm hoping that there is no system with a static library variable named
480 # `no_var_by_this_name'.
481
482 set test "complete 'p no_var_named_this-arg'"
483 send_gdb "p no_var_named_this-arg\t"
484 gdb_test_multiple "" "$test" {
485 -re "^p no_var_named_this-arg\\\x07$" {
486 send_gdb "\n"
487 gdb_test_multiple "" "$test" {
488 -re "No symbol \"no_var_named_this\" in current context\\..*$gdb_prompt $" {
489 pass "$test"
490 }
491 }
492 }
493 }
494
495 set test "complete (2) 'p no_var_named_this-arg'"
496 send_gdb "p no_var_named_this-arg\t"
497 gdb_test_multiple "" "$test" {
498 -re "^p no_var_named_this-arg\\\x07$" {
499 send_gdb "\t"
500 gdb_test_multiple "" "$test" {
501 -re "argv.*$gdb_prompt " {
502 send_gdb "\n"
503 gdb_test_multiple "" "$test" {
504 -re "No symbol \"no_var_named_this\" in current context\\..*$gdb_prompt $" {
505 pass "$test"
506 }
507 }
508 }
509 -re "(There are $decimal possibilities\\. Do you really\r\nwish to see them all.|Display all $decimal possibilities.) \\(y or n\\)$" {
510 send_gdb "n\n"
511
512 # Eat the prompt
513 gdb_expect {
514 -re "$gdb_prompt " {
515 pass "$test (eat prompt)"
516 }
517 timeout {
518 fail "(timeout) $test (eat prompt)"
519 }
520 }
521
522 gdb_test_multiple "" "$test" {
523 -re "No symbol \"no_var_named_this\" in current context\\..*$gdb_prompt $" {
524 pass "$test"
525 }
526 }
527 }
528 }
529 }
530 }
531
532 set test "complete (2) 'p no_var_named_this-'"
533 send_gdb "p no_var_named_this-\t"
534 gdb_test_multiple "" "$test" {
535 -re "^p no_var_named_this-\\\x07$" {
536 send_gdb "\t"
537 gdb_test_multiple "" "$test" {
538 -re "(There are $decimal possibilities\\. Do you really\r\nwish to see them all.|Display all $decimal possibilities.) \\(y or n\\)$" {
539 send_gdb "n\n"
540
541 # Eat the prompt
542 gdb_expect {
543 -re "$gdb_prompt " {
544 pass "$test (eat prompt)"
545 }
546 timeout {
547 fail "(timeout) $test (eat prompt)"
548 }
549 }
550
551 gdb_test_multiple "" "$test" {
552 -re "No symbol \"no_var_named_this\" in current context\\..*$gdb_prompt $" {
553 pass "$test"
554 }
555 }
556 }
557 -re "argv.*$gdb_prompt $" {
558 send_gdb "\n"
559 gdb_test_multiple "" "$test" {
560 -re "No symbol \"no_var_named_this\" in current context\\..*$gdb_prompt $" {
561 pass "$test"
562 }
563 }
564 }
565 }
566 }
567 }
568
569 set test "complete 'p values\[0\].a'"
570 send_gdb "p values\[0\].a\t"
571 gdb_test_multiple "" "$test" {
572 -re "^p values.0..a_field $" {
573 send_gdb "\n"
574 gdb_test_multiple "" "$test" {
575 -re " = 0.*$gdb_prompt $" {
576 pass "$test"
577 }
578 }
579 }
580 }
581
582 set test "complete 'p values\[0\] . a'"
583 send_gdb "p values\[0\] . a\t"
584 gdb_test_multiple "" "$test" {
585 -re "^p values.0. . a_field $" {
586 send_gdb "\n"
587 gdb_test_multiple "" "$test" {
588 -re " = 0.*$gdb_prompt $" {
589 pass "$test"
590 }
591 }
592 }
593 }
594
595 set test "complete 'p &values\[0\] -> a'"
596 send_gdb "p &values\[0\] -> a\t"
597 gdb_test_multiple "" "$test" {
598 -re "^p &values.0. -> a_field $" {
599 send_gdb "\n"
600 gdb_test_multiple "" "$test" {
601 -re " = .*0x\[0-9a-fA-F\]*.*$gdb_prompt $" {
602 pass "$test"
603 }
604 }
605 }
606 }
607
608 gdb_test "complete p &values\[0\]->z" \
609 "p &values.0.->z_field" \
610 "completion of field in anonymous union"
611
612 gdb_test "complete ptype &values\[0\]->z" \
613 "ptype &values.0.->z_field" \
614 "ptype completion of field in anonymous union"
615
616 gdb_test "complete whatis &values\[0\]->z" \
617 "whatis &values.0.->z_field" \
618 "whatis completion of field in anonymous union"
619
620 # The following tests used to simply try to complete `${objdir}/file',
621 # and so on. The problem is that ${objdir} can be very long; the
622 # completed filename may be more than eighty characters wide. When
623 # this happens, readline tries to manage things, producing output that
624 # may make sense on the screen, but is rather hard for our script to
625 # recognize.
626 #
627 # In the case that motivated this change, the (gdb) prompt occupied
628 # the leftmost six columns, and `${objdir}/' was seventy-four
629 # characters long --- eighty in all. After printing the slash,
630 # readline emitted a space, a carriage return, and then `Makefile'
631 # (the tab character being received as input after `Make'.
632 #
633 # Basically, you have to let readline do whatever it's going to do to
634 # make the screen look right. If it happens to use a different
635 # strategy on Tuesdays to get the cursor in the right place, that's
636 # not something the testsuite should care about.
637 #
638 # So, we avoid long lines. We `cd' to ${objdir} first, and then do
639 # the completion relative to the current directory.
640
641 # ${srcdir} may be a relative path. We want to make sure we end up
642 # in the right directory - so make sure we know where it is.
643 set mydir [pwd]
644 cd ${srcdir}
645 set fullsrcdir [pwd]
646 cd ${mydir}
647
648 # If the directory name contains a '+' we must escape it, adding a backslash.
649 # If not, the test below will fail because it will interpret the '+' as a
650 # regexp operator. We use string_to_regexp for this purpose.
651
652 gdb_test "cd ${fullsrcdir}" \
653 "Working directory [string_to_regexp ${fullsrcdir}].*" \
654 "cd to \${srcdir}"
655
656
657 # GDB used to fail adding / on directories, on the first try only.
658 set uniquedir ../testsuite/gdb.base/comp-dir
659 set escapeduniquedir [string_to_regexp ${uniquedir}]
660 set uniquesu subdi
661 set uniquesub ${uniquesu}r
662 set escapeuniquesub [string_to_regexp ${uniquesub}]
663 send_gdb "dir ${uniquedir}\t"
664 gdb_expect {
665 -re "${escapeduniquedir}/" {
666 pass "directory completion"
667 send_gdb "${uniquesu}\t"
668 }
669 -re "${escapeduniquedir} $" {
670 fail "directory completion (old gdb bug)"
671 send_gdb "\b/${uniquesu}\t"
672 }
673 default {
674 fail "directory completion (timeout)"
675 send_gdb "\ndir ${uniquedir}/${uniquesu}\t"
676 }
677 }
678
679 gdb_expect {
680 -re "${escapeuniquesub}/$" {
681 pass "directory completion 2"
682 }
683 timeout {
684 fail "directory completion 2"
685 }
686 }
687
688 # Empty COMMAND sends no newline while " " sends the newline we need.
689 gdb_test " " "Source directories searched: .*" "Glob remaining of directory test"
690
691 gdb_test "complete file ./gdb.base/compl" \
692 "file ./gdb.base/completion\\.exp.*" \
693 "complete-command 'file ./gdb.base/compl'"
694
695 set test "complete 'file ./gdb.base/complet'"
696 send_gdb "file ./gdb.base/complet\t"
697 gdb_test_multiple "" "$test" {
698 -re "^file ./gdb.base/completion\\.exp $" {
699 send_gdb "\n"
700 # Ignore the exact error message.
701 gdb_test_multiple "" "complete 'file ./gdb.base/complet'" {
702 -re "\r\nA program is being debugged already\\.\[\r\n\]+Are you sure you want to change the file\\? \\(y or n\\) $" {
703 send_gdb "n\n"
704 exp_continue
705 }
706 -re "$gdb_prompt $" {
707 pass "$test"
708 }
709 }
710 }
711 }
712
713 set test "complete 'info func marke'"
714 send_gdb "info func marke\t"
715 gdb_test_multiple "" "$test" {
716 -re "^info func marke.*r$" {
717 send_gdb "\t\t"
718 gdb_test_multiple "" "$test" {
719 -re "marker1.*$gdb_prompt " {
720 send_gdb "\n"
721 gdb_test_multiple "" "$test" {
722 -re "All functions matching regular expression \"marker\":.*File.*break1.c:\r\nint marker1\\((void|)\\);\r\nint marker2\\(int\\).*marker3\\(char.*char.*\\).*marker4\\(long( int)?\\);.*$gdb_prompt $" {
723 pass "$test"
724 }
725 }
726 }
727 }
728 }
729 }
730
731
732 set test "complete 'set follow-fork-mode'"
733 send_gdb "set follow-fork-mode \t\t"
734 gdb_test_multiple "" "$test" {
735 -re "child.*parent.*$gdb_prompt " {
736 send_gdb "\n"
737 gdb_test_multiple "" "$test" {
738 -re "Requires an argument.*child.*parent.*$gdb_prompt $" {
739 pass "$test"
740 }
741 -re "Ambiguous item \"\"\\..*$gdb_prompt $" {
742 pass "$test"
743 }
744 }
745 }
746 }
747
748 # Restore globals modified in this test...
749 set timeout $oldtimeout1
750
751 return 0
This page took 0.073261 seconds and 5 git commands to generate.