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]

[commit] Delete VALUE_BFD_SECTION


GDB busts its guts draging around a BFD section in the ``struct value''. Only, as illustrated by the test results, and an examination of the code, it doesn't actually use it!

Rather than convert this to a function, I've deleted it.

committed,
Andrew
2004-11-09  Andrew Cagney  <cagney@gnu.org>

	* value.h (struct value): Delete field bfd_section.
	(VALUE_BFD_SECTION): Delete macro.
	(COERCE_REF): Update.
	(value_at, value_at_lazy): Delete asection parameter.
	* printcmd.c (print_formatted, x_command): Update.
	(do_examine): Delete asection parameter.
	(next_section): Delete variable.
	* valops.c (value_cast, value_at, value_at_lazy)
	(value_coerce_function, value_addr, value_ind, value_string) 
	(find_rt_vbase_offset, value_full_object): Update.
	* hpacc-abi.c (hpacc_virtual_fn_field)
	(hpacc_value_rtti_type): Update.
	* gnu-v3-abi.c (gnuv3_rtti_type, gnuv3_virtual_fn_field) 
	(gnuv3_baseclass_offset): Update.
	* f-valprint.c (f_val_print): Update.
	* c-valprint.c (c_val_print): Update.
	* p-valprint.c (pascal_val_print): Update.
	* jv-valprint.c (java_value_print): Update.
	* jv-lang.c (java_class_from_object, evaluate_subexp_java): Update.
	* ada-lang.c (ada_value_primitive_packed_val)
	(ada_evaluate_subexp): Update.
	* dwarf2loc.c (dwarf2_evaluate_loc_desc): Update.
	* expprint.c (print_subexp_standard): Update.
	* infcall.c (call_function_by_hand): Update.
	* valarith.c (value_add): Update.
	* eval.c (evaluate_subexp_standard): Update.
	* values.c (allocate_value, value_copy, value_static_field): Update.
	* findvar.c (read_var_value, locate_var_value): Update.
	
Index: ada-lang.c
===================================================================
RCS file: /cvs/src/src/gdb/ada-lang.c,v
retrieving revision 1.60
diff -p -u -r1.60 ada-lang.c
--- ada-lang.c	23 Oct 2004 19:13:26 -0000	1.60
+++ ada-lang.c	9 Nov 2004 14:34:41 -0000
@@ -1810,7 +1810,7 @@ ada_value_primitive_packed_val (struct v
   else if (VALUE_LAZY (obj))
     {
       v = value_at (type,
-                    VALUE_ADDRESS (obj) + VALUE_OFFSET (obj) + offset, NULL);
+                    VALUE_ADDRESS (obj) + VALUE_OFFSET (obj) + offset);
       bytes = (unsigned char *) alloca (len);
       read_memory (VALUE_ADDRESS (v), bytes, len);
     }
@@ -7772,7 +7772,7 @@ ada_evaluate_subexp (struct type *expect
               struct type *arrType = ada_type_of_array (arg1, 0);
               if (arrType == NULL)
                 error ("Attempt to dereference null array pointer.");
-              return value_at_lazy (arrType, 0, NULL);
+              return value_at_lazy (arrType, 0);
             }
           else if (TYPE_CODE (type) == TYPE_CODE_PTR
                    || TYPE_CODE (type) == TYPE_CODE_REF
Index: c-valprint.c
===================================================================
RCS file: /cvs/src/src/gdb/c-valprint.c,v
retrieving revision 1.23
diff -p -u -r1.23 c-valprint.c
--- c-valprint.c	22 Oct 2003 23:54:10 -0000	1.23
+++ c-valprint.c	9 Nov 2004 14:34:41 -0000
@@ -231,7 +231,7 @@ c_val_print (struct type *type, char *va
 		    {
 		      wtype = TYPE_TARGET_TYPE (type);
 		    }
-		  vt_val = value_at (wtype, vt_address, NULL);
+		  vt_val = value_at (wtype, vt_address);
 		  val_print (VALUE_TYPE (vt_val), VALUE_CONTENTS (vt_val), 0,
 			     VALUE_ADDRESS (vt_val), stream, format,
 			     deref_ref, recurse + 1, pretty);
@@ -281,8 +281,7 @@ c_val_print (struct type *type, char *va
 	      value_at
 	      (TYPE_TARGET_TYPE (type),
 	       unpack_pointer (lookup_pointer_type (builtin_type_void),
-			       valaddr + embedded_offset),
-	       NULL);
+			       valaddr + embedded_offset));
 	      val_print (VALUE_TYPE (deref_val),
 			 VALUE_CONTENTS (deref_val),
 			 0,
@@ -445,7 +444,7 @@ c_val_print (struct type *type, char *va
 
     case TYPE_CODE_METHOD:
       {
-	struct value *v = value_at (type, address, NULL);
+	struct value *v = value_at (type, address);
 	cp_print_class_method (VALUE_CONTENTS (value_addr (v)),
 			       lookup_pointer_type (type), stream);
 	break;
Index: dwarf2loc.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2loc.c,v
retrieving revision 1.17
diff -p -u -r1.17 dwarf2loc.c
--- dwarf2loc.c	24 Aug 2004 21:01:49 -0000	1.17
+++ dwarf2loc.c	9 Nov 2004 14:34:41 -0000
@@ -247,8 +247,6 @@ dwarf2_evaluate_loc_desc (struct symbol 
       CORE_ADDR address = dwarf_expr_fetch (ctx, 0);
 
       retval = allocate_value (SYMBOL_TYPE (var));
-      VALUE_BFD_SECTION (retval) = SYMBOL_BFD_SECTION (var);
-
       VALUE_LVAL (retval) = lval_memory;
       VALUE_LAZY (retval) = 1;
       VALUE_ADDRESS (retval) = address;
Index: eval.c
===================================================================
RCS file: /cvs/src/src/gdb/eval.c,v
retrieving revision 1.43
diff -p -u -r1.43 eval.c
--- eval.c	29 Oct 2004 20:23:06 -0000	1.43
+++ eval.c	9 Nov 2004 14:34:41 -0000
@@ -1972,8 +1972,7 @@ evaluate_subexp_standard (struct type *e
 	return value_zero (exp->elts[pc + 1].type, lval_memory);
       else
 	return value_at_lazy (exp->elts[pc + 1].type,
-			      value_as_address (arg1),
-			      NULL);
+			      value_as_address (arg1));
 
     case UNOP_PREINCREMENT:
       arg1 = evaluate_subexp (expect_type, exp, pos, noside);
Index: expprint.c
===================================================================
RCS file: /cvs/src/src/gdb/expprint.c,v
retrieving revision 1.20
diff -p -u -r1.20 expprint.c
--- expprint.c	25 Sep 2003 08:40:45 -0000	1.20
+++ expprint.c	9 Nov 2004 14:34:41 -0000
@@ -388,8 +388,7 @@ print_subexp_standard (struct expression
 	     its type; print the value in the type of the MEMVAL.  */
 	  (*pos) += 4;
 	  val = value_at_lazy (exp->elts[pc + 1].type,
-			       (CORE_ADDR) exp->elts[pc + 5].longconst,
-			       NULL);
+			       (CORE_ADDR) exp->elts[pc + 5].longconst);
 	  value_print (val, stream, 0, Val_no_prettyprint);
 	}
       else
Index: f-valprint.c
===================================================================
RCS file: /cvs/src/src/gdb/f-valprint.c,v
retrieving revision 1.20
diff -p -u -r1.20 f-valprint.c
--- f-valprint.c	14 Oct 2003 06:51:14 -0000	1.20
+++ f-valprint.c	9 Nov 2004 14:34:41 -0000
@@ -442,8 +442,7 @@ f_val_print (struct type *type, char *va
 	      value_at
 	      (TYPE_TARGET_TYPE (type),
 	       unpack_pointer (lookup_pointer_type (builtin_type_void),
-			       valaddr + embedded_offset),
-	       NULL);
+			       valaddr + embedded_offset));
 	      val_print (VALUE_TYPE (deref_val),
 			 VALUE_CONTENTS (deref_val),
 			 0,
Index: findvar.c
===================================================================
RCS file: /cvs/src/src/gdb/findvar.c,v
retrieving revision 1.77
diff -p -u -r1.77 findvar.c
--- findvar.c	3 Aug 2004 00:57:25 -0000	1.77
+++ findvar.c	9 Nov 2004 14:34:41 -0000
@@ -386,7 +386,6 @@ read_var_value (struct symbol *var, stru
 
   v = allocate_value (type);
   VALUE_LVAL (v) = lval_memory;	/* The most likely possibility.  */
-  VALUE_BFD_SECTION (v) = SYMBOL_BFD_SECTION (var);
 
   len = TYPE_LENGTH (type);
 
@@ -450,7 +449,7 @@ Attempt to access variable defined in di
 addresses have not been bound by the dynamic loader. Try again when executable is running.");
 
 	locaddr = SYMBOL_VALUE_ADDRESS (var);
-	loc = value_at (lookup_pointer_type (type), locaddr, NULL);
+	loc = value_at (lookup_pointer_type (type), locaddr);
 	addr = value_as_address (loc);
       }
 
@@ -473,7 +472,7 @@ addresses have not been bound by the dyn
 	if (!argref)
 	  return 0;
 	argref += SYMBOL_VALUE (var);
-	ref = value_at (lookup_pointer_type (type), argref, NULL);
+	ref = value_at (lookup_pointer_type (type), argref);
 	addr = value_as_address (ref);
 	break;
       }
@@ -758,7 +757,6 @@ locate_var_value (struct symbol *var, st
 
       addr = VALUE_ADDRESS (lazy_value);
       val = value_from_pointer (lookup_pointer_type (type), addr);
-      VALUE_BFD_SECTION (val) = VALUE_BFD_SECTION (lazy_value);
       return val;
     }
 
Index: gnu-v3-abi.c
===================================================================
RCS file: /cvs/src/src/gdb/gnu-v3-abi.c,v
retrieving revision 1.21
diff -p -u -r1.21 gnu-v3-abi.c
--- gnu-v3-abi.c	15 Mar 2004 20:38:08 -0000	1.21
+++ gnu-v3-abi.c	9 Nov 2004 14:34:41 -0000
@@ -226,8 +226,7 @@ gnuv3_rtti_type (struct value *value,
   vtable_address
     = value_as_address (value_field (value, TYPE_VPTR_FIELDNO (value_type)));
   vtable = value_at_lazy (vtable_type,
-                          vtable_address - vtable_address_point_offset (),
-                          VALUE_BFD_SECTION (value));
+                          vtable_address - vtable_address_point_offset ());
   
   /* Find the linker symbol for this vtable.  */
   vtable_symbol
@@ -330,8 +329,7 @@ gnuv3_virtual_fn_field (struct value **v
     = value_as_address (value_field (value, TYPE_VPTR_FIELDNO (vfn_base)));
 
   vtable = value_at_lazy (vtable_type,
-                          vtable_address - vtable_address_point_offset (),
-                          VALUE_BFD_SECTION (value));
+                          vtable_address - vtable_address_point_offset ());
 
   /* Fetch the appropriate function pointer from the vtable.  */
   vfn = value_subscript (value_field (vtable, vtable_field_virtual_functions),
@@ -409,10 +407,9 @@ gnuv3_baseclass_offset (struct type *typ
 	   TYPE_NAME (vbasetype) ? TYPE_NAME (vbasetype) : "<unknown>");
 
   vtable_address = value_as_address (value_at_lazy (builtin_type_void_data_ptr,
-						    address, NULL));
+						    address));
   vtable = value_at_lazy (vtable_type,
-                          vtable_address - vtable_address_point_offset (),
-                          NULL);
+                          vtable_address - vtable_address_point_offset ());
   offset_val = value_from_longest(builtin_type_int, cur_base_offset);
   vbase_array = value_field (vtable, vtable_field_vcall_and_vbase_offsets);
   base_offset = value_as_long (value_subscript (vbase_array, offset_val));
Index: hpacc-abi.c
===================================================================
RCS file: /cvs/src/src/gdb/hpacc-abi.c,v
retrieving revision 1.5
diff -p -u -r1.5 hpacc-abi.c
--- hpacc-abi.c	8 Jun 2003 18:27:13 -0000	1.5
+++ hpacc-abi.c	9 Nov 2004 14:34:41 -0000
@@ -128,7 +128,7 @@ hpacc_virtual_fn_field (struct value **a
        * which case the multiplier should be 8 and values should be long */
       vp = value_at (builtin_type_int,
 		     coreptr + 4 * (TYPE_FN_FIELD_VOFFSET (f, j) +
-				    HP_ACC_VFUNC_START), NULL);
+				    HP_ACC_VFUNC_START));
 
       coreptr = *(CORE_ADDR *) (VALUE_CONTENTS (vp));
       /* coreptr now contains the address of the virtual function */
@@ -147,13 +147,13 @@ hpacc_virtual_fn_field (struct value **a
       /* pai: FIXME 32x64 problem here, if words are 8 bytes long
        * the multiplier below has to be 8 and value should be long. */
       vp = value_at (builtin_type_int,
-		     coreptr + 4 * (HP_ACC_VFUNC_START + class_index), NULL);
+		     coreptr + 4 * (HP_ACC_VFUNC_START + class_index));
       /* Indirect once more, offset by function index */
       /* pai: FIXME 32x64 problem here, again multiplier could be 8 and value long */
       coreptr =
 	*(CORE_ADDR *) (VALUE_CONTENTS (vp) +
 			4 * TYPE_FN_FIELD_VOFFSET (f, j));
-      vp = value_at (builtin_type_int, coreptr, NULL);
+      vp = value_at (builtin_type_int, coreptr);
       coreptr = *(CORE_ADDR *) (VALUE_CONTENTS (vp));
 
       /* coreptr now contains the address of the virtual function */
@@ -229,16 +229,14 @@ hpacc_value_rtti_type (struct value *v, 
   /* Fetch the top offset of the object */
   /* FIXME possible 32x64 problem with pointer size & arithmetic */
   vp = value_at (builtin_type_int,
-                 coreptr + 4 * HP_ACC_TOP_OFFSET_OFFSET,
-                 VALUE_BFD_SECTION (v));
+                 coreptr + 4 * HP_ACC_TOP_OFFSET_OFFSET);
   top_offset = value_as_long (vp);
   if (top)
     *top = top_offset;
 
   /* Fetch the typeinfo pointer */
   /* FIXME possible 32x64 problem with pointer size & arithmetic */
-  vp = value_at (builtin_type_int, coreptr + 4 * HP_ACC_TYPEINFO_OFFSET,
-                 VALUE_BFD_SECTION (v));
+  vp = value_at (builtin_type_int, coreptr + 4 * HP_ACC_TYPEINFO_OFFSET);
   /* Indirect through the typeinfo pointer and retrieve the pointer
    * to the string name */
   coreptr = *(CORE_ADDR *) (VALUE_CONTENTS (vp));
@@ -246,7 +244,7 @@ hpacc_value_rtti_type (struct value *v, 
     error ("Retrieved null typeinfo pointer in trying to determine "
            "run-time type");
   /* 4 -> offset of name field */
-  vp = value_at (builtin_type_int, coreptr + 4, VALUE_BFD_SECTION (v));
+  vp = value_at (builtin_type_int, coreptr + 4);
   /* FIXME possible 32x64 problem */
 
   coreptr = *(CORE_ADDR *) (VALUE_CONTENTS (vp));
Index: infcall.c
===================================================================
RCS file: /cvs/src/src/gdb/infcall.c,v
retrieving revision 1.58
diff -p -u -r1.58 infcall.c
--- infcall.c	8 Oct 2004 08:15:56 -0000	1.58
+++ infcall.c	9 Nov 2004 14:34:41 -0000
@@ -852,7 +852,7 @@ the function call).", name);
 	 you're seeing problems with values being returned using the
 	 "struct return convention", check that PUSH_DUMMY_CALL isn't
 	 playing tricks.  */
-      retval = value_at (value_type, struct_addr, NULL);
+      retval = value_at (value_type, struct_addr);
     else
       {
 	/* This code only handles "register convention".  */
Index: jv-lang.c
===================================================================
RCS file: /cvs/src/src/gdb/jv-lang.c,v
retrieving revision 1.35
diff -p -u -r1.35 jv-lang.c
--- jv-lang.c	11 Sep 2004 10:24:47 -0000	1.35
+++ jv-lang.c	9 Nov 2004 14:34:42 -0000
@@ -228,7 +228,7 @@ java_class_from_object (struct value *ob
   if (TYPE_CODE (VALUE_TYPE (obj_val)) == TYPE_CODE_PTR
       && TYPE_LENGTH (TYPE_TARGET_TYPE (VALUE_TYPE (obj_val))) == 0)
     obj_val = value_at (get_java_object_type (),
-			value_as_address (obj_val), NULL);
+			value_as_address (obj_val));
 
   vtable_val = value_struct_elt (&obj_val, NULL, "vtable", NULL, "structure");
   return value_struct_elt (&vtable_val, NULL, "class", NULL, "structure");
@@ -904,7 +904,7 @@ evaluate_subexp_java (struct type *expec
 	    error ("array index (%ld) out of bounds (length: %ld)",
 		   index, length);
 	  address = (address + 4) + index * TYPE_LENGTH (el_type);
-	  return value_at (el_type, address, NULL);
+	  return value_at (el_type, address);
 	}
       else if (TYPE_CODE (type) == TYPE_CODE_ARRAY)
 	{
Index: jv-valprint.c
===================================================================
RCS file: /cvs/src/src/gdb/jv-valprint.c,v
retrieving revision 1.17
diff -p -u -r1.17 jv-valprint.c
--- jv-valprint.c	9 Jan 2004 20:42:10 -0000	1.17
+++ jv-valprint.c	9 Nov 2004 14:34:42 -0000
@@ -68,7 +68,7 @@ java_value_print (struct value *val, str
 	  type = type_from_class (java_class_from_object (val));
 	  type = lookup_pointer_type (type);
 
-	  val = value_at (type, address, NULL);
+	  val = value_at (type, address);
 	}
     }
 
Index: p-valprint.c
===================================================================
RCS file: /cvs/src/src/gdb/p-valprint.c,v
retrieving revision 1.26
diff -p -u -r1.26 p-valprint.c
--- p-valprint.c	26 Jul 2004 14:53:04 -0000	1.26
+++ p-valprint.c	9 Nov 2004 14:34:42 -0000
@@ -237,7 +237,7 @@ pascal_val_print (struct type *type, cha
 		    {
 		      wtype = TYPE_TARGET_TYPE (type);
 		    }
-		  vt_val = value_at (wtype, vt_address, NULL);
+		  vt_val = value_at (wtype, vt_address);
 		  val_print (VALUE_TYPE (vt_val), VALUE_CONTENTS (vt_val), 0,
 			     VALUE_ADDRESS (vt_val), stream, format,
 			     deref_ref, recurse + 1, pretty);
@@ -289,8 +289,7 @@ pascal_val_print (struct type *type, cha
 	      value_at
 	      (TYPE_TARGET_TYPE (type),
 	       unpack_pointer (lookup_pointer_type (builtin_type_void),
-			       valaddr + embedded_offset),
-	       NULL);
+			       valaddr + embedded_offset));
 	      val_print (VALUE_TYPE (deref_val),
 			 VALUE_CONTENTS (deref_val), 0,
 			 VALUE_ADDRESS (deref_val), stream, format,
Index: printcmd.c
===================================================================
RCS file: /cvs/src/src/gdb/printcmd.c,v
retrieving revision 1.79
diff -p -u -r1.79 printcmd.c
--- printcmd.c	11 Sep 2004 10:24:50 -0000	1.79
+++ printcmd.c	9 Nov 2004 14:34:42 -0000
@@ -70,10 +70,6 @@ static char last_size = 'w';
 
 static CORE_ADDR next_address;
 
-/* Default section to examine next. */
-
-static asection *next_section;
-
 /* Last address examined.  */
 
 static CORE_ADDR last_examine_address;
@@ -170,9 +166,6 @@ static void print_command_1 (char *, int
 
 static void validate_format (struct format_data, char *);
 
-static void do_examine (struct format_data, CORE_ADDR addr,
-			asection * section);
-
 static void print_formatted (struct value *, int, int, struct ui_file *);
 
 static struct format_data decode_format (char **, int, int);
@@ -288,7 +281,6 @@ print_formatted (struct value *val, int 
   if (VALUE_LVAL (val) == lval_memory)
     {
       next_address = VALUE_ADDRESS (val) + len;
-      next_section = VALUE_BFD_SECTION (val);
     }
 
   switch (format)
@@ -297,7 +289,6 @@ print_formatted (struct value *val, int 
       /* FIXME: Need to handle wchar_t's here... */
       next_address = VALUE_ADDRESS (val)
 	+ val_print_string (VALUE_ADDRESS (val), -1, 1, stream);
-      next_section = VALUE_BFD_SECTION (val);
       break;
 
     case 'i':
@@ -311,7 +302,6 @@ print_formatted (struct value *val, int 
       wrap_here ("    ");
       next_address = VALUE_ADDRESS (val)
 	+ gdb_print_insn (VALUE_ADDRESS (val), stream);
-      next_section = VALUE_BFD_SECTION (val);
       break;
 
     default:
@@ -763,7 +753,7 @@ static struct type *examine_g_type;
    Fetch it from memory and print on gdb_stdout.  */
 
 static void
-do_examine (struct format_data fmt, CORE_ADDR addr, asection *sect)
+do_examine (struct format_data fmt, CORE_ADDR addr)
 {
   char format = 0;
   char size;
@@ -776,7 +766,6 @@ do_examine (struct format_data fmt, CORE
   size = fmt.size;
   count = fmt.count;
   next_address = addr;
-  next_section = sect;
 
   /* String or instruction format implies fetch single bytes
      regardless of the specified size.  */
@@ -831,7 +820,7 @@ do_examine (struct format_data fmt, CORE
 	     the disassembler be modified so that LAST_EXAMINE_VALUE
 	     is left with the byte sequence from the last complete
 	     instruction fetched from memory? */
-	  last_examine_value = value_at_lazy (val_type, next_address, sect);
+	  last_examine_value = value_at_lazy (val_type, next_address);
 
 	  if (last_examine_value)
 	    release_value (last_examine_value);
@@ -1304,12 +1293,10 @@ x_command (char *exp, int from_tty)
 	next_address = VALUE_ADDRESS (val);
       else
 	next_address = value_as_address (val);
-      if (VALUE_BFD_SECTION (val))
-	next_section = VALUE_BFD_SECTION (val);
       do_cleanups (old_chain);
     }
 
-  do_examine (fmt, next_address, next_section);
+  do_examine (fmt, next_address);
 
   /* If the examine succeeds, we remember its size and format for next time.  */
   last_size = fmt.size;
@@ -1549,7 +1536,7 @@ do_one_display (struct display *d)
 
       annotate_display_value ();
 
-      do_examine (d->format, addr, VALUE_BFD_SECTION (val));
+      do_examine (d->format, addr);
     }
   else
     {
Index: valarith.c
===================================================================
RCS file: /cvs/src/src/gdb/valarith.c,v
retrieving revision 1.25
diff -p -u -r1.25 valarith.c
--- valarith.c	2 Nov 2004 14:18:13 -0000	1.25
+++ valarith.c	9 Nov 2004 14:34:42 -0000
@@ -122,7 +122,6 @@ value_add (struct value *arg1, struct va
       retval = value_from_pointer (valptrtype,
 				   value_as_address (valptr)
 				   + (sz * value_as_long (valint)));
-      VALUE_BFD_SECTION (retval) = VALUE_BFD_SECTION (valptr);
       return retval;
     }
 
Index: valops.c
===================================================================
RCS file: /cvs/src/src/gdb/valops.c,v
retrieving revision 1.132
diff -p -u -r1.132 valops.c
--- valops.c	2 Nov 2004 14:18:13 -0000	1.132
+++ valops.c	9 Nov 2004 14:34:43 -0000
@@ -410,10 +410,7 @@ value_cast (struct type *type, struct va
       return arg2;
     }
   else if (VALUE_LVAL (arg2) == lval_memory)
-    {
-      return value_at_lazy (type, VALUE_ADDRESS (arg2) + VALUE_OFFSET (arg2),
-			    VALUE_BFD_SECTION (arg2));
-    }
+    return value_at_lazy (type, VALUE_ADDRESS (arg2) + VALUE_OFFSET (arg2));
   else if (code1 == TYPE_CODE_VOID)
     {
       return value_zero (builtin_type_void, not_lval);
@@ -451,7 +448,7 @@ value_zero (struct type *type, enum lval
    adjustments before or after calling it. */
 
 struct value *
-value_at (struct type *type, CORE_ADDR addr, asection *sect)
+value_at (struct type *type, CORE_ADDR addr)
 {
   struct value *val;
 
@@ -464,7 +461,6 @@ value_at (struct type *type, CORE_ADDR a
 
   VALUE_LVAL (val) = lval_memory;
   VALUE_ADDRESS (val) = addr;
-  VALUE_BFD_SECTION (val) = sect;
 
   return val;
 }
@@ -472,7 +468,7 @@ value_at (struct type *type, CORE_ADDR a
 /* Return a lazy value with type TYPE located at ADDR (cf. value_at).  */
 
 struct value *
-value_at_lazy (struct type *type, CORE_ADDR addr, asection *sect)
+value_at_lazy (struct type *type, CORE_ADDR addr)
 {
   struct value *val;
 
@@ -484,7 +480,6 @@ value_at_lazy (struct type *type, CORE_A
   VALUE_LVAL (val) = lval_memory;
   VALUE_ADDRESS (val) = addr;
   VALUE_LAZY (val) = 1;
-  VALUE_BFD_SECTION (val) = sect;
 
   return val;
 }
@@ -853,7 +848,6 @@ value_coerce_function (struct value *arg
 
   retval = value_from_pointer (lookup_pointer_type (VALUE_TYPE (arg1)),
 			       (VALUE_ADDRESS (arg1) + VALUE_OFFSET (arg1)));
-  VALUE_BFD_SECTION (retval) = VALUE_BFD_SECTION (arg1);
   return retval;
 }
 
@@ -891,7 +885,6 @@ value_addr (struct value *arg1)
   arg2 = value_change_enclosing_type (arg2, lookup_pointer_type (VALUE_ENCLOSING_TYPE (arg1)));
   /* ... and also the relative position of the subobject in the full object */
   VALUE_POINTED_TO_OFFSET (arg2) = VALUE_EMBEDDED_OFFSET (arg1);
-  VALUE_BFD_SECTION (arg2) = VALUE_BFD_SECTION (arg1);
   return arg2;
 }
 
@@ -916,8 +909,7 @@ value_ind (struct value *arg1)
      BUILTIN_TYPE_LONGEST would seem to be a mistake.  */
   if (TYPE_CODE (base_type) == TYPE_CODE_INT)
     return value_at_lazy (builtin_type_int,
-			  (CORE_ADDR) value_as_long (arg1),
-			  VALUE_BFD_SECTION (arg1));
+			  (CORE_ADDR) value_as_long (arg1));
   else if (TYPE_CODE (base_type) == TYPE_CODE_PTR)
     {
       struct type *enc_type;
@@ -926,9 +918,8 @@ value_ind (struct value *arg1)
       enc_type = check_typedef (VALUE_ENCLOSING_TYPE (arg1));
       enc_type = TYPE_TARGET_TYPE (enc_type);
       /* Retrieve the enclosing object pointed to */
-      arg2 = value_at_lazy (enc_type,
-		   value_as_address (arg1) - VALUE_POINTED_TO_OFFSET (arg1),
-			    VALUE_BFD_SECTION (arg1));
+      arg2 = value_at_lazy (enc_type, (value_as_address (arg1)
+				       - VALUE_POINTED_TO_OFFSET (arg1)));
       /* Re-adjust type */
       VALUE_TYPE (arg2) = TYPE_TARGET_TYPE (base_type);
       /* Add embedding info */
@@ -1044,7 +1035,6 @@ value_array (int lowbound, int highbound
 		  VALUE_CONTENTS_ALL (elemvec[idx]),
 		  typelength);
 	}
-      VALUE_BFD_SECTION (val) = VALUE_BFD_SECTION (elemvec[0]);
       return val;
     }
 
@@ -1062,7 +1052,7 @@ value_array (int lowbound, int highbound
 
   /* Create the array type and set up an array value to be evaluated lazily. */
 
-  val = value_at_lazy (arraytype, addr, VALUE_BFD_SECTION (elemvec[0]));
+  val = value_at_lazy (arraytype, addr);
   return (val);
 }
 
@@ -1100,7 +1090,7 @@ value_string (char *ptr, int len)
   addr = allocate_space_in_inferior (len);
   write_memory (addr, ptr, len);
 
-  val = value_at_lazy (stringtype, addr, NULL);
+  val = value_at_lazy (stringtype, addr);
   return (val);
 }
 
@@ -1434,7 +1424,7 @@ find_rt_vbase_offset (struct type *type,
      & use long type */
 
   /* epstein : FIXME -- added param for overlay section. May not be correct */
-  vp = value_at (builtin_type_int, vtbl + 4 * (-skip - index - HP_ACC_VBASE_START), NULL);
+  vp = value_at (builtin_type_int, vtbl + 4 * (-skip - index - HP_ACC_VBASE_START));
   boffset = value_as_long (vp);
   *skip_p = -1;
   *boffset_p = boffset;
@@ -2641,8 +2631,7 @@ value_full_object (struct value *argp, s
      adjusting for the embedded offset of argp if that's what value_rtti_type
      used for its computation. */
   new_val = value_at_lazy (real_type, VALUE_ADDRESS (argp) - top +
-			   (using_enc ? 0 : VALUE_EMBEDDED_OFFSET (argp)),
-			   VALUE_BFD_SECTION (argp));
+			   (using_enc ? 0 : VALUE_EMBEDDED_OFFSET (argp)));
   VALUE_TYPE (new_val) = VALUE_TYPE (argp);
   VALUE_EMBEDDED_OFFSET (new_val) = using_enc ? top + VALUE_EMBEDDED_OFFSET (argp) : top;
   return new_val;
Index: value.h
===================================================================
RCS file: /cvs/src/src/gdb/value.h,v
retrieving revision 1.56
diff -p -u -r1.56 value.h
--- value.h	2 Nov 2004 14:18:14 -0000	1.56
+++ value.h	9 Nov 2004 14:34:43 -0000
@@ -162,9 +162,6 @@ struct value
        actually exist in the program.  */
     char optimized_out;
 
-    /* The BFD section associated with this value.  */
-    asection *bfd_section;
-
     /* Actual contents of the value.  For use of this value; setting
        it uses the stuff above.  Not valid if lazy is nonzero.
        Target byte-order.  We force it to be aligned properly for any
@@ -226,7 +223,6 @@ extern int value_fetch_lazy (struct valu
 #define VALUE_OPTIMIZED_OUT(val) ((val)->optimized_out)
 #define VALUE_EMBEDDED_OFFSET(val) ((val)->embedded_offset)
 #define VALUE_POINTED_TO_OFFSET(val) ((val)->pointed_to_offset)
-#define VALUE_BFD_SECTION(val) ((val)->bfd_section)
 
 /* Convert a REF to the object referenced.  */
 
@@ -236,8 +232,7 @@ extern int value_fetch_lazy (struct valu
     if (TYPE_CODE (value_type_arg_tmp) == TYPE_CODE_REF)		\
       arg = value_at_lazy (TYPE_TARGET_TYPE (value_type_arg_tmp),	\
                            unpack_pointer (VALUE_TYPE (arg),		\
-                                           VALUE_CONTENTS (arg)),	\
-			                   VALUE_BFD_SECTION (arg));	\
+                                           VALUE_CONTENTS (arg)));	\
   } while (0)
 
 /* If ARG is an array, convert it to a pointer.
@@ -309,10 +304,8 @@ extern struct value *value_from_pointer 
 extern struct value *value_from_double (struct type *type, DOUBLEST num);
 extern struct value *value_from_string (char *string);
 
-extern struct value *value_at (struct type *type, CORE_ADDR addr,
-			       asection * sect);
-extern struct value *value_at_lazy (struct type *type, CORE_ADDR addr,
-				    asection * sect);
+extern struct value *value_at (struct type *type, CORE_ADDR addr);
+extern struct value *value_at_lazy (struct type *type, CORE_ADDR addr);
 
 extern struct value *value_from_register (struct type *type, int regnum,
 					  struct frame_info *frame);
Index: values.c
===================================================================
RCS file: /cvs/src/src/gdb/values.c,v
retrieving revision 1.72
diff -p -u -r1.72 values.c
--- values.c	1 Nov 2004 11:14:38 -0000	1.72
+++ values.c	9 Nov 2004 14:34:43 -0000
@@ -97,7 +97,6 @@ allocate_value (struct type *type)
   VALUE_REGNO (val) = -1;
   VALUE_LAZY (val) = 0;
   VALUE_OPTIMIZED_OUT (val) = 0;
-  VALUE_BFD_SECTION (val) = NULL;
   VALUE_EMBEDDED_OFFSET (val) = 0;
   VALUE_POINTED_TO_OFFSET (val) = 0;
   val->modifiable = 1;
@@ -228,7 +227,6 @@ value_copy (struct value *arg)
   VALUE_OPTIMIZED_OUT (val) = VALUE_OPTIMIZED_OUT (arg);
   VALUE_EMBEDDED_OFFSET (val) = VALUE_EMBEDDED_OFFSET (arg);
   VALUE_POINTED_TO_OFFSET (val) = VALUE_POINTED_TO_OFFSET (arg);
-  VALUE_BFD_SECTION (val) = VALUE_BFD_SECTION (arg);
   val->modifiable = arg->modifiable;
   if (!VALUE_LAZY (val))
     {
@@ -795,8 +793,7 @@ value_static_field (struct type *type, i
   if (TYPE_FIELD_STATIC_HAS_ADDR (type, fieldno))
     {
       retval = value_at (TYPE_FIELD_TYPE (type, fieldno),
-			 TYPE_FIELD_STATIC_PHYSADDR (type, fieldno),
-			 NULL);
+			 TYPE_FIELD_STATIC_PHYSADDR (type, fieldno));
     }
   else
     {
@@ -812,8 +809,7 @@ value_static_field (struct type *type, i
 	  else
 	    {
 	      retval = value_at (TYPE_FIELD_TYPE (type, fieldno),
-				 SYMBOL_VALUE_ADDRESS (msym),
-				 SYMBOL_BFD_SECTION (msym));
+				 SYMBOL_VALUE_ADDRESS (msym));
 	    }
 	}
       else

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