summaryrefslogtreecommitdiff
path: root/gdb/value.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2005-02-07 17:06:29 +0000
committerAndrew Cagney <cagney@redhat.com>2005-02-07 17:06:29 +0000
commit9a8ebe200c3491653a2d300a942628beb3092936 (patch)
tree0ced022a17a662f123235d25722a2ef69cdd1cd5 /gdb/value.c
parentb545d571bdb84872b66bc3aa27c6d21a4e6af9e6 (diff)
downloadgdb-9a8ebe200c3491653a2d300a942628beb3092936.tar.gz
2005-02-07 Andrew Cagney <cagney@gnu.org>
* value.h (value_embedded_offset): Delete. (value_embedded_offset): Declare. * value.c (value_embedded_offset): Define. * valops.c, p-valprint.c, mi/mi-main.c, hpacc-abi.c: Update. * gnu-v3-abi.c, eval.c, c-valprint.c, cp-valprint.c: Update. * cp-abi.h: Update.
Diffstat (limited to 'gdb/value.c')
-rw-r--r--gdb/value.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/gdb/value.c b/gdb/value.c
index 0006a40eedb..11cc4bc20c0 100644
--- a/gdb/value.c
+++ b/gdb/value.c
@@ -97,7 +97,7 @@ allocate_value (struct type *type)
VALUE_REGNUM (val) = -1;
val->lazy = 0;
val->optimized_out = 0;
- VALUE_EMBEDDED_OFFSET (val) = 0;
+ val->embedded_offset = 0;
VALUE_POINTED_TO_OFFSET (val) = 0;
val->modifiable = 1;
return val;
@@ -210,6 +210,18 @@ set_value_optimized_out (struct value *value, int val)
{
value->optimized_out = val;
}
+
+int
+value_embedded_offset (struct value *value)
+{
+ return value->embedded_offset;
+}
+
+void
+set_value_embedded_offset (struct value *value, int val)
+{
+ value->embedded_offset = val;
+}
/* Return a mark in the value chain. All values allocated after the
mark is obtained (except for those released) are subject to being freed
@@ -315,7 +327,7 @@ value_copy (struct value *arg)
VALUE_REGNUM (val) = VALUE_REGNUM (arg);
val->lazy = arg->lazy;
val->optimized_out = arg->optimized_out;
- VALUE_EMBEDDED_OFFSET (val) = VALUE_EMBEDDED_OFFSET (arg);
+ val->embedded_offset = value_embedded_offset (arg);
VALUE_POINTED_TO_OFFSET (val) = VALUE_POINTED_TO_OFFSET (arg);
val->modifiable = arg->modifiable;
if (!value_lazy (val))
@@ -1005,10 +1017,8 @@ value_primitive_field (struct value *arg1, int offset,
memcpy (value_contents_all_raw (v), value_contents_all_raw (arg1),
TYPE_LENGTH (value_enclosing_type (arg1)));
v->offset = value_offset (arg1);
- VALUE_EMBEDDED_OFFSET (v)
- = offset +
- VALUE_EMBEDDED_OFFSET (arg1) +
- TYPE_FIELD_BITPOS (arg_type, fieldno) / 8;
+ v->embedded_offset = (offset + value_embedded_offset (arg1)
+ + TYPE_FIELD_BITPOS (arg_type, fieldno) / 8);
}
else
{
@@ -1022,7 +1032,7 @@ value_primitive_field (struct value *arg1, int offset,
value_contents_raw (arg1) + offset,
TYPE_LENGTH (type));
v->offset = (value_offset (arg1) + offset
- + VALUE_EMBEDDED_OFFSET (arg1));
+ + value_embedded_offset (arg1));
}
VALUE_LVAL (v) = VALUE_LVAL (arg1);
if (VALUE_LVAL (arg1) == lval_internalvar)