aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/ChangeLog9
-rw-r--r--gdb/ada-lang.c2
-rw-r--r--gdb/gdbtypes.c4
-rw-r--r--gdb/jv-lang.c2
-rw-r--r--gdb/stabsread.c2
5 files changed, 14 insertions, 5 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index f2db927..0aec0b1 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,12 @@
+2012-04-17 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ Do not rely on FIELD_LOC_KIND_BITPOS being zero.
+ * ada-lang.c (ada_template_to_fixed_record_type_1): Replace
+ TYPE_FIELD_BITPOS used as lvalue by SET_FIELD_BITPOS.
+ * gdbtypes.c (append_flags_type_flag): Likewise, twice.
+ * jv-lang.c (java_link_class_type): Likewise, once.
+ * stabsread.c (read_enum_type): Likewise.
+
2012-04-16 Yao Qi <yao@codesourcery.com>
* common/agent.c (agent_run_command): Add one more parameter `len'.
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index 031609d..2e1df7a 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -7445,7 +7445,7 @@ ada_template_to_fixed_record_type_1 (struct type *type,
{
off = align_value (off, field_alignment (type, f))
+ TYPE_FIELD_BITPOS (type, f);
- TYPE_FIELD_BITPOS (rtype, f) = off;
+ SET_FIELD_BITPOS (TYPE_FIELD (rtype, f), off);
TYPE_FIELD_BITSIZE (rtype, f) = 0;
if (ada_is_variant_part (type, f))
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index b6e8b4c..90e33a5 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -3606,12 +3606,12 @@ append_flags_type_flag (struct type *type, int bitpos, char *name)
if (name)
{
TYPE_FIELD_NAME (type, bitpos) = xstrdup (name);
- TYPE_FIELD_BITPOS (type, bitpos) = bitpos;
+ SET_FIELD_BITPOS (TYPE_FIELD (type, bitpos), bitpos);
}
else
{
/* Don't show this field to the user. */
- TYPE_FIELD_BITPOS (type, bitpos) = -1;
+ SET_FIELD_BITPOS (TYPE_FIELD (type, bitpos), -1);
}
}
diff --git a/gdb/jv-lang.c b/gdb/jv-lang.c
index 08ecf5f..c3c5298 100644
--- a/gdb/jv-lang.c
+++ b/gdb/jv-lang.c
@@ -480,7 +480,7 @@ java_link_class_type (struct gdbarch *gdbarch,
if (accflags & 0x0008) /* ACC_STATIC */
SET_FIELD_PHYSADDR (TYPE_FIELD (type, i), boffset);
else
- TYPE_FIELD_BITPOS (type, i) = 8 * boffset;
+ SET_FIELD_BITPOS (TYPE_FIELD (type, i), 8 * boffset);
if (accflags & 0x8000) /* FIELD_UNRESOLVED_FLAG */
{
TYPE_FIELD_TYPE (type, i) = get_java_object_type (); /* FIXME */
diff --git a/gdb/stabsread.c b/gdb/stabsread.c
index ac82652..39e0d7b 100644
--- a/gdb/stabsread.c
+++ b/gdb/stabsread.c
@@ -3730,7 +3730,7 @@ read_enum_type (char **pp, struct type *type,
SYMBOL_TYPE (xsym) = type;
TYPE_FIELD_NAME (type, n) = SYMBOL_LINKAGE_NAME (xsym);
- TYPE_FIELD_BITPOS (type, n) = SYMBOL_VALUE (xsym);
+ SET_FIELD_BITPOS (TYPE_FIELD (type, n), SYMBOL_VALUE (xsym));
TYPE_FIELD_BITSIZE (type, n) = 0;
}
if (syms == osyms)