diff options
author | Tom Tromey <tromey@redhat.com> | 2008-06-09 19:25:15 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2008-06-09 19:25:15 +0000 |
commit | 37cd5d19fecc44f28d9b1f32146e53cdb19b5553 (patch) | |
tree | b9ddb6767f777080c4466561077e0469d37f91dc /gdb/testsuite | |
parent | 7b3082352faa8596807f9f5ad038039aae615020 (diff) | |
download | gdb-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')
-rw-r--r-- | gdb/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/completion.exp | 30 |
2 files changed, 35 insertions, 0 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index ef42b4d..d767305 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2008-06-09 Tom Tromey <tromey@redhat.com> + + * gdb.base/completion.exp: New tests for field name completion + with spaces, and field name completion with '->'. + 2008-06-06 Tom Tromey <tromey@redhat.com> * gdb.base/break1.c (struct some_struct): New struct. 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 |