+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.
+
2018-04-30 Tom Tromey <tom@tromey.com>
* rust-lang.c (rust_type_alignment): Remove.
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 *
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);
int int_bit;
int long_bit;
int long_long_bit;
- int long_long_align_bit;
int half_bit;
const struct floatformat ** half_format;
int float_bit;
gdbarch->int_bit = 4*TARGET_CHAR_BIT;
gdbarch->long_bit = 4*TARGET_CHAR_BIT;
gdbarch->long_long_bit = 2*gdbarch->long_bit;
- gdbarch->long_long_align_bit = 2*gdbarch->long_bit;
gdbarch->half_bit = 2*TARGET_CHAR_BIT;
gdbarch->float_bit = 4*TARGET_CHAR_BIT;
gdbarch->double_bit = 8*TARGET_CHAR_BIT;
/* Skip verify of int_bit, invalid_p == 0 */
/* Skip verify of long_bit, invalid_p == 0 */
/* Skip verify of long_long_bit, invalid_p == 0 */
- /* Skip verify of long_long_align_bit, invalid_p == 0 */
/* Skip verify of half_bit, invalid_p == 0 */
if (gdbarch->half_format == 0)
gdbarch->half_format = floatformats_ieee_half;
fprintf_unfiltered (file,
"gdbarch_dump: long_double_format = %s\n",
pformat (gdbarch->long_double_format));
- fprintf_unfiltered (file,
- "gdbarch_dump: long_long_align_bit = %s\n",
- plongest (gdbarch->long_long_align_bit));
fprintf_unfiltered (file,
"gdbarch_dump: long_long_bit = %s\n",
plongest (gdbarch->long_long_bit));
gdbarch->long_long_bit = long_long_bit;
}
-int
-gdbarch_long_long_align_bit (struct gdbarch *gdbarch)
-{
- gdb_assert (gdbarch != NULL);
- /* Skip verify of long_long_align_bit, invalid_p == 0 */
- if (gdbarch_debug >= 2)
- fprintf_unfiltered (gdb_stdlog, "gdbarch_long_long_align_bit called\n");
- return gdbarch->long_long_align_bit;
-}
-
-void
-set_gdbarch_long_long_align_bit (struct gdbarch *gdbarch,
- int long_long_align_bit)
-{
- gdbarch->long_long_align_bit = long_long_align_bit;
-}
-
int
gdbarch_half_bit (struct gdbarch *gdbarch)
{
extern int gdbarch_long_long_bit (struct gdbarch *gdbarch);
extern void set_gdbarch_long_long_bit (struct gdbarch *gdbarch, int long_long_bit);
-/* Alignment of a long long or unsigned long long for the target
- machine. */
-
-extern int gdbarch_long_long_align_bit (struct gdbarch *gdbarch);
-extern void set_gdbarch_long_long_align_bit (struct gdbarch *gdbarch, int long_long_align_bit);
-
/* The ABI default bit-size and format for "half", "float", "double", and
"long double". These bit/format pairs should eventually be combined
into a single object. For the moment, just initialize them as a pair.
# Number of bits in a long long or unsigned long long for the target
# machine.
v;int;long_long_bit;;;8 * sizeof (LONGEST);2*gdbarch->long_bit;;0
-# Alignment of a long long or unsigned long long for the target
-# machine.
-v;int;long_long_align_bit;;;8 * sizeof (LONGEST);2*gdbarch->long_bit;;0
# The ABI default bit-size and format for "half", "float", "double", and
# "long double". These bit/format pairs should eventually be combined
tdep->record_regmap = i386_record_regmap;
- set_gdbarch_long_long_align_bit (gdbarch, 32);
set_gdbarch_type_align (gdbarch, i386_type_align);
/* The format used for `long double' on almost all i386 targets is
ptr_type = builtin_type (gdbarch)->builtin_data_ptr;
ptr_size = TYPE_LENGTH (ptr_type);
- /* Figure out where the longlong value will be. */
- align_bytes = gdbarch_long_long_align_bit (gdbarch) / 8;
+ /* Figure out where the uint64_t value will be. */
+ align_bytes = type_align (builtin_type (gdbarch)->builtin_uint64);
off = 3 * ptr_size;
off = (off + (align_bytes - 1)) & ~(align_bytes - 1);