mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-10-15 03:48:11 +08:00
* 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.
This commit is contained in:
@ -390,13 +390,14 @@ expression_completer (struct cmd_list_element *ignore,
|
||||
struct type *type = NULL;
|
||||
char *fieldname, *p;
|
||||
volatile struct gdb_exception except;
|
||||
enum type_code code = TYPE_CODE_UNDEF;
|
||||
|
||||
/* Perform a tentative parse of the expression, to see whether a
|
||||
field completion is required. */
|
||||
fieldname = NULL;
|
||||
TRY_CATCH (except, RETURN_MASK_ERROR)
|
||||
{
|
||||
type = parse_expression_for_completion (text, &fieldname);
|
||||
type = parse_expression_for_completion (text, &fieldname, &code);
|
||||
}
|
||||
if (except.reason < 0)
|
||||
return NULL;
|
||||
@ -422,6 +423,15 @@ expression_completer (struct cmd_list_element *ignore,
|
||||
return result;
|
||||
}
|
||||
}
|
||||
else if (fieldname && code != TYPE_CODE_UNDEF)
|
||||
{
|
||||
VEC (char_ptr) *result;
|
||||
struct cleanup *cleanup = make_cleanup (xfree, fieldname);
|
||||
|
||||
result = make_symbol_completion_type (fieldname, fieldname, code);
|
||||
do_cleanups (cleanup);
|
||||
return result;
|
||||
}
|
||||
xfree (fieldname);
|
||||
|
||||
/* Commands which complete on locations want to see the entire
|
||||
|
Reference in New Issue
Block a user