1 # Copyright 1998, 1999, 2002, 2003, 2004, 2007, 2008, 2009
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}] {
88 # Don't let a .inputrc file or an existing setting of INPUTRC mess up
89 # the test results. Even if /dev/null doesn't exist on the particular
90 # platform, the readline library will use the default setting just by
91 # failing to open the file. OTOH, opening /dev/null successfully will
92 # also result in the default settings being used since nothing will be
93 # read from this file.
95 if [info exists env(INPUTRC)] {
96 set old_inputrc $env(INPUTRC)
98 set env(INPUTRC) "/dev/null"
101 gdb_reinitialize_dir $srcdir/$subdir
104 if ![runto_main] then {
105 perror "tests suppressed"
108 set oldtimeout1 $timeout
118 -re "Undefined command: \"hfgfh\"\\. Try \"help\"\\..*$gdb_prompt $"\
119 { pass "complete 'hfgfh'"}
120 -re ".*$gdb_prompt $" { fail "complete 'hfgfh'"}
121 timeout {fail "(timeout) complete 'hfgfh'"}
124 -re ".*$gdb_prompt $" { fail "complete 'hfgfh'" }
125 timeout { fail "(timeout) complete 'hfgfh'" }
130 send_gdb "show output\t"
133 -re "^show output-radix $"\
136 -re "Default output radix for printing of values is 10\\..*$gdb_prompt $"\
137 { pass "complete 'show output'"}
138 -re ".*$gdb_prompt $" { fail "complete 'show output'"}
139 timeout {fail "(timeout) complete 'show output'"}
145 -re "Default output radix for printing of values is 10\\..*$gdb_prompt $"\
146 { fail "complete 'show output'"}
147 -re ".*$gdb_prompt $" { fail "complete 'show output'"}
148 timeout { fail "(timeout) complete 'show output'"}
153 -re ".*$gdb_prompt $" { fail "complete 'show output'" }
154 timeout { fail "(timeout) complete 'show output'" }
158 send_gdb "show output-\t"
161 -re "^show output-radix $"\
164 -re "Default output radix for printing of values is 10\\..*$gdb_prompt $"\
165 { pass "complete 'show output-'"}
166 -re ".*$gdb_prompt $" { fail "complete 'show output-'"}
167 timeout {fail "(timeout) complete 'show output-'"}
170 -re "^show output-$"\
173 -re "Default output radix for printing of values is 10\\..*$gdb_prompt $"\
174 { fail "complete 'show output-'"}
175 -re ".*$gdb_prompt $" { fail "complete 'show output-'"}
176 timeout { fail "(timeout) complete 'show output-'"}
181 -re ".*$gdb_prompt $" { fail "complete 'show output-'" }
182 timeout { fail "(timeout) complete 'show output-'" }
192 -re "The history is empty\\..*$gdb_prompt $"\
193 { pass "complete 'p'"}
194 -re ".*$gdb_prompt $" { fail "complete 'p'"}
195 timeout {fail "(timeout) complete 'p' 2"}
198 -re ".*$gdb_prompt $" { fail "complete 'p'" }
199 timeout { fail "(timeout) complete 'p' 1" }
209 -re "The history is empty\\..*$gdb_prompt $"\
210 { pass "complete 'p '"}
211 -re ".*$gdb_prompt $" { fail "complete 'p '"}
212 timeout {fail "(timeout) complete 'p ' 1"}
215 -re ".*$gdb_prompt $" { fail "complete 'p '" }
216 timeout { fail "(timeout) complete 'p ' 2" }
220 send_gdb "info t foo\t"
223 -re "^info t foo\\\x07$"\
226 -re "Ambiguous info command \"t foo\": target, tasks, terminal, threads, tp, tracepoints, types\\..*$gdb_prompt $"\
227 { pass "complete 'info t foo'"}
228 -re ".*$gdb_prompt $" { fail "complete 'info t foo'"}
229 timeout {fail "(timeout) complete 'info t foo'"}
232 -re ".*$gdb_prompt $" { fail "complete 'info t foo'" }
233 timeout { fail "(timeout) complete 'info t foo'" }
239 -re "^info t\\\x07$"\
242 -re "Ambiguous info command \"t\": target, tasks, terminal, threads, tp, tracepoints, types\\..
244 { pass "complete 'info t'"}
245 -re ".*$gdb_prompt $" { fail "complete 'info t'"}
246 timeout {fail "(timeout) complete 'info t'"}
249 -re ".*$gdb_prompt $" { fail "complete 'info t'" }
250 timeout { fail "(timeout) complete 'info t'" }
257 -re "^info t \\\x07$"\
260 -re "Ambiguous info command \"t \": target, tasks, terminal, threads, tp, tracepoints, types\\..
262 { pass "complete 'info t '"}
263 -re ".*$gdb_prompt $" { fail "complete 'info t '"}
264 timeout {fail "(timeout) complete 'info t '"}
267 -re ".*$gdb_prompt $" { fail "complete 'info t '" }
268 timeout { fail "(timeout) complete 'info t '" }
272 send_gdb "info asdfgh\t"
275 -re "^info asdfgh\\\x07$"\
278 -re "Undefined info command: \"asdfgh\". Try \"help info\"\\..
280 { pass "complete 'info asdfgh'"}
281 -re ".*$gdb_prompt $" { fail "complete 'info asdfgh'"}
282 timeout {fail "(timeout) complete 'info asdfgh'"}
285 -re ".*$gdb_prompt $" { fail "complete 'info asdfgh'" }
286 timeout { fail "(timeout) complete 'info asdfgh'" }
290 send_gdb "info asdfgh \t"
293 -re "^info asdfgh \\\x07$"\
296 -re "Undefined info command: \"asdfgh \". Try \"help info\"\\..
298 { pass "complete 'info asdfgh '"}
299 -re ".*$gdb_prompt $" { fail "complete 'info asdfgh '"}
300 timeout {fail "(timeout) complete 'info asdfgh '"}
303 -re ".*$gdb_prompt $" { fail "complete 'info asdfgh '" }
304 timeout { fail "(timeout) complete 'info asdfgh '" }
313 -re "\"info\" must be followed by the name of an info command\\.\r\nList of info subcommands.*$gdb_prompt $"\
314 { pass "complete 'info'"}
315 -re ".*$gdb_prompt $" { fail "complete 'info'"}
316 timeout {fail "(timeout) complete 'info'"}
319 -re ".*$gdb_prompt $" { fail "complete 'info'" }
320 timeout { fail "(timeout) complete 'info'" }
329 -re "\"info\" must be followed by the name of an info command\\.\r\nList of info subcommands:\r\n\r\n.*$gdb_prompt $"\
330 { pass "complete 'info '"}
331 -re ".*$gdb_prompt $" { fail "complete 'info '"}
332 timeout {fail "(timeout) complete 'info '"}
335 -re ".*$gdb_prompt $" { fail "complete 'info '" }
336 timeout { fail "(timeout) complete 'info '" }
346 -re "address.*types.*$gdb_prompt info $"\
349 -re "\"info\".*unambiguous\\..*$gdb_prompt $"\
350 { pass "complete (2) 'info '"}
351 -re ".*$gdb_prompt $" { fail "complete (2) 'info '"}
352 timeout {fail "(timeout) complete (2) 'info '"}
355 -re ".*$gdb_prompt $" { fail "complete (2) 'info '"}
356 timeout {fail "(timeout) complete (2) 'info '"}
359 -re ".*$gdb_prompt $" { fail "complete (2) 'info '" }
360 timeout { fail "(timeout) complete (2) 'info '" }
364 send_gdb "help info wat\t"
366 -re "^help info watchpoints $"\
369 -re "Synonym for .*\r\n.*$gdb_prompt $"\
370 { pass "complete help info wat" }
371 -re ".*$gdb_prompt $" { fail "complete help info wat"}
372 timeout {fail "(timeout) complete help info wat"}
375 -re "^help info wat\\\x07$" { fail "complete (2) help info wat" }
376 -re ".*$gdb_prompt $" { fail "complete (3) help info wat" }
377 timeout { fail "(timeout) complete (3) help info wat" }
381 send_gdb "p \"break1\t"
384 -re "^p \"break1\\\x07$"\
387 -re ".*$gdb_prompt $" { fail "complete 'p \"break1'"}
388 timeout {fail "(timeout) complete 'p \"break1'"}
391 -re "^p \"break1\\.c\"$"\
394 -re ".*$gdb_prompt $" { pass "complete 'p \"break1'"}
395 timeout {fail "(timeout) complete 'p \"break1'"}
401 -re ".*$gdb_prompt $" { fail "complete 'p \"break1'"}
402 timeout {fail "(timeout) complete 'p \"break1'"}
405 -re ".*$gdb_prompt $" { fail "complete 'p \"break1'" }
406 timeout { fail "(timeout) complete 'p \"break1'" }
410 send_gdb "p \"break1.\t"
413 -re "^p \"break1\\.\\\x07$"\
416 -re ".*$gdb_prompt $" { fail "complete 'p \"break1.'"}
417 timeout {fail "(timeout) complete 'p \"break1.'"}
420 -re "^p \"break1\\.c\"$"\
423 -re ".*$gdb_prompt $" { pass "complete 'p \"break1.'"}
424 timeout {fail "(timeout) complete 'p \"break1.'"}
427 -re "^p \"break1\\..*$"
430 -re ".*$gdb_prompt $" { fail "complete 'p \"break1.'"}
431 timeout {fail "(timeout) complete 'p \"break1.'"}
434 -re ".*$gdb_prompt $" { fail "complete 'p \"break1.'" }
435 timeout { fail "(timeout) complete 'p \"break1.'" }
441 -re "^p 'arg\\\x07$"\
444 -re "(Invalid character constant\\.|Unmatched single quote\\.).*$gdb_prompt $"\
445 { pass "complete 'p \'arg'"}
446 -re ".*$gdb_prompt $" { fail "complete 'p \'arg'"}
447 timeout {fail "(timeout) complete 'p \'arg'"}
450 -re ".*$gdb_prompt $" { fail "complete 'p \'arg'" }
451 timeout { fail "(timeout) complete 'p \'arg'" }
457 -re "^p 'arg\\\x07$" {
460 -re ".*argv.*$gdb_prompt p 'arg$" {
463 -re "(Invalid character constant\\.|Unmatched single quote\\.).*$gdb_prompt $" {
464 pass "complete (2) 'p \'arg'"
466 -re ".*$gdb_prompt $" { fail "complete (2) 'p \'arg'" }
467 timeout { fail "(timeout) complete (2) 'p \'arg'" }
470 -re "(There are $decimal possibilities\\. Do you really\r\nwish to see them all.|Display all $decimal possibilities.) \\(y or n\\)$" {
473 -re "\\(gdb\\) p 'arg$" {
476 -re "(Invalid character constant\\.|Unmatched single quote\\.).*$gdb_prompt $" {
477 pass "complete (2) 'p \'arg'"
479 -re ".*$gdb_prompt $" {
480 fail "complete (2) 'p \'arg'"
482 timeout { fail "(timeout) complete (2) 'p \'arg'" }
485 -re ".*$gdb_prompt $" { fail "complete (2) 'p \'arg'" }
486 timeout { fail "(timeout) complete (2) 'p \'arg'" }
489 -re ".*$gdb_prompt $" { fail "complete (2) 'p \'arg'" }
490 timeout { fail "(timeout) complete (2) 'p \'arg'" }
493 -re ".*$gdb_prompt $" { fail "complete (2) 'p \'arg'" }
494 timeout { fail "(timeout) complete (2) 'p \'arg'" }
498 # These tests used to try completing the shorter "p b-a".
499 # Unfortunately, on some systems, there are .o files in system
500 # libraries which declare static variables named `b'. Of course,
501 # those variables aren't really in scope, as far as the compiler is
502 # concerned. But GDB deliberately tries to be more liberal: if you
503 # enter an identifier that doesn't have any binding in scope, GDB will
504 # search all the program's compilation units for a static variable of
507 # This behavior can help avoid a lot of pedantry, so it's usually a
508 # good thing. But in this test case, it causes GDB to print the value
509 # of some random variable, instead of giving us the "No symbol..."
510 # error we were expecting.
512 # For example, on S/390 linux, the file s_atan.c in libm.a declares a
513 # `b', which is a structure containing an int and a float, so GDB says
514 # ``Argument to arithmetic operation not a number or boolean'' instead
515 # of ``No symbol ...''.
517 # So, I'm hoping that there is no system with a static library variable named
518 # `no_var_by_this_name'.
519 send_gdb "p no_var_named_this-arg\t"
522 -re "^p no_var_named_this-arg\\\x07$" {
525 -re "No symbol \"no_var_named_this\" in current context\\..*$gdb_prompt $" {
526 pass "complete 'p no_var_named_this-arg'"
528 -re ".*$gdb_prompt $" {
529 fail "complete 'p no_var_named_this-arg'"
532 fail "(timeout) complete 'p no_var_named_this-arg'"
536 -re ".*$gdb_prompt $" {
537 fail "complete 'p no_var_named_this-arg'"
540 fail "(timeout) complete 'p no_var_named_this-arg'"
544 send_gdb "p no_var_named_this-arg\t"
547 -re "^p no_var_named_this-arg\\\x07$" {
550 -re ".*argv.*$gdb_prompt p no_var_named_this-arg$" {
553 -re "No symbol \"no_var_named_this\" in current context\\..*$gdb_prompt $" {
554 pass "complete (2) 'p no_var_named_this-arg'"
556 -re ".*$gdb_prompt $" {
557 fail "complete (2) 'p no_var_named_this-arg'"
560 fail "(timeout) complete (2) 'p no_var_named_this-arg'"
564 -re "(There are $decimal possibilities\\. Do you really\r\nwish to see them all.|Display all $decimal possibilities.) \\(y or n\\)$" {
567 -re "\\(gdb\\) p no_var_named_this-arg$" {
570 -re "No symbol \"no_var_named_this\" in current context\\..*$gdb_prompt $" {
571 pass "complete (2) 'p no_var_named_this-arg'"
573 -re ".*$gdb_prompt $" {
574 fail "complete (2) 'p no_var_named_this-arg'"
577 fail "(timeout) complete (2) 'p no_var_named_this-arg'"
581 -re ".*$gdb_prompt $" {
582 fail "complete (2) 'p no_var_named_this-arg'"
585 fail "(timeout) complete (2) 'p no_var_named_this-arg'"
589 -re ".*$gdb_prompt $" {
590 fail "complete (2) 'p no_var_named_this-arg'"
592 timeout { fail "(timeout) complete (2) 'p no_var_named_this-arg'" }
595 -re ".*$gdb_prompt $" { fail "complete (2) 'p no_var_named_this-arg'" }
596 timeout { fail "(timeout) complete (2) 'p no_var_named_this-arg'" }
599 send_gdb "p no_var_named_this-\t"
602 -re "^p no_var_named_this-\\\x07$" {
605 -re "(There are $decimal possibilities\\. Do you really\r\nwish to see them all.|Display all $decimal possibilities.) \\(y or n\\)$" {
608 -re "\\(gdb\\) p no_var_named_this-$" {
611 -re "No symbol \"no_var_named_this\" in current context\\..*$gdb_prompt $" {
612 pass "complete (2) 'p no_var_named_this-'"
614 -re ".*$gdb_prompt $" {
615 fail "complete (2) 'p no_var_named_this-'"
618 fail "(timeout) complete (2) 'p no_var_named_this-'"
622 -re ".*$gdb_prompt $" {
623 fail "complete (2) 'p no_var_named_this-'"
626 fail "(timeout) complete (2) 'p no_var_named_this-'"
630 -re ".*argv.*$gdb_prompt p no_var_named_this-$" {
633 -re "No symbol \"no_var_named_this\" in current context\\..*$gdb_prompt $" {
634 pass "complete (2) 'p no_var_named_this-'"
636 -re ".*$gdb_prompt $" {
637 fail "complete (2) 'p no_var_named_this-'"
640 fail "(timeout) complete (2) 'p no_var_named_this-'"
644 -re ".*$gdb_prompt $" {
645 fail "complete (2) 'p no_var_named_this-'"
647 timeout { fail "(timeout) complete (2) 'p no_var_named_this-'" }
650 -re ".*$gdb_prompt $" { fail "complete (2) 'p no_var_named_this-'" }
651 timeout { fail "(timeout) complete (2) 'p no_var_named_this-'" }
654 send_gdb "p values\[0\].a\t"
657 -re "^p values.0..a_field $"\
661 -re "^.* = 0.*$gdb_prompt $"\
662 { pass "complete 'p values\[0\].a'"}
663 -re ".*$gdb_prompt $" { fail "complete 'p values\[0\].a'"}
664 timeout {fail "(timeout) complete 'p values\[0\].a'"}
667 -re ".*$gdb_prompt $" { fail "complete 'p values\[0\].a'" }
668 timeout { fail "(timeout) complete 'p values\[0\].a' 2" }
671 send_gdb "p values\[0\] . a\t"
673 -re "^p values.0. . a_field $"\
676 -re "^.* = 0.*$gdb_prompt $"\
677 { pass "complete 'p values\[0\] . a'"}
678 -re ".*$gdb_prompt $" { fail "complete 'p values\[0\] . a'"}
679 timeout {fail "(timeout) complete 'p values\[0\] . a'"}
682 -re ".*$gdb_prompt $" { fail "complete 'p values\[0\] . a'" }
683 timeout { fail "(timeout) complete 'p values\[0\] . a' 2" }
686 send_gdb "p &values\[0\] -> a\t"
688 -re "^p &values.0. -> a_field $"\
691 -re "^.* = .*0x\[0-9a-fA-F\]*.*$gdb_prompt $"\
692 { pass "complete 'p &values\[0\] -> a'"}
693 -re ".*$gdb_prompt $" { fail "complete 'p &values\[0\] -> a'"}
694 timeout {fail "(timeout) complete 'p &values\[0\] -> a'"}
697 -re ".*$gdb_prompt $" { fail "complete 'p &values\[0\] -> a'" }
698 timeout { fail "(timeout) complete 'p &values\[0\] -> a' 2" }
701 # The following tests used to simply try to complete `${objdir}/file',
702 # and so on. The problem is that ${objdir} can be very long; the
703 # completed filename may be more than eighty characters wide. When
704 # this happens, readline tries to manage things, producing output that
705 # may make sense on the screen, but is rather hard for our script to
708 # In the case that motivated this change, the (gdb) prompt occupied
709 # the leftmost six columns, and `${objdir}/' was seventy-four
710 # characters long --- eighty in all. After printing the slash,
711 # readline emitted a space, a carriage return, and then `Makefile'
712 # (the tab character being received as input after `Make'.
714 # Basically, you have to let readline do whatever it's going to do to
715 # make the screen look right. If it happens to use a different
716 # strategy on Tuesdays to get the cursor in the right place, that's
717 # not something the testsuite should care about.
719 # So, we avoid long lines. We `cd' to ${objdir} first, and then do
720 # the completion relative to the current directory.
722 # ${srcdir} may be a relative path. We want to make sure we end up
723 # in the right directory - so make sure we know where it is.
729 # If the directory name contains a '+' we must escape it, adding a backslash.
730 # If not, the test below will fail because it will interpret the '+' as a
731 # regexp operator. We use string_to_regexp for this purpose.
733 gdb_test "cd ${fullsrcdir}" \
734 "Working directory [string_to_regexp ${fullsrcdir}].*" \
738 # GDB used to fail adding / on directories, on the first try only
739 send_gdb "dir ../testsu\t"
741 -re "../testsuite/$" {
742 pass "directory completion"
745 -re "../testsuite $" {
746 fail "directory completion (old gdb bug)"
747 send_gdb "\b/gdb.bas\t"
750 fail "directory completion (timeout)"
751 send_gdb "\ndir ../testsuite/gdb.bas\t"
757 pass "directory completion 2"
760 fail "directory completion 2"
764 gdb_test "\n" "" "Glob remaining of directory test"
767 send_gdb "complete file ./gdb.base/compl\n"
770 -re "file ./gdb.base/completion\\.exp.*$gdb_prompt $"
771 { pass "complete-command 'file ./gdb.base/compl'"}
772 -re ".*$gdb_prompt $" { fail "complete-command 'file ./gdb.base/compl'" }
773 timeout { fail "(timeout) complete-command 'file ./gdb.base/compl'" }
776 send_gdb "file ./gdb.base/complet\t"
779 -re "^file ./gdb.base/completion\\.exp $"\
781 # Ignore the exact error message.
782 gdb_test_multiple "" "complete 'file ./gdb.base/complet'" {
783 -re "\r\nA program is being debugged already\\.\[\r\n\]+Are you sure you want to change the file\\? \\(y or n\\) $" {
787 -re ".*$gdb_prompt $" { pass "complete 'file ./gdb.base/complet'" }
790 -re ".*$gdb_prompt $" { fail "complete 'file ./gdb.base/complet'" }
791 timeout { fail "(timeout) complete 'file ./gdb.base/complet'" }
794 send_gdb "info func marke\t"
797 -re "^info func marke.*r$"\
802 -re "marker1.*$gdb_prompt info func marker$"\
805 -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 $"\
806 { pass "complete 'info func marke'"}
807 -re ".*$gdb_prompt $" { fail "complete 'info func marke'"}
808 timeout {fail "(timeout) complete 'info func marke'"}
811 -re ".*$gdb_prompt $" { fail "complete 'info func marke'"}
812 timeout {fail "(timeout) complete 'info func marke'"}
815 -re ".*$gdb_prompt $" { fail "complete 'info func marke'" }
816 timeout { fail "(timeout) complete 'info func marke'" }
820 send_gdb "set follow-fork-mode \t\t"
823 -re "child.*parent.*$gdb_prompt set follow-fork-mode $"\
826 -re "Requires an argument.*child.*parent.*$gdb_prompt $"\
827 { pass "complete 'set follow-fork-mode'"}
828 -re "Ambiguous item \"\"\\..*$gdb_prompt $"\
829 { pass "complete 'set follow-fork-mode'"}
830 -re ".*$gdb_prompt $" { fail "complete 'set follow-fork-mode'"}
831 timeout {fail "(timeout) complete 'set follow-fork-mode'"}
834 -re ".*$gdb_prompt $" { fail "complete 'set follow-fork-mode'" }
835 timeout { fail "(timeout) complete 'set follow-fork-mode'" }
838 send_gdb "p values\[0\].nonex.\t"
840 -re "Type struct some_struct has no component named nonex.\r\n$gdb_prompt $"\
841 { pass "Completing non-existing component" }
842 -re ".*$gdb_prompt $" { fail "Completing non-existing component" }
843 timeout { fail "(timeout) Completing non-existing component" }
844 eof { fail "(eof) Completing non-existing component #2" }
846 # Double memory freeing gets found only on the second run:
847 send_gdb "p values\[0\].nonex.\t"
849 -re "Type struct some_struct has no component named nonex.\r\n$gdb_prompt $"\
850 { pass "Completing non-existing component #2" }
851 -re ".*$gdb_prompt $" { fail "Completing non-existing component #2" }
852 timeout { fail "(timeout) Completing non-existing component #2" }
853 eof { fail "(eof) Completing non-existing component #2" }
856 # Restore globals modified in this test...
857 if [info exists old_inputrc] {
858 set env(INPUTRC) $old_inputrc
862 set timeout $oldtimeout1