1 # Copyright 1998, 1999, 2002, 2003, 2004, 2007, 2008, 2009, 2010
2 # Free Software Foundation, Inc.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 3 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
17 # This file was written by Elena Zannoni (ezannoni@cygnus.com)
19 # This file is part of the gdb testsuite.
22 # tests for command completion
24 # Here are some useful test cases for completion.
25 # They should be tested with both M-? and TAB.
27 # "show output-" "radix"
28 # "show output" "-radix"
29 # "p" ambiguous (commands starting with p--path, print, printf, etc.)
30 # "p " ambiguous (all symbols)
31 # "info t foo" no completions
32 # "info t " no completions
33 # "info t" ambiguous ("info target", "info terminal", etc.)
34 # "info ajksdlfk" no completions
35 # "info ajksdlfk " no completions
37 # "info " ambiguous (all info commands)
38 # "p \"break1" unambiguous (completes to filename "break1.c")
39 # "p \"break1." unambiguous (should complete to "break1.c" but does not,
40 # due to readline limitations)
41 # "p 'arg" ambiguous (all symbols starting with arg)
42 # "p b-arg" ambiguous (all symbols starting with arg)
43 # "p b-" ambiguous (all symbols)
44 # "file Make" "file" (word break hard to screw up here)
45 # "file ../gdb.stabs/we" "ird" (needs to not break word at slash)
57 # test running programs
63 set srcfile ${testfile}.c
64 set srcfile1 ${testfile}1.c
65 set binfile ${objdir}/${subdir}/${testfile}
67 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}0.o" object {debug nowarnings}] != "" } {
68 untested completion.exp
72 if { [gdb_compile "${srcdir}/${subdir}/${srcfile1}" "${binfile}1.o" object {debug nowarnings}] != "" } {
73 untested completion.exp
77 if { [gdb_compile "${binfile}0.o ${binfile}1.o" "${binfile}" executable {debug nowarnings}] != "" } {
78 untested completion.exp
82 if [get_compiler_info ${binfile}] {
89 gdb_reinitialize_dir $srcdir/$subdir
92 if ![runto_main] then {
93 perror "tests suppressed"
96 set oldtimeout1 $timeout
106 -re "Undefined command: \"hfgfh\"\\. Try \"help\"\\..*$gdb_prompt $"\
107 { pass "complete 'hfgfh'"}
108 -re ".*$gdb_prompt $" { fail "complete 'hfgfh'"}
109 timeout {fail "(timeout) complete 'hfgfh'"}
112 -re ".*$gdb_prompt $" { fail "complete 'hfgfh'" }
113 timeout { fail "(timeout) complete 'hfgfh'" }
118 send_gdb "show output\t"
121 -re "^show output-radix $"\
124 -re "Default output radix for printing of values is 10\\..*$gdb_prompt $"\
125 { pass "complete 'show output'"}
126 -re ".*$gdb_prompt $" { fail "complete 'show output'"}
127 timeout {fail "(timeout) complete 'show output'"}
133 -re "Default output radix for printing of values is 10\\..*$gdb_prompt $"\
134 { fail "complete 'show output'"}
135 -re ".*$gdb_prompt $" { fail "complete 'show output'"}
136 timeout { fail "(timeout) complete 'show output'"}
141 -re ".*$gdb_prompt $" { fail "complete 'show output'" }
142 timeout { fail "(timeout) complete 'show output'" }
146 send_gdb "show output-\t"
149 -re "^show output-radix $"\
152 -re "Default output radix for printing of values is 10\\..*$gdb_prompt $"\
153 { pass "complete 'show output-'"}
154 -re ".*$gdb_prompt $" { fail "complete 'show output-'"}
155 timeout {fail "(timeout) complete 'show output-'"}
158 -re "^show output-$"\
161 -re "Default output radix for printing of values is 10\\..*$gdb_prompt $"\
162 { fail "complete 'show output-'"}
163 -re ".*$gdb_prompt $" { fail "complete 'show output-'"}
164 timeout { fail "(timeout) complete 'show output-'"}
169 -re ".*$gdb_prompt $" { fail "complete 'show output-'" }
170 timeout { fail "(timeout) complete 'show output-'" }
180 -re "The history is empty\\..*$gdb_prompt $"\
181 { pass "complete 'p'"}
182 -re ".*$gdb_prompt $" { fail "complete 'p'"}
183 timeout {fail "(timeout) complete 'p' 2"}
186 -re ".*$gdb_prompt $" { fail "complete 'p'" }
187 timeout { fail "(timeout) complete 'p' 1" }
197 -re "The history is empty\\..*$gdb_prompt $"\
198 { pass "complete 'p '"}
199 -re ".*$gdb_prompt $" { fail "complete 'p '"}
200 timeout {fail "(timeout) complete 'p ' 1"}
203 -re ".*$gdb_prompt $" { fail "complete 'p '" }
204 timeout { fail "(timeout) complete 'p ' 2" }
208 send_gdb "info t foo\t"
211 -re "^info t foo\\\x07$"\
214 -re "Ambiguous info command \"t foo\": target, tasks, terminal, threads, tp, tracepoints, tvariables, types\\..*$gdb_prompt $"\
215 { pass "complete 'info t foo'"}
216 -re ".*$gdb_prompt $" { fail "complete 'info t foo'"}
217 timeout {fail "(timeout) complete 'info t foo'"}
220 -re ".*$gdb_prompt $" { fail "complete 'info t foo'" }
221 timeout { fail "(timeout) complete 'info t foo'" }
227 -re "^info t\\\x07$"\
230 -re "Ambiguous info command \"t\": target, tasks, terminal, threads, tp, tracepoints, tvariables, types\\..
232 { pass "complete 'info t'"}
233 -re ".*$gdb_prompt $" { fail "complete 'info t'"}
234 timeout {fail "(timeout) complete 'info t'"}
237 -re ".*$gdb_prompt $" { fail "complete 'info t'" }
238 timeout { fail "(timeout) complete 'info t'" }
245 -re "^info t \\\x07$"\
248 -re "Ambiguous info command \"t \": target, tasks, terminal, threads, tp, tracepoints, tvariables, types\\..
250 { pass "complete 'info t '"}
251 -re ".*$gdb_prompt $" { fail "complete 'info t '"}
252 timeout {fail "(timeout) complete 'info t '"}
255 -re ".*$gdb_prompt $" { fail "complete 'info t '" }
256 timeout { fail "(timeout) complete 'info t '" }
260 send_gdb "info asdfgh\t"
263 -re "^info asdfgh\\\x07$"\
266 -re "Undefined info command: \"asdfgh\". Try \"help info\"\\..
268 { pass "complete 'info asdfgh'"}
269 -re ".*$gdb_prompt $" { fail "complete 'info asdfgh'"}
270 timeout {fail "(timeout) complete 'info asdfgh'"}
273 -re ".*$gdb_prompt $" { fail "complete 'info asdfgh'" }
274 timeout { fail "(timeout) complete 'info asdfgh'" }
278 send_gdb "info asdfgh \t"
281 -re "^info asdfgh \\\x07$"\
284 -re "Undefined info command: \"asdfgh \". Try \"help info\"\\..
286 { pass "complete 'info asdfgh '"}
287 -re ".*$gdb_prompt $" { fail "complete 'info asdfgh '"}
288 timeout {fail "(timeout) complete 'info asdfgh '"}
291 -re ".*$gdb_prompt $" { fail "complete 'info asdfgh '" }
292 timeout { fail "(timeout) complete 'info asdfgh '" }
301 -re "\"info\" must be followed by the name of an info command\\.\r\nList of info subcommands.*$gdb_prompt $"\
302 { pass "complete 'info'"}
303 -re ".*$gdb_prompt $" { fail "complete 'info'"}
304 timeout {fail "(timeout) complete 'info'"}
307 -re ".*$gdb_prompt $" { fail "complete 'info'" }
308 timeout { fail "(timeout) complete 'info'" }
317 -re "\"info\" must be followed by the name of an info command\\.\r\nList of info subcommands:\r\n\r\n.*$gdb_prompt $"\
318 { pass "complete 'info '"}
319 -re ".*$gdb_prompt $" { fail "complete 'info '"}
320 timeout {fail "(timeout) complete 'info '"}
323 -re ".*$gdb_prompt $" { fail "complete 'info '" }
324 timeout { fail "(timeout) complete 'info '" }
334 -re "address.*types.*$gdb_prompt info $"\
337 -re "\"info\".*unambiguous\\..*$gdb_prompt $"\
338 { pass "complete (2) 'info '"}
339 -re ".*$gdb_prompt $" { fail "complete (2) 'info '"}
340 timeout {fail "(timeout) complete (2) 'info '"}
343 -re ".*$gdb_prompt $" { fail "complete (2) 'info '"}
344 timeout {fail "(timeout) complete (2) 'info '"}
347 -re ".*$gdb_prompt $" { fail "complete (2) 'info '" }
348 timeout { fail "(timeout) complete (2) 'info '" }
352 send_gdb "help info wat\t"
354 -re "^help info watchpoints $"\
357 -re "Synonym for .*\r\n.*$gdb_prompt $"\
358 { pass "complete help info wat" }
359 -re ".*$gdb_prompt $" { fail "complete help info wat"}
360 timeout {fail "(timeout) complete help info wat"}
363 -re "^help info wat\\\x07$" { fail "complete (2) help info wat" }
364 -re ".*$gdb_prompt $" { fail "complete (3) help info wat" }
365 timeout { fail "(timeout) complete (3) help info wat" }
369 send_gdb "p \"break1\t"
372 -re "^p \"break1\\\x07$"\
375 -re ".*$gdb_prompt $" { fail "complete 'p \"break1'"}
376 timeout {fail "(timeout) complete 'p \"break1'"}
379 -re "^p \"break1\\.c\"$"\
382 -re ".*$gdb_prompt $" { pass "complete 'p \"break1'"}
383 timeout {fail "(timeout) complete 'p \"break1'"}
389 -re ".*$gdb_prompt $" { fail "complete 'p \"break1'"}
390 timeout {fail "(timeout) complete 'p \"break1'"}
393 -re ".*$gdb_prompt $" { fail "complete 'p \"break1'" }
394 timeout { fail "(timeout) complete 'p \"break1'" }
398 send_gdb "p \"break1.\t"
401 -re "^p \"break1\\.\\\x07$"\
404 -re ".*$gdb_prompt $" { fail "complete 'p \"break1.'"}
405 timeout {fail "(timeout) complete 'p \"break1.'"}
408 -re "^p \"break1\\.c\"$"\
411 -re ".*$gdb_prompt $" { pass "complete 'p \"break1.'"}
412 timeout {fail "(timeout) complete 'p \"break1.'"}
415 -re "^p \"break1\\..*$"
418 -re ".*$gdb_prompt $" { fail "complete 'p \"break1.'"}
419 timeout {fail "(timeout) complete 'p \"break1.'"}
422 -re ".*$gdb_prompt $" { fail "complete 'p \"break1.'" }
423 timeout { fail "(timeout) complete 'p \"break1.'" }
429 -re "^p 'arg\\\x07$"\
432 -re "(Invalid character constant\\.|Unmatched single quote\\.).*$gdb_prompt $"\
433 { pass "complete 'p \'arg'"}
434 -re ".*$gdb_prompt $" { fail "complete 'p \'arg'"}
435 timeout {fail "(timeout) complete 'p \'arg'"}
438 -re ".*$gdb_prompt $" { fail "complete 'p \'arg'" }
439 timeout { fail "(timeout) complete 'p \'arg'" }
445 -re "^p 'arg\\\x07$" {
448 -re ".*argv.*$gdb_prompt p 'arg$" {
451 -re "(Invalid character constant\\.|Unmatched single quote\\.).*$gdb_prompt $" {
452 pass "complete (2) 'p \'arg'"
454 -re ".*$gdb_prompt $" { fail "complete (2) 'p \'arg'" }
455 timeout { fail "(timeout) complete (2) 'p \'arg'" }
458 -re "(There are $decimal possibilities\\. Do you really\r\nwish to see them all.|Display all $decimal possibilities.) \\(y or n\\)$" {
461 -re "\\(gdb\\) p 'arg$" {
464 -re "(Invalid character constant\\.|Unmatched single quote\\.).*$gdb_prompt $" {
465 pass "complete (2) 'p \'arg'"
467 -re ".*$gdb_prompt $" {
468 fail "complete (2) 'p \'arg'"
470 timeout { fail "(timeout) complete (2) 'p \'arg'" }
473 -re ".*$gdb_prompt $" { fail "complete (2) 'p \'arg'" }
474 timeout { fail "(timeout) complete (2) 'p \'arg'" }
477 -re ".*$gdb_prompt $" { fail "complete (2) 'p \'arg'" }
478 timeout { fail "(timeout) complete (2) 'p \'arg'" }
481 -re ".*$gdb_prompt $" { fail "complete (2) 'p \'arg'" }
482 timeout { fail "(timeout) complete (2) 'p \'arg'" }
486 # These tests used to try completing the shorter "p b-a".
487 # Unfortunately, on some systems, there are .o files in system
488 # libraries which declare static variables named `b'. Of course,
489 # those variables aren't really in scope, as far as the compiler is
490 # concerned. But GDB deliberately tries to be more liberal: if you
491 # enter an identifier that doesn't have any binding in scope, GDB will
492 # search all the program's compilation units for a static variable of
495 # This behavior can help avoid a lot of pedantry, so it's usually a
496 # good thing. But in this test case, it causes GDB to print the value
497 # of some random variable, instead of giving us the "No symbol..."
498 # error we were expecting.
500 # For example, on S/390 linux, the file s_atan.c in libm.a declares a
501 # `b', which is a structure containing an int and a float, so GDB says
502 # ``Argument to arithmetic operation not a number or boolean'' instead
503 # of ``No symbol ...''.
505 # So, I'm hoping that there is no system with a static library variable named
506 # `no_var_by_this_name'.
507 send_gdb "p no_var_named_this-arg\t"
510 -re "^p no_var_named_this-arg\\\x07$" {
513 -re "No symbol \"no_var_named_this\" in current context\\..*$gdb_prompt $" {
514 pass "complete 'p no_var_named_this-arg'"
516 -re ".*$gdb_prompt $" {
517 fail "complete 'p no_var_named_this-arg'"
520 fail "(timeout) complete 'p no_var_named_this-arg'"
524 -re ".*$gdb_prompt $" {
525 fail "complete 'p no_var_named_this-arg'"
528 fail "(timeout) complete 'p no_var_named_this-arg'"
532 send_gdb "p no_var_named_this-arg\t"
535 -re "^p no_var_named_this-arg\\\x07$" {
538 -re ".*argv.*$gdb_prompt p no_var_named_this-arg$" {
541 -re "No symbol \"no_var_named_this\" in current context\\..*$gdb_prompt $" {
542 pass "complete (2) 'p no_var_named_this-arg'"
544 -re ".*$gdb_prompt $" {
545 fail "complete (2) 'p no_var_named_this-arg'"
548 fail "(timeout) complete (2) 'p no_var_named_this-arg'"
552 -re "(There are $decimal possibilities\\. Do you really\r\nwish to see them all.|Display all $decimal possibilities.) \\(y or n\\)$" {
555 -re "\\(gdb\\) p no_var_named_this-arg$" {
558 -re "No symbol \"no_var_named_this\" in current context\\..*$gdb_prompt $" {
559 pass "complete (2) 'p no_var_named_this-arg'"
561 -re ".*$gdb_prompt $" {
562 fail "complete (2) 'p no_var_named_this-arg'"
565 fail "(timeout) complete (2) 'p no_var_named_this-arg'"
569 -re ".*$gdb_prompt $" {
570 fail "complete (2) 'p no_var_named_this-arg'"
573 fail "(timeout) complete (2) 'p no_var_named_this-arg'"
577 -re ".*$gdb_prompt $" {
578 fail "complete (2) 'p no_var_named_this-arg'"
580 timeout { fail "(timeout) complete (2) 'p no_var_named_this-arg'" }
583 -re ".*$gdb_prompt $" { fail "complete (2) 'p no_var_named_this-arg'" }
584 timeout { fail "(timeout) complete (2) 'p no_var_named_this-arg'" }
587 send_gdb "p no_var_named_this-\t"
590 -re "^p no_var_named_this-\\\x07$" {
593 -re "(There are $decimal possibilities\\. Do you really\r\nwish to see them all.|Display all $decimal possibilities.) \\(y or n\\)$" {
596 -re "\\(gdb\\) p no_var_named_this-$" {
599 -re "No symbol \"no_var_named_this\" in current context\\..*$gdb_prompt $" {
600 pass "complete (2) 'p no_var_named_this-'"
602 -re ".*$gdb_prompt $" {
603 fail "complete (2) 'p no_var_named_this-'"
606 fail "(timeout) complete (2) 'p no_var_named_this-'"
610 -re ".*$gdb_prompt $" {
611 fail "complete (2) 'p no_var_named_this-'"
614 fail "(timeout) complete (2) 'p no_var_named_this-'"
618 -re ".*argv.*$gdb_prompt p no_var_named_this-$" {
621 -re "No symbol \"no_var_named_this\" in current context\\..*$gdb_prompt $" {
622 pass "complete (2) 'p no_var_named_this-'"
624 -re ".*$gdb_prompt $" {
625 fail "complete (2) 'p no_var_named_this-'"
628 fail "(timeout) complete (2) 'p no_var_named_this-'"
632 -re ".*$gdb_prompt $" {
633 fail "complete (2) 'p no_var_named_this-'"
635 timeout { fail "(timeout) complete (2) 'p no_var_named_this-'" }
638 -re ".*$gdb_prompt $" { fail "complete (2) 'p no_var_named_this-'" }
639 timeout { fail "(timeout) complete (2) 'p no_var_named_this-'" }
642 send_gdb "p values\[0\].a\t"
645 -re "^p values.0..a_field $"\
649 -re "^.* = 0.*$gdb_prompt $"\
650 { pass "complete 'p values\[0\].a'"}
651 -re ".*$gdb_prompt $" { fail "complete 'p values\[0\].a'"}
652 timeout {fail "(timeout) complete 'p values\[0\].a'"}
655 -re ".*$gdb_prompt $" { fail "complete 'p values\[0\].a'" }
656 timeout { fail "(timeout) complete 'p values\[0\].a' 2" }
659 send_gdb "p values\[0\] . a\t"
661 -re "^p values.0. . a_field $"\
664 -re "^.* = 0.*$gdb_prompt $"\
665 { pass "complete 'p values\[0\] . a'"}
666 -re ".*$gdb_prompt $" { fail "complete 'p values\[0\] . a'"}
667 timeout {fail "(timeout) complete 'p values\[0\] . a'"}
670 -re ".*$gdb_prompt $" { fail "complete 'p values\[0\] . a'" }
671 timeout { fail "(timeout) complete 'p values\[0\] . a' 2" }
674 send_gdb "p &values\[0\] -> a\t"
676 -re "^p &values.0. -> a_field $"\
679 -re "^.* = .*0x\[0-9a-fA-F\]*.*$gdb_prompt $"\
680 { pass "complete 'p &values\[0\] -> a'"}
681 -re ".*$gdb_prompt $" { fail "complete 'p &values\[0\] -> a'"}
682 timeout {fail "(timeout) complete 'p &values\[0\] -> a'"}
685 -re ".*$gdb_prompt $" { fail "complete 'p &values\[0\] -> a'" }
686 timeout { fail "(timeout) complete 'p &values\[0\] -> a' 2" }
689 # The following tests used to simply try to complete `${objdir}/file',
690 # and so on. The problem is that ${objdir} can be very long; the
691 # completed filename may be more than eighty characters wide. When
692 # this happens, readline tries to manage things, producing output that
693 # may make sense on the screen, but is rather hard for our script to
696 # In the case that motivated this change, the (gdb) prompt occupied
697 # the leftmost six columns, and `${objdir}/' was seventy-four
698 # characters long --- eighty in all. After printing the slash,
699 # readline emitted a space, a carriage return, and then `Makefile'
700 # (the tab character being received as input after `Make'.
702 # Basically, you have to let readline do whatever it's going to do to
703 # make the screen look right. If it happens to use a different
704 # strategy on Tuesdays to get the cursor in the right place, that's
705 # not something the testsuite should care about.
707 # So, we avoid long lines. We `cd' to ${objdir} first, and then do
708 # the completion relative to the current directory.
710 # ${srcdir} may be a relative path. We want to make sure we end up
711 # in the right directory - so make sure we know where it is.
717 # If the directory name contains a '+' we must escape it, adding a backslash.
718 # If not, the test below will fail because it will interpret the '+' as a
719 # regexp operator. We use string_to_regexp for this purpose.
721 gdb_test "cd ${fullsrcdir}" \
722 "Working directory [string_to_regexp ${fullsrcdir}].*" \
726 # GDB used to fail adding / on directories, on the first try only.
727 set uniquedir ../testsuite/gdb.base/comp-dir
728 set escapeduniquedir [string_to_regexp ${uniquedir}]
730 set uniquesub ${uniquesu}r
731 set escapeuniquesub [string_to_regexp ${uniquesub}]
732 send_gdb "dir ${uniquedir}\t"
734 -re "${escapeduniquedir}/" {
735 pass "directory completion"
736 send_gdb "${uniquesu}\t"
738 -re "${escapeduniquedir} $" {
739 fail "directory completion (old gdb bug)"
740 send_gdb "\b/${uniquesu}\t"
743 fail "directory completion (timeout)"
744 send_gdb "\ndir ${uniquedir}/${uniquesu}\t"
749 -re "${escapeuniquesub}/$" {
750 pass "directory completion 2"
753 fail "directory completion 2"
757 # Empty COMMAND sends no newline while " " sends the newline we need.
758 gdb_test " " "Source directories searched: .*" "Glob remaining of directory test"
761 send_gdb "complete file ./gdb.base/compl\n"
764 -re "file ./gdb.base/completion\\.exp.*$gdb_prompt $"
765 { pass "complete-command 'file ./gdb.base/compl'"}
766 -re ".*$gdb_prompt $" { fail "complete-command 'file ./gdb.base/compl'" }
767 timeout { fail "(timeout) complete-command 'file ./gdb.base/compl'" }
770 send_gdb "file ./gdb.base/complet\t"
773 -re "^file ./gdb.base/completion\\.exp $"\
775 # Ignore the exact error message.
776 gdb_test_multiple "" "complete 'file ./gdb.base/complet'" {
777 -re "\r\nA program is being debugged already\\.\[\r\n\]+Are you sure you want to change the file\\? \\(y or n\\) $" {
781 -re ".*$gdb_prompt $" { pass "complete 'file ./gdb.base/complet'" }
784 -re ".*$gdb_prompt $" { fail "complete 'file ./gdb.base/complet'" }
785 timeout { fail "(timeout) complete 'file ./gdb.base/complet'" }
788 send_gdb "info func marke\t"
791 -re "^info func marke.*r$"\
796 -re "marker1.*$gdb_prompt info func marker$"\
799 -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 $"\
800 { pass "complete 'info func marke'"}
801 -re ".*$gdb_prompt $" { fail "complete 'info func marke'"}
802 timeout {fail "(timeout) complete 'info func marke'"}
805 -re ".*$gdb_prompt $" { fail "complete 'info func marke'"}
806 timeout {fail "(timeout) complete 'info func marke'"}
809 -re ".*$gdb_prompt $" { fail "complete 'info func marke'" }
810 timeout { fail "(timeout) complete 'info func marke'" }
814 send_gdb "set follow-fork-mode \t\t"
817 -re "child.*parent.*$gdb_prompt set follow-fork-mode $"\
820 -re "Requires an argument.*child.*parent.*$gdb_prompt $"\
821 { pass "complete 'set follow-fork-mode'"}
822 -re "Ambiguous item \"\"\\..*$gdb_prompt $"\
823 { pass "complete 'set follow-fork-mode'"}
824 -re ".*$gdb_prompt $" { fail "complete 'set follow-fork-mode'"}
825 timeout {fail "(timeout) complete 'set follow-fork-mode'"}
828 -re ".*$gdb_prompt $" { fail "complete 'set follow-fork-mode'" }
829 timeout { fail "(timeout) complete 'set follow-fork-mode'" }
832 send_gdb "p values\[0\].nonex.\t"
834 -re "Type struct some_struct has no component named nonex.\r\n$gdb_prompt $"\
835 { pass "Completing non-existing component" }
836 -re ".*$gdb_prompt $" { fail "Completing non-existing component" }
837 timeout { fail "(timeout) Completing non-existing component" }
838 eof { fail "(eof) Completing non-existing component #2" }
840 # Double memory freeing gets found only on the second run:
841 send_gdb "p values\[0\].nonex.\t"
843 -re "Type struct some_struct has no component named nonex.\r\n$gdb_prompt $"\
844 { pass "Completing non-existing component #2" }
845 -re ".*$gdb_prompt $" { fail "Completing non-existing component #2" }
846 timeout { fail "(timeout) Completing non-existing component #2" }
847 eof { fail "(eof) Completing non-existing component #2" }
850 # Restore globals modified in this test...
851 set timeout $oldtimeout1