mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-05-31 10:09:16 +08:00
* c-valprint.c (c_value_print): Add VALUE_OFFSET to the address
argument of val_print. * cp-valprint.c (cp_print_value): Don't add the offset parameter to the address argument of baseclass_offset or target_read_memory. Do add it to the argument of cp_print_value_fields.
This commit is contained in:
@ -554,7 +554,7 @@ cp_print_value (struct type *type, struct type *real_type, char *valaddr,
|
||||
{
|
||||
boffset = baseclass_offset (type, i,
|
||||
valaddr + offset,
|
||||
address + offset);
|
||||
address);
|
||||
skip = ((boffset == -1) || (boffset + offset) < 0) ? 1 : -1;
|
||||
|
||||
if (BASETYPE_VIA_VIRTUAL (type, i))
|
||||
@ -569,9 +569,10 @@ cp_print_value (struct type *type, struct type *real_type, char *valaddr,
|
||||
{
|
||||
/* FIXME (alloca): unsafe if baseclass is really really large. */
|
||||
base_valaddr = (char *) alloca (TYPE_LENGTH (baseclass));
|
||||
if (target_read_memory (address + offset + boffset, base_valaddr,
|
||||
if (target_read_memory (address + boffset, base_valaddr,
|
||||
TYPE_LENGTH (baseclass)) != 0)
|
||||
skip = 1;
|
||||
address = address + boffset;
|
||||
thisoffset = 0;
|
||||
boffset = 0;
|
||||
thistype = baseclass;
|
||||
@ -600,7 +601,8 @@ cp_print_value (struct type *type, struct type *real_type, char *valaddr,
|
||||
fprintf_filtered (stream, "<invalid address>");
|
||||
else
|
||||
cp_print_value_fields (baseclass, thistype, base_valaddr,
|
||||
thisoffset + boffset, address, stream, format,
|
||||
thisoffset + boffset, address + boffset,
|
||||
stream, format,
|
||||
recurse, pretty,
|
||||
((struct type **)
|
||||
obstack_base (&dont_print_vb_obstack)),
|
||||
|
Reference in New Issue
Block a user