From c6c437768c9525852e08705f143181109b9af7e5 Mon Sep 17 00:00:00 2001 From: David Carlton Date: Sat, 20 Sep 2003 00:32:31 +0000 Subject: 2003-09-19 David Carlton * expression.h (enum exp_opcode): Revert to mainline's OP_FUNCALL, OP_SCOPE. * ada-exp.y, m2-exp.y, objc-exp.y, p-exp.y: Ditto. * jv-exp.y (push_qualified_expression_name): Ditto. * ada-lang.c (ada_resolve_subexp, replace_operator_with_call) (ada_evaluate_subexp): Ditto. * eval.c (evaluate_subexp_standard): Ditto. * expprint.c (print_subexp, dump_subexp): Ditto. * parse.c (length_of_subexp, prefixify_subexp): Ditto. * c-exp.y: Ditto, and add comment. * cp-support.c (make_symbol_overload_list): Delete 'block' argument; change calls to make_symbol_overload_list_using appropriately. (make_symbol_overload_list_using): Delete 'block' argument; replace it by get_selected_block (0). * cp-support.h: Delete 'block' argument from make_symbol_overload_list. * valops.c (find_overload_match): Delete 'block' argument, and update calls using it. (find_oload_champ_namespace, find_oload_champ_namespace_loop) (value_aggregate_elt, value_struct_elt_for_reference) (value_namespace_elt): Ditto. (value_maybe_namespace_elt): Delete 'block' argument, and use get_selected_block (0) instead. * value.h: Delete 'block' argument from value_struct_elt, value_find_oload. --- gdb/ChangeLog | 29 +++++++++++++++++++++++++++++ gdb/ada-exp.y | 2 -- gdb/ada-lang.c | 12 ++++-------- gdb/c-exp.y | 23 ++++++++++++++++++----- gdb/cp-support.c | 20 ++++++-------------- gdb/cp-support.h | 3 +-- gdb/eval.c | 20 +++++++------------- gdb/expprint.c | 16 ++++++++-------- gdb/expression.h | 21 ++++++++------------- gdb/jv-exp.y | 1 - gdb/m2-exp.y | 1 - gdb/objc-exp.y | 3 --- gdb/p-exp.y | 2 -- gdb/parse.c | 12 ++---------- gdb/valops.c | 46 +++++++++++++++------------------------------- gdb/value.h | 2 -- 16 files changed, 98 insertions(+), 115 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 9c2c051..6adec6f 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,32 @@ +2003-09-19 David Carlton + + * expression.h (enum exp_opcode): Revert to mainline's OP_FUNCALL, + OP_SCOPE. + * ada-exp.y, m2-exp.y, objc-exp.y, p-exp.y: Ditto. + * jv-exp.y (push_qualified_expression_name): Ditto. + * ada-lang.c (ada_resolve_subexp, replace_operator_with_call) + (ada_evaluate_subexp): Ditto. + * eval.c (evaluate_subexp_standard): Ditto. + * expprint.c (print_subexp, dump_subexp): Ditto. + * parse.c (length_of_subexp, prefixify_subexp): Ditto. + * c-exp.y: Ditto, and add comment. + * cp-support.c (make_symbol_overload_list): Delete 'block' + argument; change calls to make_symbol_overload_list_using + appropriately. + (make_symbol_overload_list_using): Delete 'block' argument; + replace it by get_selected_block (0). + * cp-support.h: Delete 'block' argument from + make_symbol_overload_list. + * valops.c (find_overload_match): Delete 'block' argument, and + update calls using it. + (find_oload_champ_namespace, find_oload_champ_namespace_loop) + (value_aggregate_elt, value_struct_elt_for_reference) + (value_namespace_elt): Ditto. + (value_maybe_namespace_elt): Delete 'block' argument, and use + get_selected_block (0) instead. + * value.h: Delete 'block' argument from value_struct_elt, + value_find_oload. + 2003-09-17 David Carlton * Merge with mainline; tag is carlton_dictionary-20030917-merge. diff --git a/gdb/ada-exp.y b/gdb/ada-exp.y index c82913d..8d9bc04 100644 --- a/gdb/ada-exp.y +++ b/gdb/ada-exp.y @@ -233,7 +233,6 @@ simple_exp : simple_exp '(' arglist ')' { write_exp_elt_opcode (OP_FUNCALL); write_exp_elt_longcst ($3); - write_exp_elt_block (expression_context_block); write_exp_elt_opcode (OP_FUNCALL); } ; @@ -903,7 +902,6 @@ write_object_renaming (orig_left_context, renaming) { write_exp_elt_opcode (OP_FUNCALL); write_exp_elt_longcst ((LONGEST) 1); - write_exp_elt_block (expression_context_block); write_exp_elt_opcode (OP_FUNCALL); } else if (slice_state == LOWER_BOUND) diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index fdeea16..13d393d 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -1974,9 +1974,6 @@ ada_resolve_subexp (struct expression **expp, int *pos, int deprocedure_p, break; case OP_FUNCALL: - /* FIXME: carlton/2002-01-20: I don't understand this well - enough to know if it should be changed after I added the - current block to an OP_FUNCALL. */ nargs = longest_to_int (exp->elts[pc + 1].longconst) + 1; /* FIXME: OP_UNRESOLVED_VALUE should be defined in expression.h */ /* if (exp->elts[pc+3].opcode == OP_UNRESOLVED_VALUE) @@ -2793,11 +2790,10 @@ replace_operator_with_call (struct expression **expp, int pc, int nargs, newexp->elts[pc].opcode = newexp->elts[pc + 2].opcode = OP_FUNCALL; newexp->elts[pc + 1].longconst = (LONGEST) nargs; - newexp->elts[pc + 2].block = block; - newexp->elts[pc + 4].opcode = newexp->elts[pc + 6].opcode = OP_VAR_VALUE; - newexp->elts[pc + 5].block = block; - newexp->elts[pc + 6].symbol = sym; + newexp->elts[pc + 3].opcode = newexp->elts[pc + 6].opcode = OP_VAR_VALUE; + newexp->elts[pc + 4].block = block; + newexp->elts[pc + 5].symbol = sym; *expp = newexp; xfree (exp); @@ -6998,7 +6994,7 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp, return value_array (tem2, tem3, argvec); case OP_FUNCALL: - (*pos) += 3; + (*pos) += 2; /* Allocate arg vector, including space for the function to be called in argvec[0] and a terminating NULL */ diff --git a/gdb/c-exp.y b/gdb/c-exp.y index a03568f..0372686 100644 --- a/gdb/c-exp.y +++ b/gdb/c-exp.y @@ -333,7 +333,6 @@ exp : exp '(' arglist ')' %prec ARROW { write_exp_elt_opcode (OP_FUNCALL); write_exp_elt_longcst ((LONGEST) end_arglist ()); - write_exp_elt_block (expression_context_block); write_exp_elt_opcode (OP_FUNCALL); } ; @@ -603,9 +602,6 @@ qualified_name: typebase COLONCOLON name write_exp_elt_opcode (OP_SCOPE); write_exp_elt_type (type); - /* If it's a namespace, we need to know the - block. */ - write_exp_elt_block (expression_context_block); write_exp_string ($3); write_exp_elt_opcode (OP_SCOPE); } @@ -629,7 +625,6 @@ qualified_name: typebase COLONCOLON name destructor_name_p (tmp_token.ptr, type); write_exp_elt_opcode (OP_SCOPE); write_exp_elt_type (type); - write_exp_elt_block (expression_context_block); write_exp_string (tmp_token); write_exp_elt_opcode (OP_SCOPE); } @@ -899,6 +894,24 @@ typebase /* Implements (approximately): (type-qualifier)* type-specifier */ | qualified_type ; +/* FIXME: carlton/2003-09-19: This leads to lots of reduce-reduce + conflicts, because the parser doesn't know whether or not to use + qualified_name or qualified_type. There's no good way to fix this + with the grammar as it stands; as far as I can tell, some of the + problems arise from ambiguities that GDB introduces ('start' can be + either an expression or a type), but some of it is inherent to the + nature of C++ (you want to treat the input "(FOO)" fairly + differently depending on whether FOO is an expression or a type, + and if FOO is a complex expression, this can be hard to determine + at the right time. + + Perhaps we could fix this by making the lexer smarter. (Some of + this functionality used to be in the lexer, but in a way that + worked even less well than the current solution.) Ideally, the + code in question could be shared by the lexer and by decode_line_1. + I'm not holding my breath waiting for somebody to get around to + cleaning this up, however... */ + qualified_type: typebase COLONCOLON name { struct type *type = $1; diff --git a/gdb/cp-support.c b/gdb/cp-support.c index 7954703..037f355 100644 --- a/gdb/cp-support.c +++ b/gdb/cp-support.c @@ -54,8 +54,7 @@ static void overload_list_add_symbol (struct symbol *sym, const char *oload_name); static void make_symbol_overload_list_using (const char *func_name, - const char *namespace, - const struct block *block); + const char *namespace); static void make_symbol_overload_list_qualified (const char *func_name); @@ -525,13 +524,9 @@ overload_list_add_symbol (struct symbol *sym, const char *oload_name) used in finding all overloaded instances of a function name. This has been modified from make_symbol_completion_list. */ -/* FIXME: carlton/2003-01-30: Should BLOCK be here? Maybe it's better - to use get_selected_block (0). */ - struct symbol ** make_symbol_overload_list (const char *func_name, - const char *namespace, - const struct block *block) + const char *namespace) { struct cleanup *old_cleanups; @@ -543,8 +538,7 @@ make_symbol_overload_list (const char *func_name, old_cleanups = make_cleanup (xfree, sym_return_val); - make_symbol_overload_list_using (func_name, namespace, - block); + make_symbol_overload_list_using (func_name, namespace); discard_cleanups (old_cleanups); @@ -558,8 +552,7 @@ make_symbol_overload_list (const char *func_name, static void make_symbol_overload_list_using (const char *func_name, - const char *namespace, - const struct block *block) + const char *namespace) { const struct using_direct *current; @@ -567,15 +560,14 @@ make_symbol_overload_list_using (const char *func_name, look in the appropriate namespaces for new functions to match on. */ - for (current = block_using (block); + for (current = block_using (get_selected_block (0)); current != NULL; current = current->next) { if (strcmp (namespace, current->outer) == 0) { make_symbol_overload_list_using (func_name, - current->inner, - block); + current->inner); } } diff --git a/gdb/cp-support.h b/gdb/cp-support.h index 08c1e23..563ca37 100644 --- a/gdb/cp-support.h +++ b/gdb/cp-support.h @@ -64,8 +64,7 @@ extern char *cp_func_name (const char *full_name); extern char *remove_params (const char *demangled_name); extern struct symbol **make_symbol_overload_list (const char *, - const char *, - const struct block *); + const char *); /* Functions/variables from cp-namespace.c. */ diff --git a/gdb/eval.c b/gdb/eval.c index d3ebb3e..6b504c6 100644 --- a/gdb/eval.c +++ b/gdb/eval.c @@ -397,7 +397,6 @@ evaluate_subexp_standard (struct type *expect_type, long mem_offset; struct type **arg_types; int save_pos1; - const struct block *current_block; pc = (*pos)++; op = exp->elts[pc].opcode; @@ -405,14 +404,13 @@ evaluate_subexp_standard (struct type *expect_type, switch (op) { case OP_SCOPE: - tem = longest_to_int (exp->elts[pc + 3].longconst); - (*pos) += 5 + BYTES_TO_EXP_ELEM (tem + 1); + tem = longest_to_int (exp->elts[pc + 2].longconst); + (*pos) += 4 + BYTES_TO_EXP_ELEM (tem + 1); arg1 = value_aggregate_elt (exp->elts[pc + 1].type, - exp->elts[pc + 2].block, - &exp->elts[pc + 4].string, + &exp->elts[pc + 3].string, noside); if (arg1 == NULL) - error ("There is no field named %s", &exp->elts[pc + 4].string); + error ("There is no field named %s", &exp->elts[pc + 3].string); return arg1; case OP_LONG: @@ -949,11 +947,9 @@ evaluate_subexp_standard (struct type *expect_type, break; case OP_FUNCALL: - (*pos) += 3; + (*pos) += 2; op = exp->elts[*pos].opcode; nargs = longest_to_int (exp->elts[pc + 1].longconst); - current_block = exp->elts[pc + 2].block; - /* Allocate arg vector, including space for the function to be called in argvec[0] and a terminating NULL */ argvec = (struct value **) alloca (sizeof (struct value *) * (nargs + 3)); @@ -1125,7 +1121,6 @@ evaluate_subexp_standard (struct type *expect_type, 1 /* method */, 0 /* strict match */ , &arg2 /* the object */, NULL, - current_block, &valp, NULL, &static_memfuncp); @@ -1184,7 +1179,6 @@ evaluate_subexp_standard (struct type *expect_type, 0 /* strict match */ , NULL, exp->elts[save_pos1+2].symbol /* the function */ , - current_block, NULL, &symp, NULL); /* Now fix the expression being evaluated */ @@ -1921,8 +1915,8 @@ evaluate_subexp_standard (struct type *expect_type, { if (op == OP_SCOPE) { - int temm = longest_to_int (exp->elts[pc + 4].longconst); - (*pos) += 4 + BYTES_TO_EXP_ELEM (temm + 1); + int temm = longest_to_int (exp->elts[pc + 3].longconst); + (*pos) += 3 + BYTES_TO_EXP_ELEM (temm + 1); } else evaluate_subexp (NULL_TYPE, exp, pos, EVAL_SKIP); diff --git a/gdb/expprint.c b/gdb/expprint.c index 1eb4ec6..a3001b1 100644 --- a/gdb/expprint.c +++ b/gdb/expprint.c @@ -82,9 +82,9 @@ print_subexp (struct expression *exp, int *pos, assoc = 0; fputs_filtered (type_name_no_tag (exp->elts[pc + 1].type), stream); fputs_filtered ("::", stream); - nargs = longest_to_int (exp->elts[pc + 3].longconst); - (*pos) += 5 + BYTES_TO_EXP_ELEM (nargs + 1); - fputs_filtered (&exp->elts[pc + 4].string, stream); + nargs = longest_to_int (exp->elts[pc + 2].longconst); + (*pos) += 4 + BYTES_TO_EXP_ELEM (nargs + 1); + fputs_filtered (&exp->elts[pc + 3].string, stream); return; case OP_LONG: @@ -147,7 +147,7 @@ print_subexp (struct expression *exp, int *pos, return; case OP_FUNCALL: - (*pos) += 3; + (*pos) += 2; nargs = longest_to_int (exp->elts[pc + 1].longconst); print_subexp (exp, pos, stream, PREC_SUFFIX); fputs_filtered (" (", stream); @@ -919,7 +919,7 @@ dump_subexp (struct expression *exp, struct ui_file *stream, int elt) nargs = longest_to_int (exp->elts[elt].longconst); fprintf_filtered (stream, "Number of args: %d", nargs); - elt += 3; + elt += 2; for (i = 1; i <= nargs + 1; i++) elt = dump_subexp (exp, stream, elt); @@ -981,11 +981,11 @@ dump_subexp (struct expression *exp, struct ui_file *stream, int elt) type_print (exp->elts[elt].type, NULL, stream, 0); fprintf_filtered (stream, ") "); - len = longest_to_int (exp->elts[elt + 2].longconst); - elem_name = &exp->elts[elt + 3].string; + len = longest_to_int (exp->elts[elt + 1].longconst); + elem_name = &exp->elts[elt + 2].string; fprintf_filtered (stream, "Field name: `%.*s'", len, elem_name); - elt += 5 + BYTES_TO_EXP_ELEM (len + 1); + elt += 4 + BYTES_TO_EXP_ELEM (len + 1); } break; default: diff --git a/gdb/expression.h b/gdb/expression.h index 6d7a490..da95fcb 100644 --- a/gdb/expression.h +++ b/gdb/expression.h @@ -176,12 +176,11 @@ enum exp_opcode OP_INTERNALVAR, /* OP_FUNCALL is followed by an integer in the next exp_element. - The integer is the number of args to the function call. That - many plus one values from following subexpressions are used, - the first one being the function. Next comes the current - block: this is used when doing operator overloading in C++. - Finally, there is a repeat of OP_FUNCALL, making four - exp_elements. */ + The integer is the number of args to the function call. + That many plus one values from following subexpressions + are used, the first one being the function. + The integer is followed by a repeat of OP_FUNCALL, + making three exp_elements. */ OP_FUNCALL, /* OP_OBJC_MSGCALL is followed by a string in the next exp_element and then an @@ -195,9 +194,6 @@ enum exp_opcode and function calls are all exactly the same syntactically. They may only be dismabiguated at runtime. Thus this operator, which indicates that we have found something of the form ( ) */ - - /* NOTE: carlton/2003-01-20: Now that I've added a block to - OP_FUNCALL, it's no longer exactly like OP_FUNCALL. */ OP_F77_UNDETERMINED_ARGLIST, /* The following OP is a special one, it introduces a F77 complex @@ -296,10 +292,9 @@ enum exp_opcode /* Objective C: "@selector" pseudo-operator */ OP_OBJC_SELECTOR, - /* OP_SCOPE surrounds a type name, a block, and a field name. The - type name and block are encoded as one element, but the field - name stays as a string, which, of course, is variable - length. */ + /* OP_SCOPE surrounds a type name and a field name. The type + name is encoded as one element, but the field name stays as + a string, which, of course, is variable length. */ OP_SCOPE, /* Used to represent named structure field values in brace diff --git a/gdb/jv-exp.y b/gdb/jv-exp.y index 36589fb..f6eb50c 100644 --- a/gdb/jv-exp.y +++ b/gdb/jv-exp.y @@ -1342,7 +1342,6 @@ push_qualified_expression_name (struct stoken name, int dot_index) token.length = dot_index; write_exp_elt_opcode (OP_SCOPE); write_exp_elt_type (typ); - write_exp_elt_block (NULL); write_exp_string (token); write_exp_elt_opcode (OP_SCOPE); if (dot_index < name.length) diff --git a/gdb/m2-exp.y b/gdb/m2-exp.y index 0e4ad02..b8dd178 100644 --- a/gdb/m2-exp.y +++ b/gdb/m2-exp.y @@ -360,7 +360,6 @@ exp : exp '(' arglist ')' %prec DOT { write_exp_elt_opcode (OP_FUNCALL); write_exp_elt_longcst ((LONGEST) end_arglist ()); - write_exp_elt_block (expression_context_block); write_exp_elt_opcode (OP_FUNCALL); } ; diff --git a/gdb/objc-exp.y b/gdb/objc-exp.y index 9931f4d..1c3e2a4 100644 --- a/gdb/objc-exp.y +++ b/gdb/objc-exp.y @@ -398,7 +398,6 @@ exp : exp '(' arglist ')' %prec ARROW { write_exp_elt_opcode (OP_FUNCALL); write_exp_elt_longcst ((LONGEST) end_arglist ()); - write_exp_elt_block (expression_context_block); write_exp_elt_opcode (OP_FUNCALL); } ; @@ -669,7 +668,6 @@ qualified_name: typebase COLONCOLON name write_exp_elt_opcode (OP_SCOPE); write_exp_elt_type (type); - write_exp_elt_block (NULL); write_exp_string ($3); write_exp_elt_opcode (OP_SCOPE); } @@ -693,7 +691,6 @@ qualified_name: typebase COLONCOLON name tmp_token.ptr[tmp_token.length] = 0; write_exp_elt_opcode (OP_SCOPE); write_exp_elt_type (type); - write_exp_elt_block (NULL); write_exp_string (tmp_token); write_exp_elt_opcode (OP_SCOPE); } diff --git a/gdb/p-exp.y b/gdb/p-exp.y index 9ce3eb6..22b3dcd 100644 --- a/gdb/p-exp.y +++ b/gdb/p-exp.y @@ -331,7 +331,6 @@ exp : exp '(' arglist ')' %prec ARROW { write_exp_elt_opcode (OP_FUNCALL); write_exp_elt_longcst ((LONGEST) end_arglist ()); - write_exp_elt_block (expression_context_block); write_exp_elt_opcode (OP_FUNCALL); pop_current_type (); } ; @@ -594,7 +593,6 @@ qualified_name: typebase COLONCOLON name write_exp_elt_opcode (OP_SCOPE); write_exp_elt_type (type); - write_exp_elt_block (NULL); write_exp_string ($3); write_exp_elt_opcode (OP_SCOPE); } diff --git a/gdb/parse.c b/gdb/parse.c index 8589f64..61be543 100644 --- a/gdb/parse.c +++ b/gdb/parse.c @@ -803,7 +803,7 @@ length_of_subexp (struct expression *expr, int endpos) /* C++ */ case OP_SCOPE: oplen = longest_to_int (expr->elts[endpos - 2].longconst); - oplen = 6 + BYTES_TO_EXP_ELEM (oplen + 1); + oplen = 5 + BYTES_TO_EXP_ELEM (oplen + 1); break; case OP_LONG: @@ -826,10 +826,6 @@ length_of_subexp (struct expression *expr, int endpos) break; case OP_FUNCALL: - oplen = 4; - args = 1 + longest_to_int (expr->elts[endpos - 3].longconst); - break; - case OP_F77_UNDETERMINED_ARGLIST: oplen = 3; args = 1 + longest_to_int (expr->elts[endpos - 2].longconst); @@ -952,7 +948,7 @@ prefixify_subexp (struct expression *inexpr, /* C++ */ case OP_SCOPE: oplen = longest_to_int (inexpr->elts[inend - 2].longconst); - oplen = 6 + BYTES_TO_EXP_ELEM (oplen + 1); + oplen = 5 + BYTES_TO_EXP_ELEM (oplen + 1); break; case OP_LONG: @@ -975,10 +971,6 @@ prefixify_subexp (struct expression *inexpr, break; case OP_FUNCALL: - oplen = 4; - args = 1 + longest_to_int (inexpr->elts[inend - 3].longconst); - break; - case OP_F77_UNDETERMINED_ARGLIST: oplen = 3; args = 1 + longest_to_int (inexpr->elts[inend - 2].longconst); diff --git a/gdb/valops.c b/gdb/valops.c index 543595d..e4f871a 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -63,7 +63,6 @@ static struct value *search_struct_method (char *, struct value **, int, int *, struct type *); static int find_oload_champ_namespace (struct type **arg_types, int nargs, - const struct block *current_block, const char *func_name, const char *qualified_name, struct symbol ***oload_syms, @@ -71,7 +70,6 @@ static int find_oload_champ_namespace (struct type **arg_types, int nargs, static int find_oload_champ_namespace_loop (struct type **arg_types, int nargs, - const struct block *current_block, const char *func_name, const char *qualified_name, int namespace_len, @@ -103,17 +101,13 @@ static struct value *value_struct_elt_for_reference (struct type *domain, struct type *curtype, const char *name, struct type *intype, - const struct block * - block, enum noside noside); static struct value *value_namespace_elt (const struct type *curtype, - const struct block *block, const char *name, enum noside noside); static struct value *value_maybe_namespace_elt (const struct type *curtype, - const struct block *block, const char *name, enum noside noside); @@ -1933,7 +1927,6 @@ value_find_oload_method_list (struct value **argp, char *method, int offset, int find_overload_match (struct type **arg_types, int nargs, char *name, int method, int lax, struct value **objp, struct symbol *fsym, - const struct block *current_block, struct value **valp, struct symbol **symp, int *staticp) { struct value *obj = (objp ? *objp : NULL); @@ -2003,7 +1996,6 @@ find_overload_match (struct type **arg_types, int nargs, char *name, int method, make_cleanup (xfree, oload_champ_bv); oload_champ = find_oload_champ_namespace (arg_types, nargs, - current_block, func_name, qualified_name, &oload_syms, @@ -2104,7 +2096,6 @@ find_overload_match (struct type **arg_types, int nargs, char *name, int method, static int find_oload_champ_namespace (struct type **arg_types, int nargs, - const struct block *current_block, const char *func_name, const char *qualified_name, struct symbol ***oload_syms, @@ -2113,7 +2104,7 @@ find_oload_champ_namespace (struct type **arg_types, int nargs, int oload_champ; find_oload_champ_namespace_loop (arg_types, nargs, - current_block, func_name, + func_name, qualified_name, 0, oload_syms, oload_champ_bv, &oload_champ); @@ -2135,7 +2126,6 @@ find_oload_champ_namespace (struct type **arg_types, int nargs, static int find_oload_champ_namespace_loop (struct type **arg_types, int nargs, - const struct block *current_block, const char *func_name, const char *qualified_name, int namespace_len, @@ -2171,7 +2161,7 @@ find_oload_champ_namespace_loop (struct type **arg_types, int nargs, { searched_deeper = 1; - if (find_oload_champ_namespace_loop (arg_types, nargs, current_block, + if (find_oload_champ_namespace_loop (arg_types, nargs, func_name, qualified_name, next_namespace_len, oload_syms, oload_champ_bv, @@ -2195,8 +2185,7 @@ find_oload_champ_namespace_loop (struct type **arg_types, int nargs, strncpy (new_namespace, qualified_name, namespace_len); new_namespace[namespace_len] = '\0'; new_oload_syms = make_symbol_overload_list (func_name, - new_namespace, - current_block); + new_namespace); while (new_oload_syms[num_fns]) ++num_fns; @@ -2465,14 +2454,13 @@ check_field (struct value *arg1, const char *name) } /* C++: Given an aggregate type CURTYPE, and a member name NAME, - return the appropriate member. BLOCK is the current block; it is - used if TYPE is a namespace. This function is used to resolve user - expressions of the form "DOMAIN::NAME". For more details on what - happens, see the comment before value_struct_elt_for_reference. */ + return the appropriate member. This function is used to resolve + user expressions of the form "DOMAIN::NAME". For more details on + what happens, see the comment before + value_struct_elt_for_reference. */ struct value * value_aggregate_elt (struct type *curtype, - const struct block *block, const char *name, enum noside noside) { @@ -2481,9 +2469,9 @@ value_aggregate_elt (struct type *curtype, case TYPE_CODE_STRUCT: case TYPE_CODE_UNION: return value_struct_elt_for_reference (curtype, 0, curtype, name, NULL, - block, noside); + noside); case TYPE_CODE_NAMESPACE: - return value_namespace_elt (curtype, block, name, noside); + return value_namespace_elt (curtype, name, noside); default: error ("Internal error: non-aggregate type to value_aggregate_elt"); } @@ -2500,7 +2488,6 @@ static struct value * value_struct_elt_for_reference (struct type *domain, int offset, struct type *curtype, const char *name, struct type *intype, - const struct block *block, enum noside noside) { struct type *t = curtype; @@ -2621,7 +2608,6 @@ value_struct_elt_for_reference (struct type *domain, int offset, TYPE_BASECLASS (t, i), name, intype, - block, noside); if (v) return v; @@ -2630,20 +2616,18 @@ value_struct_elt_for_reference (struct type *domain, int offset, /* As a last chance, look it up using lookup_symbol_namespace: this works for types. */ - return value_maybe_namespace_elt (curtype, block, name, noside); + return value_maybe_namespace_elt (curtype, name, noside); } /* C++: Return the member NAME of the namespace given by the type - CURTYPE. Look this up within BLOCK: in particular, apply the using - directives from within BLOCK. */ + CURTYPE. */ static struct value * value_namespace_elt (const struct type *curtype, - const struct block *block, const char *name, enum noside noside) { - struct value *retval = value_maybe_namespace_elt (curtype, block, name, + struct value *retval = value_maybe_namespace_elt (curtype, name, noside); if (retval == NULL) @@ -2658,7 +2642,6 @@ value_namespace_elt (const struct type *curtype, static struct value * value_maybe_namespace_elt (const struct type *curtype, - const struct block *block, const char *name, enum noside noside) { @@ -2666,7 +2649,8 @@ value_maybe_namespace_elt (const struct type *curtype, const struct symbol *sym; sym = cp_lookup_symbol_namespace (namespace_name, name, NULL, - block, VAR_DOMAIN, NULL); + get_selected_block (0), VAR_DOMAIN, + NULL); if (sym == NULL) return NULL; @@ -2674,7 +2658,7 @@ value_maybe_namespace_elt (const struct type *curtype, && (SYMBOL_CLASS (sym) == LOC_TYPEDEF)) return allocate_value (SYMBOL_TYPE (sym)); else - return value_of_variable (sym, block); + return value_of_variable (sym, get_selected_block (0)); } /* Given a pointer value V, find the real (RTTI) type diff --git a/gdb/value.h b/gdb/value.h index 99b8416..92b44a5 100644 --- a/gdb/value.h +++ b/gdb/value.h @@ -381,7 +381,6 @@ extern struct value *value_struct_elt (struct value **argp, char *err); extern struct value *value_aggregate_elt (struct type *curtype, - const struct block *block, const char *name, enum noside noside); @@ -394,7 +393,6 @@ extern struct fn_field *value_find_oload_method_list (struct value **, char *, extern int find_overload_match (struct type **arg_types, int nargs, char *name, int method, int lax, struct value **objp, struct symbol *fsym, - const struct block *current_block, struct value **valp, struct symbol **symp, int *staticp); -- cgit v1.1