aboutsummaryrefslogtreecommitdiff
path: root/gdb/value.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2010-09-30 18:58:08 +0000
committerTom Tromey <tromey@redhat.com>2010-09-30 18:58:08 +0000
commit38f12cfce28f77a63b324a65a30d143f92cc0af4 (patch)
tree4ca23e8cfbc7ec213d42eea9986541017e486d0c /gdb/value.c
parent9ae8282da74ec1fbc0f89d87e645cbaabfa609ce (diff)
downloadgdb-38f12cfce28f77a63b324a65a30d143f92cc0af4.zip
gdb-38f12cfce28f77a63b324a65a30d143f92cc0af4.tar.gz
gdb-38f12cfce28f77a63b324a65a30d143f92cc0af4.tar.bz2
gdb
* value.c (value_primitive_field): Take 'offset' into account for packed field. gdb/testsuite * gdb.base/anon.exp: New file. * gdb.base/anon.c: New file.
Diffstat (limited to 'gdb/value.c')
-rw-r--r--gdb/value.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gdb/value.c b/gdb/value.c
index c189930..55fcd38 100644
--- a/gdb/value.c
+++ b/gdb/value.c
@@ -1973,8 +1973,9 @@ value_primitive_field (struct value *arg1, int offset,
v->bitpos = bitpos % container_bitsize;
else
v->bitpos = bitpos % 8;
- v->offset = value_embedded_offset (arg1)
- + (bitpos - v->bitpos) / 8;
+ v->offset = (value_embedded_offset (arg1)
+ + offset
+ + (bitpos - v->bitpos) / 8);
v->parent = arg1;
value_incref (v->parent);
if (!value_lazy (arg1))