diff options
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/gdbtypes.c | 7 |
2 files changed, 8 insertions, 4 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index e2eeb67..9ddb709 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2009-01-09 Daniel Jacobowitz <dan@codesourcery.com> + + * gdbtypes.c (append_composite_type_field): Correct the location of + appended fields. + 2009-01-09 Pedro Alves <pedro@codesourcery.com> * defs.h (deprecated_error_hook): Delete declaration. diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index c4e3646..790442c 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -1856,10 +1856,9 @@ append_composite_type_field (struct type *t, char *name, { TYPE_LENGTH (t) = TYPE_LENGTH (t) + TYPE_LENGTH (field); if (TYPE_NFIELDS (t) > 1) - { - FIELD_BITPOS (f[0]) = (FIELD_BITPOS (f[-1]) - + TYPE_LENGTH (field) * TARGET_CHAR_BIT); - } + FIELD_BITPOS (f[0]) = (FIELD_BITPOS (f[-1]) + + (TYPE_LENGTH (FIELD_TYPE (f[-1])) + * TARGET_CHAR_BIT)); } } |