aboutsummaryrefslogtreecommitdiff
path: root/gdb/cp-valprint.c
diff options
context:
space:
mode:
authorDavid Carlton <carlton@bactrian.org>2003-06-27 21:50:37 +0000
committerDavid Carlton <carlton@bactrian.org>2003-06-27 21:50:37 +0000
commit3abe3bc90be798445086f45d9c3723165cc6c893 (patch)
tree20de3690d32dbb68a1e4266dfd13575be97ea40e /gdb/cp-valprint.c
parentc8a2fad7b41a8264964233608ae10c35918243fb (diff)
downloadgdb-3abe3bc90be798445086f45d9c3723165cc6c893.zip
gdb-3abe3bc90be798445086f45d9c3723165cc6c893.tar.gz
gdb-3abe3bc90be798445086f45d9c3723165cc6c893.tar.bz2
2003-06-27 David Carlton <carlton@kealia.com>
* Merge with mainline; tag is carlton_dictionary-20030627-merge.
Diffstat (limited to 'gdb/cp-valprint.c')
-rw-r--r--gdb/cp-valprint.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/gdb/cp-valprint.c b/gdb/cp-valprint.c
index 6749f8e..e5984b4 100644
--- a/gdb/cp-valprint.c
+++ b/gdb/cp-valprint.c
@@ -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)),