aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2012-03-01 18:28:16 +0000
committerTom Tromey <tromey@redhat.com>2012-03-01 18:28:16 +0000
commitbe3359361a4b5306207e896b3966e03289340abc (patch)
tree05018ebcdfbde96be87580c0e880104554d02295 /gdb
parentb0db66a7b319cbf68c9989bbe4a65841defffef9 (diff)
downloadgdb-be3359361a4b5306207e896b3966e03289340abc.zip
gdb-be3359361a4b5306207e896b3966e03289340abc.tar.gz
gdb-be3359361a4b5306207e896b3966e03289340abc.tar.bz2
* value.c (value_primitive_field): Handle virtual base classes.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog4
-rw-r--r--gdb/value.c11
2 files changed, 13 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 1d5912f..b511e1a 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,9 @@
2012-03-01 Tom Tromey <tromey@redhat.com>
+ * value.c (value_primitive_field): Handle virtual base classes.
+
+2012-03-01 Tom Tromey <tromey@redhat.com>
+
* gdbtypes.h (struct vbase): Remove.
2012-03-01 Tom Tromey <tromey@redhat.com>
diff --git a/gdb/value.c b/gdb/value.c
index 85ea970..68e5f02 100644
--- a/gdb/value.c
+++ b/gdb/value.c
@@ -41,6 +41,7 @@
#include "python/python.h"
#include <ctype.h>
#include "tracepoint.h"
+#include "cp-abi.h"
/* Prototypes for exported functions. */
@@ -2549,11 +2550,18 @@ 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. */
+ int boffset;
/* Lazy register values with offsets are not supported. */
if (VALUE_LVAL (arg1) == lval_register && value_lazy (arg1))
value_fetch_lazy (arg1);
+ boffset = baseclass_offset (arg_type, fieldno,
+ value_contents (arg1),
+ value_embedded_offset (arg1),
+ value_address (arg1),
+ arg1);
+
if (value_lazy (arg1))
v = allocate_value_lazy (value_enclosing_type (arg1));
else
@@ -2564,8 +2572,7 @@ value_primitive_field (struct value *arg1, int offset,
}
v->type = type;
v->offset = value_offset (arg1);
- v->embedded_offset = (offset + value_embedded_offset (arg1)
- + TYPE_FIELD_BITPOS (arg_type, fieldno) / 8);
+ v->embedded_offset = offset + value_embedded_offset (arg1) + boffset;
}
else
{