aboutsummaryrefslogtreecommitdiff
path: root/gdb/arc-tdep.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2018-04-23 13:41:27 -0600
committerTom Tromey <tom@tromey.com>2018-04-30 11:25:32 -0600
commite11fb955fbab035748fa53ffc30c103157a284b6 (patch)
tree655310cf73667f546e4742ebc529d030023734c2 /gdb/arc-tdep.c
parent2fff16dd8c25831fb5fbf198ca86d5befff629be (diff)
downloadgdb-e11fb955fbab035748fa53ffc30c103157a284b6.zip
gdb-e11fb955fbab035748fa53ffc30c103157a284b6.tar.gz
gdb-e11fb955fbab035748fa53ffc30c103157a284b6.tar.bz2
Remove long_long_align_bit gdbarch attribute
This removes the long_long_align_bit gdbarch attribute in favor of type_align. This uncovered two possible issues. First, arc-tdep.c claimed that long long alignment was 32 bits, but as discussed on the list, ARC has a maximum alignment of 32 bits, so I've added an arc_type_align function to account for this. Second, jit.c, the sole user of long_long_align_bit, was confusing "long long" with uint64_t. The relevant structure is defined in the JIT API part of the manual as: struct jit_code_entry { struct jit_code_entry *next_entry; struct jit_code_entry *prev_entry; const char *symfile_addr; uint64_t symfile_size; }; I've changed this code to use uint64_t. 2018-04-30 Tom Tromey <tom@tromey.com> * jit.c (jit_read_code_entry): Use type_align. * i386-tdep.c (i386_gdbarch_init): Don't call set_gdbarch_long_long_align_bit. * gdbarch.sh: Remove long_long_align_bit. * gdbarch.c, gdbarch.h: Rebuild. * arc-tdep.c (arc_type_align): New function. (arc_gdbarch_init): Use arc_type_align. Don't call set_gdbarch_long_long_align_bit.
Diffstat (limited to 'gdb/arc-tdep.c')
-rw-r--r--gdb/arc-tdep.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/gdb/arc-tdep.c b/gdb/arc-tdep.c
index b0d51ad..286a289 100644
--- a/gdb/arc-tdep.c
+++ b/gdb/arc-tdep.c
@@ -1957,6 +1957,15 @@ arc_tdesc_init (struct gdbarch_info info, const struct target_desc **tdesc,
return TRUE;
}
+/* Implement the type_align gdbarch function. */
+
+static ULONGEST
+arc_type_align (struct gdbarch *gdbarch, struct type *type)
+{
+ type = check_typedef (type);
+ return std::min<ULONGEST> (4, TYPE_LENGTH (type));
+}
+
/* Implement the "init" gdbarch method. */
static struct gdbarch *
@@ -1982,7 +1991,7 @@ arc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_int_bit (gdbarch, 32);
set_gdbarch_long_bit (gdbarch, 32);
set_gdbarch_long_long_bit (gdbarch, 64);
- set_gdbarch_long_long_align_bit (gdbarch, 32);
+ set_gdbarch_type_align (gdbarch, arc_type_align);
set_gdbarch_float_bit (gdbarch, 32);
set_gdbarch_float_format (gdbarch, floatformats_ieee_single);
set_gdbarch_double_bit (gdbarch, 64);