This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[dictionary] undo some earlier changes


This patch to carlton_dictionary-branch undoes some earlier changes to
our parser: I had been adding blocks all over the place, because I
didn't know about get_selected_block(0) when I first wrote this code.
Shouldn't change functionality, it's just preparation for generating
my next merge patch.

David Carlton
carlton@kealia.com

2003-09-19  David Carlton  <carlton@kealia.com>

	* 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.

Index: ada-exp.y
===================================================================
RCS file: /cvs/src/src/gdb/ada-exp.y,v
retrieving revision 1.4.2.4
diff -u -p -r1.4.2.4 ada-exp.y
--- ada-exp.y	23 May 2003 18:40:34 -0000	1.4.2.4
+++ ada-exp.y	20 Sep 2003 00:31:14 -0000
@@ -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
 	  { 
 	    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)
Index: ada-lang.c
===================================================================
RCS file: /cvs/src/src/gdb/ada-lang.c,v
retrieving revision 1.9.2.17
diff -u -p -r1.9.2.17 ada-lang.c
--- ada-lang.c	17 Sep 2003 21:28:05 -0000	1.9.2.17
+++ ada-lang.c	20 Sep 2003 00:31:16 -0000
@@ -1974,9 +1974,6 @@ ada_resolve_subexp (struct expression **
       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 expre
 
   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
       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 */
Index: c-exp.y
===================================================================
RCS file: /cvs/src/src/gdb/c-exp.y,v
retrieving revision 1.15.2.11
diff -u -p -r1.15.2.11 c-exp.y
--- c-exp.y	23 May 2003 18:40:35 -0000	1.15.2.11
+++ c-exp.y	20 Sep 2003 00:31:16 -0000
@@ -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);
 			}
@@ -898,6 +893,24 @@ typebase  /* Implements (approximately):
 			{ $$ = follow_types ($1); }
 	| 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
 		{
Index: cp-support.c
===================================================================
RCS file: /cvs/src/src/gdb/cp-support.c,v
retrieving revision 1.1.2.22
diff -u -p -r1.1.2.22 cp-support.c
--- cp-support.c	5 Aug 2003 17:13:04 -0000	1.1.2.22
+++ cp-support.c	20 Sep 2003 00:31:16 -0000
@@ -54,8 +54,7 @@ static void overload_list_add_symbol (st
 				      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 
    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 *f
 
   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 *f
 
 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 c
      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);
 	}
     }
 
Index: cp-support.h
===================================================================
RCS file: /cvs/src/src/gdb/cp-support.h,v
retrieving revision 1.1.2.21
diff -u -p -r1.1.2.21 cp-support.h
--- cp-support.h	17 Sep 2003 21:28:13 -0000	1.1.2.21
+++ cp-support.h	20 Sep 2003 00:31:16 -0000
@@ -64,8 +64,7 @@ extern char *cp_func_name (const char *f
 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.  */
 
Index: eval.c
===================================================================
RCS file: /cvs/src/src/gdb/eval.c,v
retrieving revision 1.23.8.11
diff -u -p -r1.23.8.11 eval.c
--- eval.c	17 Sep 2003 21:28:17 -0000	1.23.8.11
+++ eval.c	20 Sep 2003 00:31:16 -0000
@@ -397,7 +397,6 @@ evaluate_subexp_standard (struct type *e
   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 *e
   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 *e
       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 *e
 				   1 /* method */,
 				   0 /* strict match */ ,
 				   &arg2 /* the object */, NULL,
-				   current_block,
 				   &valp, NULL, &static_memfuncp);
 
 
@@ -1184,7 +1179,6 @@ evaluate_subexp_standard (struct type *e
 				   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 *e
 	{
 	  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);
Index: expprint.c
===================================================================
RCS file: /cvs/src/src/gdb/expprint.c,v
retrieving revision 1.8.8.10
diff -u -p -r1.8.8.10 expprint.c
--- expprint.c	17 Sep 2003 21:28:17 -0000	1.8.8.10
+++ expprint.c	20 Sep 2003 00:31:16 -0000
@@ -82,9 +82,9 @@ print_subexp (struct expression *exp, in
       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, in
       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, str
 	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, str
 	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:
Index: expression.h
===================================================================
RCS file: /cvs/src/src/gdb/expression.h,v
retrieving revision 1.6.2.6
diff -u -p -r1.6.2.6 expression.h
--- expression.h	16 Apr 2003 19:56:52 -0000	1.6.2.6
+++ expression.h	20 Sep 2003 00:31:16 -0000
@@ -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 <name> ( <stuff> ) */
-
-    /* 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
Index: jv-exp.y
===================================================================
RCS file: /cvs/src/src/gdb/jv-exp.y,v
retrieving revision 1.11.2.7
diff -u -p -r1.11.2.7 jv-exp.y
--- jv-exp.y	27 Jun 2003 21:50:04 -0000	1.11.2.7
+++ jv-exp.y	20 Sep 2003 00:31:17 -0000
@@ -1342,7 +1342,6 @@ push_qualified_expression_name (struct s
 	  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)
Index: m2-exp.y
===================================================================
RCS file: /cvs/src/src/gdb/m2-exp.y,v
retrieving revision 1.6.4.6
diff -u -p -r1.6.4.6 m2-exp.y
--- m2-exp.y	23 May 2003 18:40:41 -0000	1.6.4.6
+++ m2-exp.y	20 Sep 2003 00:31:17 -0000
@@ -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); }
 	;
 
Index: objc-exp.y
===================================================================
RCS file: /cvs/src/src/gdb/objc-exp.y,v
retrieving revision 1.3.2.12
diff -u -p -r1.3.2.12 objc-exp.y
--- objc-exp.y	27 Jun 2003 21:50:06 -0000	1.3.2.12
+++ objc-exp.y	20 Sep 2003 00:31:17 -0000
@@ -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);
 			}
Index: p-exp.y
===================================================================
RCS file: /cvs/src/src/gdb/p-exp.y,v
retrieving revision 1.15.2.10
diff -u -p -r1.15.2.10 p-exp.y
--- p-exp.y	27 Jun 2003 21:50:07 -0000	1.15.2.10
+++ p-exp.y	20 Sep 2003 00:31:17 -0000
@@ -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);
 			}
Index: parse.c
===================================================================
RCS file: /cvs/src/src/gdb/parse.c,v
retrieving revision 1.27.2.11
diff -u -p -r1.27.2.11 parse.c
--- parse.c	17 Sep 2003 21:28:27 -0000	1.27.2.11
+++ parse.c	20 Sep 2003 00:31:17 -0000
@@ -803,7 +803,7 @@ length_of_subexp (struct expression *exp
       /* 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 *exp
       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 *ine
       /* 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 *ine
       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);
Index: valops.c
===================================================================
RCS file: /cvs/src/src/gdb/valops.c,v
retrieving revision 1.75.2.24
diff -u -p -r1.75.2.24 valops.c
--- valops.c	17 Sep 2003 21:28:35 -0000	1.75.2.24
+++ valops.c	20 Sep 2003 00:31:18 -0000
@@ -63,7 +63,6 @@ static struct value *search_struct_metho
 				       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 (s
 
 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_fo
 						     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 val
 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_t
       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_t
 
 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 
   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 
 
 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 
     {
       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 
   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 c
 }
 
 /* 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 *curtyp
     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 t
 					  TYPE_BASECLASS (t, i),
 					  name,
 					  intype,
-					  block,
 					  noside);
       if (v)
 	return v;
@@ -2630,20 +2616,18 @@ value_struct_elt_for_reference (struct t
   /* 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 *
 
 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 
   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 
 	   && (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
Index: value.h
===================================================================
RCS file: /cvs/src/src/gdb/value.h,v
retrieving revision 1.36.2.12
diff -u -p -r1.36.2.12 value.h
--- value.h	17 Sep 2003 21:28:35 -0000	1.36.2.12
+++ value.h	20 Sep 2003 00:31:18 -0000
@@ -381,7 +381,6 @@ extern struct value *value_struct_elt (s
 				       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
 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);
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]