aboutsummaryrefslogtreecommitdiff
path: root/gdb/completer.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/completer.c')
-rw-r--r--gdb/completer.c11
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 (;;)