]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
2005-02-07 Andrew Cagney <cagney@gnu.org>
authorAndrew Cagney <cagney@redhat.com>
Tue, 8 Feb 2005 02:29:18 +0000 (02:29 +0000)
committerAndrew Cagney <cagney@redhat.com>
Tue, 8 Feb 2005 02:29:18 +0000 (02:29 +0000)
* value.h (set_value_offset): Declare.
* value.c (set_value_offset): Declare.
* gnu-v2-abi.c, jv-valprint.c, valarith.c, valops.c: Update.
* findvar.c: Update.

gdb/ChangeLog
gdb/findvar.c
gdb/gnu-v2-abi.c
gdb/jv-valprint.c
gdb/valarith.c
gdb/valops.c
gdb/value.c
gdb/value.h

index 0b1cc05bcf2350a74fa261e32bb55193bed13b63..9d3c61fa7a618b193d789c9a94a4c44c82c1ff8b 100644 (file)
@@ -1,5 +1,10 @@
 2005-02-07  Andrew Cagney  <cagney@gnu.org>
 
+       * value.h (set_value_offset): Declare.
+       * value.c (set_value_offset): Declare.
+       * gnu-v2-abi.c, jv-valprint.c, valarith.c, valops.c: Update.
+       * findvar.c: Update.
+
        * value.h (value_next): Declare.
        * value.c (value_next): Define.
        * breakpoint.c: Update.
index 56d46fe9f232d513316abfcf7ae1853ec7ed48aa..9675fc5f77123249c3fc93e455658e67dbb1ec32 100644 (file)
@@ -710,9 +710,9 @@ value_from_register (struct type *type, int regnum, struct frame_info *frame)
       if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG
          && len < register_size (current_gdbarch, regnum))
        /* Big-endian, and we want less than full size.  */
-       v->offset = register_size (current_gdbarch, regnum) - len;
+       set_value_offset (v, register_size (current_gdbarch, regnum) - len);
       else
-       v->offset = 0;
+       set_value_offset (v, 0);
       memcpy (value_contents_raw (v), value_bytes + value_offset (v), len);
     }
   return v;
index 87f4e9c7226f018febf6ef193ae5f036bfefe2f7..57bc0d8b5304f63987a0d42dc5ff80f51ab2c92c 100644 (file)
@@ -162,7 +162,7 @@ gnuv2_virtual_fn_field (struct value **arg1p, struct fn_field * f, int j,
   if (TYPE_CODE (entry_type) == TYPE_CODE_STRUCT)
     {
       /* Move the `this' pointer according to the virtual function table. */
-      arg1->offset += value_as_long (value_field (entry, 0));
+      set_value_offset (arg1, value_offset (arg1) + value_as_long (value_field (entry, 0)));
 
       if (!value_lazy (arg1))
        {
index 2d20805e0e11392ac60898d80e1fd9a0b589f9b5..51ba6fb52e52c048ad3fe092ee064fa594b63367 100644 (file)
@@ -163,15 +163,15 @@ java_value_print (struct value *val, struct ui_file *stream, int format,
              else
                {
                  set_value_lazy (v, 1);
-                 v->offset = 0;
+                 set_value_offset (v, 0);
                }
 
-             next_v->offset = value_offset (v);
+             set_value_offset (next_v, value_offset (v));
 
              for (reps = 1; i + reps < length; reps++)
                {
                  set_value_lazy (next_v, 1);
-                 next_v->offset += TYPE_LENGTH (el_type);
+                 set_value_offset (next_v, value_offset (next_v) + TYPE_LENGTH (el_type));
                  if (memcmp (value_contents (v), value_contents (next_v),
                              TYPE_LENGTH (el_type)) != 0)
                    break;
index 9bfe26b530da22e2a01fd97c2bc86c171c184635..6447b48d3b09121eb2a37cccaa305f5d2af31ea5 100644 (file)
@@ -240,7 +240,7 @@ value_subscript (struct value *array, struct value *idx)
        VALUE_LVAL (v) = lval_internalvar_component;
       VALUE_ADDRESS (v) = VALUE_ADDRESS (array);
       VALUE_FRAME_ID (v) = VALUE_FRAME_ID (array);
-      v->offset = offset + value_offset (array);
+      set_value_offset (v, offset + value_offset (array));
       return v;
     }
 
@@ -281,7 +281,7 @@ value_subscripted_rvalue (struct value *array, struct value *idx, int lowerbound
   VALUE_ADDRESS (v) = VALUE_ADDRESS (array);
   VALUE_REGNUM (v) = VALUE_REGNUM (array);
   VALUE_FRAME_ID (v) = VALUE_FRAME_ID (array);
-  v->offset = value_offset (array) + elt_offs;
+  set_value_offset (v, value_offset (array) + elt_offs);
   return v;
 }
 \f
index de1b1a7c7747deb5700180c9782efb4f99a269f9..754f8019de188e38b6d29d18839dd78fcd8022df 100644 (file)
@@ -1309,7 +1309,7 @@ search_struct_field (char *name, struct value *arg1, int offset,
              VALUE_LVAL (v2) = VALUE_LVAL (arg1);
              VALUE_ADDRESS (v2) = VALUE_ADDRESS (arg1);
              VALUE_FRAME_ID (v2) = VALUE_FRAME_ID (arg1);
-             v2->offset = value_offset (arg1) + boffset;
+             set_value_offset (v2, value_offset (arg1) + boffset);
              if (value_lazy (arg1))
                set_value_lazy (v2, 1);
              else
@@ -2775,7 +2775,7 @@ value_slice (struct value *array, int lowbound, int length)
        VALUE_LVAL (slice) = VALUE_LVAL (array);
       VALUE_ADDRESS (slice) = VALUE_ADDRESS (array);
       VALUE_FRAME_ID (slice) = VALUE_FRAME_ID (array);
-      slice->offset = value_offset (array) + offset;
+      set_value_offset (slice, value_offset (array) + offset);
     }
   return slice;
 }
index c77135989178546a61ffd28cb7de9a0aa68a3866..b584fb99d9fe46eb7bd00ae37d0a834b99eed197 100644 (file)
@@ -145,6 +145,11 @@ value_offset (struct value *value)
 {
   return value->offset;
 }
+void
+set_value_offset (struct value *value, int offset)
+{
+  value->offset = offset;
+}
 
 int
 value_bitpos (struct value *value)
index cd1403ba44bb996af0ad8f4badd8378e4a940f28..b8d1490cfbec2794288e53f3817ed88fa1757450 100644 (file)
@@ -172,7 +172,6 @@ struct value
      them.  */
 };
 
-
 /* Values are stored in a chain, so that they can be deleted easily
    over calls to the inferior.  Values assigned to internal variables
    or put into the value history are taken off this list.  */
@@ -186,7 +185,9 @@ extern void deprecated_set_value_type (struct value *value,
                                       struct type *type);
 extern int value_bitsize (struct value *);
 extern int value_bitpos (struct value *);
+
 extern int value_offset (struct value *);
+extern void set_value_offset (struct value *, int offset);
 
 /* The comment from "struct value" reads: ``Is it modifiable?  Only
    relevant if lval != not_lval.''.  Shouldn't the value instead be