summaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base/completion.exp
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite/gdb.base/completion.exp')
-rw-r--r--gdb/testsuite/gdb.base/completion.exp84
1 files changed, 51 insertions, 33 deletions
diff --git a/gdb/testsuite/gdb.base/completion.exp b/gdb/testsuite/gdb.base/completion.exp
index a1ff58a2554..1698a3056d3 100644
--- a/gdb/testsuite/gdb.base/completion.exp
+++ b/gdb/testsuite/gdb.base/completion.exp
@@ -1,4 +1,4 @@
-# Copyright 1998, 1999, 2002, 2003 Free Software Foundation, Inc.
+# Copyright 1998, 1999, 2002, 2003, 2004 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -38,8 +38,8 @@
# "info ajksdlfk " no completions
# "info" " "
# "info " ambiguous (all info commands)
-# "p \"break" unambiguous (completes to filename "break.c")
-# "p \"break." unambiguous (should complete to "break.c" but does not,
+# "p \"break1" unambiguous (completes to filename "break1.c")
+# "p \"break1." unambiguous (should complete to "break1.c" but does not,
# due to readline limitations)
# "p 'a" ambiguous (all symbols starting with a)
# "p b-a" ambiguous (all symbols starting with a)
@@ -64,9 +64,19 @@ set bug_id 0
set testfile "break"
set srcfile ${testfile}.c
+set srcfile1 ${testfile}1.c
set binfile ${objdir}/${subdir}/${testfile}
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-w}] != "" } {
- gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}0.o" object {debug additional_flags=-w}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile1}" "${binfile}1.o" object {debug additional_flags=-w}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+if { [gdb_compile "${binfile}0.o ${binfile}1.o" "${binfile}" executable {debug additional_flags=-w}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
if [get_compiler_info ${binfile}] {
@@ -351,61 +361,61 @@ gdb_expect {
}
-send_gdb "p \"break\t"
+send_gdb "p \"break1\t"
sleep 1
gdb_expect {
- -re "^p \"break\\\x07$"\
+ -re "^p \"break1\\\x07$"\
{ send_gdb "\n"
gdb_expect {
- -re ".*$gdb_prompt $" { fail "complete 'p \"break'"}
- timeout {fail "(timeout) complete 'p \"break'"}
+ -re ".*$gdb_prompt $" { fail "complete 'p \"break1'"}
+ timeout {fail "(timeout) complete 'p \"break1'"}
}
}
- -re "^p \"break\\.c\"$"\
+ -re "^p \"break1\\.c\"$"\
{ send_gdb "\n"
gdb_expect {
- -re ".*$gdb_prompt $" { pass "complete 'p \"break'"}
- timeout {fail "(timeout) complete 'p \"break'"}
+ -re ".*$gdb_prompt $" { pass "complete 'p \"break1'"}
+ timeout {fail "(timeout) complete 'p \"break1'"}
}
}
- -re "^p \"break.*$"
+ -re "^p \"break1.*$"
{ send_gdb "\n"
gdb_expect {
- -re ".*$gdb_prompt $" { fail "complete 'p \"break'"}
- timeout {fail "(timeout) complete 'p \"break'"}
+ -re ".*$gdb_prompt $" { fail "complete 'p \"break1'"}
+ timeout {fail "(timeout) complete 'p \"break1'"}
}
}
- -re ".*$gdb_prompt $" { fail "complete 'p \"break'" }
- timeout { fail "(timeout) complete 'p \"break'" }
+ -re ".*$gdb_prompt $" { fail "complete 'p \"break1'" }
+ timeout { fail "(timeout) complete 'p \"break1'" }
}
setup_xfail "*-*-*"
-send_gdb "p \"break.\t"
+send_gdb "p \"break1.\t"
sleep 1
gdb_expect {
- -re "^p \"break\\.\\\x07$"\
+ -re "^p \"break1\\.\\\x07$"\
{ send_gdb "\n"
gdb_expect {
- -re ".*$gdb_prompt $" { fail "complete 'p \"break.'"}
- timeout {fail "(timeout) complete 'p \"break.'"}
+ -re ".*$gdb_prompt $" { fail "complete 'p \"break1.'"}
+ timeout {fail "(timeout) complete 'p \"break1.'"}
}
}
- -re "^p \"break\\.c\"$"\
+ -re "^p \"break1\\.c\"$"\
{ send_gdb "\n"
gdb_expect {
- -re ".*$gdb_prompt $" { pass "complete 'p \"break.'"}
- timeout {fail "(timeout) complete 'p \"break.'"}
+ -re ".*$gdb_prompt $" { pass "complete 'p \"break1.'"}
+ timeout {fail "(timeout) complete 'p \"break1.'"}
}
}
- -re "^p \"break\\..*$"
+ -re "^p \"break1\\..*$"
{ send_gdb "\n"
gdb_expect {
- -re ".*$gdb_prompt $" { fail "complete 'p \"break.'"}
- timeout {fail "(timeout) complete 'p \"break.'"}
+ -re ".*$gdb_prompt $" { fail "complete 'p \"break1.'"}
+ timeout {fail "(timeout) complete 'p \"break1.'"}
}
}
- -re ".*$gdb_prompt $" { fail "complete 'p \"break.'" }
- timeout { fail "(timeout) complete 'p \"break.'" }
+ -re ".*$gdb_prompt $" { fail "complete 'p \"break1.'" }
+ timeout { fail "(timeout) complete 'p \"break1.'" }
}
send_gdb "p 'a\t"
@@ -647,6 +657,15 @@ gdb_test "cd ${fullsrcdir}" \
"Working directory [string_to_regexp ${fullsrcdir}].*" \
"cd to \${srcdir}"
+send_gdb "complete file ./gdb.base/compl\n"
+sleep 1
+gdb_expect {
+ -re "file ./gdb.base/completion\\.exp.*$gdb_prompt $"
+ { pass "complete-command 'file ./gdb.base/compl'"}
+ -re ".*$gdb_prompt $" { fail "complete-command 'file ./gdb.base/compl'" }
+ timeout { fail "(timeout) complete-command 'file ./gdb.base/compl'" }
+}
+
send_gdb "file ./gdb.base/complet\t"
sleep 1
gdb_expect {
@@ -654,7 +673,6 @@ gdb_expect {
{ send_gdb "\n"
gdb_expect {
-re "\r\nA program is being debugged already\\. Kill it\\? \\(y or n\\) $"
-\
{ send_gdb "n\n"
gdb_expect {
-re "\r\nProgram not killed\\.\r\n$gdb_prompt $"\
@@ -682,7 +700,7 @@ gdb_expect {
-re "marker1.*$gdb_prompt info func marker$"\
{ send_gdb "\n"
gdb_expect {
- -re "All functions matching regular expression \"marker\":.*File.*break.c:\r\nint marker1\\((void|)\\);\r\nint marker2\\(int\\).*marker3\\(char.*char.*\\).*marker4\\(long int\\);.*$gdb_prompt $"\
+ -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 $"\
{ pass "complete 'info func marke'"}
-re ".*$gdb_prompt $" { fail "complete 'info func marke'"}
timeout {fail "(timeout) complete 'info func marke'"}
@@ -700,10 +718,10 @@ gdb_expect {
send_gdb "set follow-fork-mode \t\t"
sleep 1
gdb_expect {
- -re "ask.*child.*parent.*$gdb_prompt set follow-fork-mode $"\
+ -re "child.*parent.*$gdb_prompt set follow-fork-mode $"\
{ send_gdb "\n"
gdb_expect {
- -re "Requires an argument.*ask.*child.*parent.*$gdb_prompt $"\
+ -re "Requires an argument.*child.*parent.*$gdb_prompt $"\
{ pass "complete 'set follow-fork-mode'"}
-re "Ambiguous item \"\"\\..*$gdb_prompt $"\
{ pass "complete 'set follow-fork-mode'"}