* 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.
This commit is contained in:
Tom Tromey
2010-09-30 18:58:08 +00:00
parent 9ae8282da7
commit 38f12cfce2
5 changed files with 77 additions and 2 deletions

View File

@@ -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))