diff options
author | Tom Tromey <tromey@redhat.com> | 2010-08-18 19:02:34 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2010-08-18 19:02:34 +0000 |
commit | c92817ce8d63df3e3c7225d77723f1c4ae725f58 (patch) | |
tree | e7c50f7d6f489add476f812346cb7006f0347146 /gdb/completer.c | |
parent | 55455f8927ff9d4703d844163ef51b6e26cdef9e (diff) | |
download | gdb-c92817ce8d63df3e3c7225d77723f1c4ae725f58.zip gdb-c92817ce8d63df3e3c7225d77723f1c4ae725f58.tar.gz gdb-c92817ce8d63df3e3c7225d77723f1c4ae725f58.tar.bz2 |
gdb
PR symtab/11919:
* gdbtypes.c (lookup_struct_elt_type): Clean up error emission.
* parse.c (parse_field_expression): Use RETURN_MASK_ERROR. Move
name-copying lower. Document exception behavior.
* completer.c (expression_completer): Catch exceptions from
parse_field_expression.
gdb/testsuite
PR symtab/11919:
* gdb.base/completion.exp: Add test.
Diffstat (limited to 'gdb/completer.c')
-rw-r--r-- | gdb/completer.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/gdb/completer.c b/gdb/completer.c index 3ba481e..91b899d 100644 --- a/gdb/completer.c +++ b/gdb/completer.c @@ -24,6 +24,7 @@ #include "filenames.h" /* For DOSish file names. */ #include "language.h" #include "gdb_assert.h" +#include "exceptions.h" #include "cli/cli-decode.h" @@ -414,13 +415,19 @@ add_struct_fields (struct type *type, int *nextp, char **output, char ** expression_completer (struct cmd_list_element *ignore, char *text, char *word) { - struct type *type; + struct type *type = NULL; char *fieldname, *p; + volatile struct gdb_exception except; /* Perform a tentative parse of the expression, to see whether a field completion is required. */ fieldname = NULL; - type = parse_field_expression (text, &fieldname); + TRY_CATCH (except, RETURN_MASK_ERROR) + { + type = parse_field_expression (text, &fieldname); + } + if (except.reason < 0) + return NULL; if (fieldname && type) { for (;;) |