aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2009-01-09 17:41:53 +0000
committerPedro Alves <palves@redhat.com>2009-01-09 17:41:53 +0000
commit87f707814cb2289f4178999975b54ab5e736eecc (patch)
treecc50bfeb5efa4197367df0d031436c81015f4d52
parent58d4abe16b37770aa4d5e0c6548b4ff039509d54 (diff)
downloadgdb-87f707814cb2289f4178999975b54ab5e736eecc.zip
gdb-87f707814cb2289f4178999975b54ab5e736eecc.tar.gz
gdb-87f707814cb2289f4178999975b54ab5e736eecc.tar.bz2
* gdbtypes.c (append_composite_type_field): Correct the location of
appended fields.
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/gdbtypes.c7
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));
}
}