This is the mail archive of the gdb-patches@sourceware.org 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]

Cleanup value_primitive_field


This patch makes value_primitive_filed copy full value->location, not just
VALUE_ADDRESS -- just the same that Jim has done to value_copy. 
No changes in behaviour so far and no regressions on x86. OK?

- Volodya

	* value.c (value_primitive_field): Copy the full 'location' contents, instead
        of assuming that copying ADDRESS will bring over everything in the
        union.  Remove obsolete comment.
--- gdb/value.c	(/mirrors/gdb_mainline)	(revision 3197)
+++ gdb/value.c	(/patches/gdb/value_primitive_field/gdb_mainline)	(revision 3197)
@@ -1343,11 +1343,9 @@ value_primitive_field (struct value *arg
   VALUE_LVAL (v) = VALUE_LVAL (arg1);
   if (VALUE_LVAL (arg1) == lval_internalvar)
     VALUE_LVAL (v) = lval_internalvar_component;
-  VALUE_ADDRESS (v) = VALUE_ADDRESS (arg1);
+  v->location = arg1->location;
   VALUE_REGNUM (v) = VALUE_REGNUM (arg1);
   VALUE_FRAME_ID (v) = VALUE_FRAME_ID (arg1);
-/*  VALUE_OFFSET (v) = VALUE_OFFSET (arg1) + offset
-   + TYPE_FIELD_BITPOS (arg_type, fieldno) / 8; */
   return v;
 }
 

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