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.
This commit is contained in:
Tom Tromey
2018-04-23 13:41:27 -06:00
parent 2fff16dd8c
commit e11fb955fb
7 changed files with 23 additions and 36 deletions

View File

@ -175,7 +175,6 @@ struct gdbarch
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;
@ -389,7 +388,6 @@ gdbarch_alloc (const struct gdbarch_info *info,
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;
@ -530,7 +528,6 @@ verify_gdbarch (struct gdbarch *gdbarch)
/* 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;
@ -1165,9 +1162,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
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));
@ -1638,23 +1632,6 @@ set_gdbarch_long_long_bit (struct gdbarch *gdbarch,
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)
{