From 87f707814cb2289f4178999975b54ab5e736eecc Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Fri, 9 Jan 2009 17:41:53 +0000 Subject: [PATCH] * gdbtypes.c (append_composite_type_field): Correct the location of appended fields. --- gdb/ChangeLog | 5 +++++ 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 + + * gdbtypes.c (append_composite_type_field): Correct the location of + appended fields. + 2009-01-09 Pedro Alves * 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)); } } -- 2.7.4