From 37cd5d19fecc44f28d9b1f32146e53cdb19b5553 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Mon, 9 Jun 2008 19:25:15 +0000 Subject: 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 '->'. --- gdb/testsuite/gdb.base/completion.exp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'gdb/testsuite/gdb.base') 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 -- cgit v1.1