X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Fparse.c;h=ec23dbb87ae1ada5a8d05efa19a9b5de17309782;hb=32b40af94e919e235c21486110311647cbeecf2e;hp=420afc5bfaa360fc6ea4d1151d0cd3853bdd8975;hpb=6d3d12ebef6fa7dd6bc8c34fbc5e440ac8d0a8c6;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/parse.c b/gdb/parse.c index 420afc5bfa..ec23dbb87a 100644 --- a/gdb/parse.c +++ b/gdb/parse.c @@ -1,6 +1,6 @@ /* Parse expressions for GDB. - Copyright (C) 1986-2014 Free Software Foundation, Inc. + Copyright (C) 1986-2015 Free Software Foundation, Inc. Modified from expread.y by the Department of Computer Science at the State University of New York at Buffalo, 1991. @@ -48,7 +48,6 @@ #include "block.h" #include "source.h" #include "objfiles.h" -#include "exceptions.h" #include "user-regs.h" /* Standard set of definitions for printing, dumping, prefixifying, @@ -141,13 +140,13 @@ static struct funcall *funcall_chain; void start_arglist (void) { - struct funcall *new; + struct funcall *newobj; - new = (struct funcall *) xmalloc (sizeof (struct funcall)); - new->next = funcall_chain; - new->arglist_len = arglist_len; + newobj = (struct funcall *) xmalloc (sizeof (struct funcall)); + newobj->next = funcall_chain; + newobj->arglist_len = arglist_len; arglist_len = 0; - funcall_chain = new; + funcall_chain = newobj; } /* Return the number of arguments in a function call just terminated, @@ -584,7 +583,6 @@ mark_completion_tag (enum type_code tag, const char *ptr, int length) && expout_last_struct == -1); gdb_assert (tag == TYPE_CODE_UNION || tag == TYPE_CODE_STRUCT - || tag == TYPE_CODE_CLASS || tag == TYPE_CODE_ENUM); expout_tag_completion_type = tag; expout_completion_name = xmalloc (length + 1); @@ -1135,7 +1133,6 @@ parse_exp_in_context_1 (const char **stringptr, CORE_ADDR pc, const struct block *block, int comma, int void_context_p, int *out_subexp) { - volatile struct gdb_exception except; struct cleanup *old_chain, *inner_chain; const struct language_defn *lang = NULL; struct parser_state ps; @@ -1176,7 +1173,8 @@ parse_exp_in_context_1 (const char **stringptr, CORE_ADDR pc, struct symtab_and_line cursal = get_current_source_symtab_and_line (); if (cursal.symtab) expression_context_block - = BLOCKVECTOR_BLOCK (BLOCKVECTOR (cursal.symtab), STATIC_BLOCK); + = BLOCKVECTOR_BLOCK (SYMTAB_BLOCKVECTOR (cursal.symtab), + STATIC_BLOCK); if (expression_context_block) expression_context_pc = BLOCK_START (expression_context_block); } @@ -1216,12 +1214,12 @@ parse_exp_in_context_1 (const char **stringptr, CORE_ADDR pc, inner_chain = make_cleanup_restore_current_language (); set_language (lang->la_language); - TRY_CATCH (except, RETURN_MASK_ALL) + TRY { if (lang->la_parser (&ps)) lang->la_error (NULL); } - if (except.reason < 0) + CATCH (except, RETURN_MASK_ALL) { if (! parse_completion) { @@ -1229,6 +1227,7 @@ parse_exp_in_context_1 (const char **stringptr, CORE_ADDR pc, throw_exception (except); } } + END_CATCH reallocate_expout (&ps); @@ -1284,15 +1283,20 @@ parse_expression_for_completion (const char *string, char **name, struct expression *exp = NULL; struct value *val; int subexp; - volatile struct gdb_exception except; - TRY_CATCH (except, RETURN_MASK_ERROR) + TRY { parse_completion = 1; exp = parse_exp_in_context (&string, 0, 0, 0, 0, &subexp); } + CATCH (except, RETURN_MASK_ERROR) + { + /* Nothing, EXP remains NULL. */ + } + END_CATCH + parse_completion = 0; - if (except.reason < 0 || ! exp) + if (exp == NULL) return NULL; if (expout_tag_completion_type != TYPE_CODE_UNDEF) @@ -1811,7 +1815,7 @@ operator_check_standard (struct expression *exp, int pos, /* Check objfile where the variable itself is placed. SYMBOL_OBJ_SECTION (symbol) may be NULL. */ - if ((*objfile_func) (SYMBOL_SYMTAB (symbol)->objfile, data)) + if ((*objfile_func) (symbol_objfile (symbol), data)) return 1; /* Check objfile where is placed the code touching the variable. */