diff options
author | Tom Tromey <tromey@redhat.com> | 2012-12-07 20:09:11 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2012-12-07 20:09:11 +0000 |
commit | 2f68a89553836f68b8676beda9287c93e489bc6e (patch) | |
tree | 660cfb00b6001f1f1c3ee19051b85682cf2ce286 /gdb/c-exp.y | |
parent | 155da5173d74221a3099c22c27de1e8e2214982b (diff) | |
download | gdb-2f68a89553836f68b8676beda9287c93e489bc6e.zip gdb-2f68a89553836f68b8676beda9287c93e489bc6e.tar.gz gdb-2f68a89553836f68b8676beda9287c93e489bc6e.tar.bz2 |
* ada-lang.c (ada_make_symbol_completion_list): Add 'code'
argument, assertion.
* c-exp.y (typebase): Add completion productions.
* completer.c (expression_completer): Handle tag completion.
* expression.h (parse_expression_for_completion): Add argument.
* f-lang.c (f_make_symbol_completion_list): Add 'code'
argument.
* language.h (struct language_defn)
<la_make_symbol_completion_list>: Add 'code' argument.
* parse.c (expout_tag_completion_type, expout_completion_name):
New globals.
(mark_struct_expression): Add assertion.
(mark_completion_tag): New function.
(parse_exp_in_context): Initialize new globals.
(parse_expression_for_completion): Add 'code' argument. Handle
tag completion.
* parser-defs.h (mark_completion_tag): Declare.
* symtab.c (default_make_symbol_completion_list_break_on): Add
'code' argument. Update.
(default_make_symbol_completion_list): Add 'code' argument.
(make_symbol_completion_list): Update.
(make_symbol_completion_type): New function.
* symtab.h (default_make_symbol_completion_list_break_on)
(default_make_symbol_completion_list): Update.
(make_symbol_completion_type): Declare.
testsuite
* gdb.base/break1.c (enum some_enum, union some_union): New.
(some_enum_global, some_union_global, some_value): New globals.
* gdb.base/completion.exp: Add tag completion tests.
Diffstat (limited to 'gdb/c-exp.y')
-rw-r--r-- | gdb/c-exp.y | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/gdb/c-exp.y b/gdb/c-exp.y index 7ae90aa..dc89c3e 100644 --- a/gdb/c-exp.y +++ b/gdb/c-exp.y @@ -1268,15 +1268,59 @@ typebase /* Implements (approximately): (type-qualifier)* type-specifier */ | STRUCT name { $$ = lookup_struct (copy_name ($2), expression_context_block); } + | STRUCT COMPLETE + { + mark_completion_tag (TYPE_CODE_STRUCT, "", 0); + $$ = NULL; + } + | STRUCT name COMPLETE + { + mark_completion_tag (TYPE_CODE_STRUCT, $2.ptr, + $2.length); + $$ = NULL; + } | CLASS name { $$ = lookup_struct (copy_name ($2), expression_context_block); } + | CLASS COMPLETE + { + mark_completion_tag (TYPE_CODE_CLASS, "", 0); + $$ = NULL; + } + | CLASS name COMPLETE + { + mark_completion_tag (TYPE_CODE_CLASS, $2.ptr, + $2.length); + $$ = NULL; + } | UNION name { $$ = lookup_union (copy_name ($2), expression_context_block); } + | UNION COMPLETE + { + mark_completion_tag (TYPE_CODE_UNION, "", 0); + $$ = NULL; + } + | UNION name COMPLETE + { + mark_completion_tag (TYPE_CODE_UNION, $2.ptr, + $2.length); + $$ = NULL; + } | ENUM name { $$ = lookup_enum (copy_name ($2), expression_context_block); } + | ENUM COMPLETE + { + mark_completion_tag (TYPE_CODE_ENUM, "", 0); + $$ = NULL; + } + | ENUM name COMPLETE + { + mark_completion_tag (TYPE_CODE_ENUM, $2.ptr, + $2.length); + $$ = NULL; + } | UNSIGNED typename { $$ = lookup_unsigned_typename (parse_language, parse_gdbarch, |