aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base/completion.exp
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2008-06-09 19:25:15 +0000
committerTom Tromey <tromey@redhat.com>2008-06-09 19:25:15 +0000
commit37cd5d19fecc44f28d9b1f32146e53cdb19b5553 (patch)
treeb9ddb6767f777080c4466561077e0469d37f91dc /gdb/testsuite/gdb.base/completion.exp
parent7b3082352faa8596807f9f5ad038039aae615020 (diff)
downloadgdb-37cd5d19fecc44f28d9b1f32146e53cdb19b5553.zip
gdb-37cd5d19fecc44f28d9b1f32146e53cdb19b5553.tar.gz
gdb-37cd5d19fecc44f28d9b1f32146e53cdb19b5553.tar.bz2
gdb
* completer.c (complete_line): Don't special-case expression_completer. (expression_completer): Only pass last word to location_completer. * c-exp.y (yylex): Check 'token', not 'operator'. gdb/testsuite * gdb.base/completion.exp: New tests for field name completion with spaces, and field name completion with '->'.
Diffstat (limited to 'gdb/testsuite/gdb.base/completion.exp')
-rw-r--r--gdb/testsuite/gdb.base/completion.exp30
1 files changed, 30 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.base/completion.exp b/gdb/testsuite/gdb.base/completion.exp
index 79f588b..f4ab1b1 100644
--- a/gdb/testsuite/gdb.base/completion.exp
+++ b/gdb/testsuite/gdb.base/completion.exp
@@ -654,6 +654,36 @@ gdb_expect {
timeout { fail "(timeout) complete 'p values\[0\].a' 2" }
}
+send_gdb "p values\[0\] . a\t"
+gdb_expect {
+ -re "^p values.0. . a_field $"\
+ { send_gdb "\n"
+ gdb_expect {
+ -re "^.* = 0.*$gdb_prompt $"\
+ { pass "complete 'p values\[0\] . a'"}
+ -re ".*$gdb_prompt $" { fail "complete 'p values\[0\] . a'"}
+ timeout {fail "(timeout) complete 'p values\[0\] . a'"}
+ }
+ }
+ -re ".*$gdb_prompt $" { fail "complete 'p values\[0\] . a'" }
+ timeout { fail "(timeout) complete 'p values\[0\] . a' 2" }
+ }
+
+send_gdb "p &values\[0\] -> a\t"
+gdb_expect {
+ -re "^p &values.0. -> a_field $"\
+ { send_gdb "\n"
+ gdb_expect {
+ -re "^.* = .*0x\[0-9a-fA-F\]*.*$gdb_prompt $"\
+ { pass "complete 'p &values\[0\] -> a'"}
+ -re ".*$gdb_prompt $" { fail "complete 'p &values\[0\] -> a'"}
+ timeout {fail "(timeout) complete 'p &values\[0\] -> a'"}
+ }
+ }
+ -re ".*$gdb_prompt $" { fail "complete 'p &values\[0\] -> a'" }
+ timeout { fail "(timeout) complete 'p &values\[0\] -> a' 2" }
+ }
+
# The following tests used to simply try to complete `${objdir}/file',
# and so on. The problem is that ${objdir} can be very long; the
# completed filename may be more than eighty characters wide. When