* value.h (VALUE_CONTENTS_ALL): Delete.
(value_contents_all): Declare.
* value.c (value_contents_all): New function.
* hpacc-abi.c, cp-valprint.c, valops.c, c-valprint.c: Update.
* m68k-tdep.c, i386-tdep.c, infcall.c, valops.c: Update.
2005-02-02 Andrew Cagney <cagney@gnu.org>
+ * value.h (VALUE_CONTENTS_ALL): Delete.
+ (value_contents_all): Declare.
+ * value.c (value_contents_all): New function.
+ * hpacc-abi.c, cp-valprint.c, valops.c, c-valprint.c: Update.
+ * m68k-tdep.c, i386-tdep.c, infcall.c, valops.c: Update.
+
* 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.
-2005-02-01 Andrew Cagney <cagney@gnu.org>
-
* value.c (value_contents_all_raw)
(value_contents_raw): New functions.
* value.h (VALUE_CONTENTS_ALL_RAW, VALUE_CONTENTS_RAW): Delete.
TYPE_NAME (real_type),
full ? "" : _(" [incomplete object]"));
/* Print out object: enclosing type is same as real_type if full */
- return val_print (value_enclosing_type (val), VALUE_CONTENTS_ALL (val), 0,
- VALUE_ADDRESS (val), stream, format, 1, 0, pretty);
+ return val_print (value_enclosing_type (val),
+ value_contents_all (val), 0,
+ VALUE_ADDRESS (val), stream, format, 1, 0, pretty);
/* Note: When we look up RTTI entries, we don't get any information on
const or volatile attributes */
}
/* No RTTI information, so let's do our best */
fprintf_filtered (stream, "(%s ?) ",
TYPE_NAME (value_enclosing_type (val)));
- return val_print (value_enclosing_type (val), VALUE_CONTENTS_ALL (val), 0,
- VALUE_ADDRESS (val), stream, format, 1, 0, pretty);
+ return val_print (value_enclosing_type (val),
+ value_contents_all (val), 0,
+ VALUE_ADDRESS (val), stream, format, 1, 0, pretty);
}
/* Otherwise, we end up at the return outside this "if" */
}
- return val_print (type, VALUE_CONTENTS_ALL (val),
+ return val_print (type, value_contents_all (val),
VALUE_EMBEDDED_OFFSET (val),
VALUE_ADDRESS (val) + value_offset (val),
stream, format, 1, 0, pretty);
sizeof (CORE_ADDR));
CHECK_TYPEDEF (type);
- cp_print_value_fields (type, type, VALUE_CONTENTS_ALL (val),
+ cp_print_value_fields (type, type, value_contents_all (val),
VALUE_EMBEDDED_OFFSET (val), VALUE_ADDRESS (val),
stream, format, recurse, pretty, NULL, 1);
return;
}
- val_print (type, VALUE_CONTENTS_ALL (val),
+ val_print (type, value_contents_all (val),
VALUE_EMBEDDED_OFFSET (val), VALUE_ADDRESS (val),
stream, format, 0, recurse, pretty);
}
*using_enc = 1;
/* First get the virtual table address */
- coreptr = *(CORE_ADDR *) ((VALUE_CONTENTS_ALL (v))
+ coreptr = *(CORE_ADDR *) ((value_contents_all (v))
+ value_offset (v)
+ (using_enclosing
? 0
This makes sure the stack says word-aligned. */
sp -= (len + 3) & ~3;
- write_memory (sp, VALUE_CONTENTS_ALL (args[i]), len);
+ write_memory (sp, value_contents_all (args[i]), len);
}
/* Push value address. */
sp += aligned_len;
}
/* Push the structure. */
- write_memory (addr, VALUE_CONTENTS_ALL (args[i]), len);
+ write_memory (addr, value_contents_all (args[i]), len);
/* The value we're going to pass is the address of the
thing we just pushed. */
/*args[i] = value_from_longest (lookup_pointer_type (values_type),
else
offset = container_len - len;
sp -= container_len;
- write_memory (sp + offset, VALUE_CONTENTS_ALL (args[i]), len);
+ write_memory (sp + offset, value_contents_all (args[i]), len);
}
/* Store struct value address. */
return val;
}
-/* Called only from the VALUE_CONTENTS and VALUE_CONTENTS_ALL macros,
- if the current data for a variable needs to be loaded into
+/* Called only from the VALUE_CONTENTS and value_contents_all()
+ macros, if the current data for a variable needs to be loaded into
VALUE_CONTENTS(VAL). Fetches the data from the user's process, and
- clears the lazy flag to indicate that the data in the buffer is valid.
+ clears the lazy flag to indicate that the data in the buffer is
+ valid.
If the value is zero-length, we avoid calling read_memory, which would
abort. We mark the value as fetched anyway -- all 0 bytes of it.
for (idx = 0; idx < nelem; idx++)
{
memcpy (value_contents_all_raw (val) + (idx * typelength),
- VALUE_CONTENTS_ALL (elemvec[idx]),
+ value_contents_all (elemvec[idx]),
typelength);
}
return val;
addr = allocate_space_in_inferior (nelem * typelength);
for (idx = 0; idx < nelem; idx++)
{
- write_memory (addr + (idx * typelength), VALUE_CONTENTS_ALL (elemvec[idx]),
+ write_memory (addr + (idx * typelength),
+ value_contents_all (elemvec[idx]),
typelength);
}
according to HP/Taligent runtime spec. */
int skip;
find_rt_vbase_offset (type, TYPE_BASECLASS (type, i),
- VALUE_CONTENTS_ALL (*arg1p),
+ value_contents_all (*arg1p),
offset + VALUE_EMBEDDED_OFFSET (*arg1p),
&base_offset, &skip);
if (skip >= 0)
* according to HP/Taligent runtime spec. */
int skip;
find_rt_vbase_offset (type, TYPE_BASECLASS (type, i),
- VALUE_CONTENTS_ALL (*argp),
+ value_contents_all (*argp),
offset + VALUE_EMBEDDED_OFFSET (*argp),
&base_offset, &skip);
if (skip >= 0)
return value->enclosing_type;
}
+const bfd_byte *
+value_contents_all (struct value *value)
+{
+ if (value->lazy)
+ value_fetch_lazy (value);
+ return value->aligner.contents;
+}
+
\f
/* Return a mark in the value chain. All values allocated after the
mark is obtained (except for those released) are subject to being freed
pointer by the embedded_offset value. */
extern bfd_byte *value_contents_all_raw (struct value *);
-#define VALUE_CONTENTS_ALL(val) \
- ((void) (VALUE_LAZY(val) && value_fetch_lazy(val)), \
- (val)->aligner.contents)
+extern const bfd_byte *value_contents_all (struct value *);
extern int value_fetch_lazy (struct value *val);
sp -= (len + 3) & ~3;
count += (len + 3) / 4;
- write_memory (sp, VALUE_CONTENTS_ALL (args[i]), len);
+ write_memory (sp, value_contents_all (args[i]), len);
}
/* Push argument count. */