aboutsummaryrefslogtreecommitdiff
path: root/gdb/value.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2005-02-02 20:31:35 +0000
committerAndrew Cagney <cagney@redhat.com>2005-02-02 20:31:35 +0000
commit4754a64e16a0afde77699cd300487822b46e8247 (patch)
tree880341674d3e31e388a7e20bad6df2be9fad6ec0 /gdb/value.c
parent161f49a3160088a08c3b07e0f025932ef4863ded (diff)
downloadgdb-4754a64e16a0afde77699cd300487822b46e8247.zip
gdb-4754a64e16a0afde77699cd300487822b46e8247.tar.gz
gdb-4754a64e16a0afde77699cd300487822b46e8247.tar.bz2
2005-02-02 Andrew Cagney <cagney@gnu.org>
* value.c (value_enclosing_type): New function. * value.h (VALUE_ENCLOSING_TYPE): Delete. (value_enclosing_type): Declare. * xstormy16-tdep.c, vax-tdep.c, m68k-tdep.c, i386-tdep.c: Update. * gnu-v3-abi.c, hpacc-abi.c, infcall.c, valops.c: Update.
Diffstat (limited to 'gdb/value.c')
-rw-r--r--gdb/value.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/gdb/value.c b/gdb/value.c
index a9c990c..2579143 100644
--- a/gdb/value.c
+++ b/gdb/value.c
@@ -87,7 +87,7 @@ allocate_value (struct type *type)
val->next = all_values;
all_values = val;
val->type = type;
- VALUE_ENCLOSING_TYPE (val) = type;
+ val->enclosing_type = type;
VALUE_LVAL (val) = not_lval;
VALUE_ADDRESS (val) = 0;
VALUE_FRAME_ID (val) = null_frame_id;
@@ -159,6 +159,12 @@ value_contents_all_raw (struct value *value)
return value->aligner.contents;
}
+struct type *
+value_enclosing_type (struct value *value)
+{
+ return value->enclosing_type;
+}
+
/* Return a mark in the value chain. All values allocated after the
mark is obtained (except for those released) are subject to being freed
@@ -252,7 +258,7 @@ value_release_to_mark (struct value *mark)
struct value *
value_copy (struct value *arg)
{
- struct type *encl_type = VALUE_ENCLOSING_TYPE (arg);
+ struct type *encl_type = value_enclosing_type (arg);
struct value *val = allocate_value (encl_type);
val->type = arg->type;
VALUE_LVAL (val) = VALUE_LVAL (arg);
@@ -270,7 +276,7 @@ value_copy (struct value *arg)
if (!VALUE_LAZY (val))
{
memcpy (value_contents_all_raw (val), value_contents_all_raw (arg),
- TYPE_LENGTH (VALUE_ENCLOSING_TYPE (arg)));
+ TYPE_LENGTH (value_enclosing_type (arg)));
}
return val;
@@ -877,9 +883,9 @@ value_static_field (struct type *type, int fieldno)
struct value *
value_change_enclosing_type (struct value *val, struct type *new_encl_type)
{
- if (TYPE_LENGTH (new_encl_type) <= TYPE_LENGTH (VALUE_ENCLOSING_TYPE (val)))
+ if (TYPE_LENGTH (new_encl_type) <= TYPE_LENGTH (value_enclosing_type (val)))
{
- VALUE_ENCLOSING_TYPE (val) = new_encl_type;
+ val->enclosing_type = new_encl_type;
return val;
}
else
@@ -889,7 +895,7 @@ value_change_enclosing_type (struct value *val, struct type *new_encl_type)
new_val = (struct value *) xrealloc (val, sizeof (struct value) + TYPE_LENGTH (new_encl_type));
- VALUE_ENCLOSING_TYPE (new_val) = new_encl_type;
+ new_val->enclosing_type = new_encl_type;
/* We have to make sure this ends up in the same place in the value
chain as the original copy, so it's clean-up behavior is the same.
@@ -946,13 +952,13 @@ value_primitive_field (struct value *arg1, int offset,
/* This field is actually a base subobject, so preserve the
entire object's contents for later references to virtual
bases, etc. */
- v = allocate_value (VALUE_ENCLOSING_TYPE (arg1));
+ v = allocate_value (value_enclosing_type (arg1));
v->type = type;
if (VALUE_LAZY (arg1))
VALUE_LAZY (v) = 1;
else
memcpy (value_contents_all_raw (v), value_contents_all_raw (arg1),
- TYPE_LENGTH (VALUE_ENCLOSING_TYPE (arg1)));
+ TYPE_LENGTH (value_enclosing_type (arg1)));
v->offset = value_offset (arg1);
VALUE_EMBEDDED_OFFSET (v)
= offset +