mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-10-19 13:53:29 +08:00
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 '->'.
This commit is contained in:
@ -1,3 +1,11 @@
|
|||||||
|
2008-06-09 Tom Tromey <tromey@redhat.com>
|
||||||
|
|
||||||
|
* 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'.
|
||||||
|
|
||||||
2008-06-09 Daniel Jacobowitz <dan@codesourcery.com>
|
2008-06-09 Daniel Jacobowitz <dan@codesourcery.com>
|
||||||
|
|
||||||
* configure.ac (build_warnings): Add -Wno-format for mingw.
|
* configure.ac (build_warnings): Add -Wno-format for mingw.
|
||||||
|
@ -1433,7 +1433,7 @@ yylex ()
|
|||||||
{
|
{
|
||||||
lexptr += 2;
|
lexptr += 2;
|
||||||
yylval.opcode = tokentab2[i].opcode;
|
yylval.opcode = tokentab2[i].opcode;
|
||||||
if (in_parse_field && tokentab2[i].opcode == ARROW)
|
if (in_parse_field && tokentab2[i].token == ARROW)
|
||||||
last_was_structop = 1;
|
last_was_structop = 1;
|
||||||
return tokentab2[i].token;
|
return tokentab2[i].token;
|
||||||
}
|
}
|
||||||
|
@ -387,7 +387,7 @@ char **
|
|||||||
expression_completer (char *text, char *word)
|
expression_completer (char *text, char *word)
|
||||||
{
|
{
|
||||||
struct type *type;
|
struct type *type;
|
||||||
char *fieldname;
|
char *fieldname, *p;
|
||||||
|
|
||||||
/* Perform a tentative parse of the expression, to see whether a
|
/* Perform a tentative parse of the expression, to see whether a
|
||||||
field completion is required. */
|
field completion is required. */
|
||||||
@ -418,8 +418,15 @@ expression_completer (char *text, char *word)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Commands which complete on locations want to see the entire
|
||||||
|
argument. */
|
||||||
|
for (p = word;
|
||||||
|
p > text && p[-1] != ' ' && p[-1] != '\t';
|
||||||
|
p--)
|
||||||
|
;
|
||||||
|
|
||||||
/* Not ideal but it is what we used to do before... */
|
/* Not ideal but it is what we used to do before... */
|
||||||
return location_completer (text, word);
|
return location_completer (p, word);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Complete on command names. Used by "help". */
|
/* Complete on command names. Used by "help". */
|
||||||
@ -604,8 +611,7 @@ complete_line (const char *text, char *line_buffer, int point)
|
|||||||
rl_completer_word_break_characters =
|
rl_completer_word_break_characters =
|
||||||
gdb_completer_file_name_break_characters;
|
gdb_completer_file_name_break_characters;
|
||||||
}
|
}
|
||||||
else if (c->completer == location_completer
|
else if (c->completer == location_completer)
|
||||||
|| c->completer == expression_completer)
|
|
||||||
{
|
{
|
||||||
/* Commands which complete on locations want to
|
/* Commands which complete on locations want to
|
||||||
see the entire argument. */
|
see the entire argument. */
|
||||||
@ -673,8 +679,7 @@ complete_line (const char *text, char *line_buffer, int point)
|
|||||||
rl_completer_word_break_characters =
|
rl_completer_word_break_characters =
|
||||||
gdb_completer_file_name_break_characters;
|
gdb_completer_file_name_break_characters;
|
||||||
}
|
}
|
||||||
else if (c->completer == location_completer
|
else if (c->completer == location_completer)
|
||||||
|| c->completer == expression_completer)
|
|
||||||
{
|
{
|
||||||
for (p = word;
|
for (p = word;
|
||||||
p > tmp_command
|
p > tmp_command
|
||||||
|
@ -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>
|
2008-06-06 Tom Tromey <tromey@redhat.com>
|
||||||
|
|
||||||
* gdb.base/break1.c (struct some_struct): New struct.
|
* gdb.base/break1.c (struct some_struct): New struct.
|
||||||
|
@ -654,6 +654,36 @@ gdb_expect {
|
|||||||
timeout { fail "(timeout) complete 'p values\[0\].a' 2" }
|
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',
|
# The following tests used to simply try to complete `${objdir}/file',
|
||||||
# and so on. The problem is that ${objdir} can be very long; the
|
# and so on. The problem is that ${objdir} can be very long; the
|
||||||
# completed filename may be more than eighty characters wide. When
|
# completed filename may be more than eighty characters wide. When
|
||||||
|
Reference in New Issue
Block a user