Add initial type alignment support
This adds some basic type alignment support to gdb. It changes struct type to store the alignment, and updates dwarf2read.c to handle DW_AT_alignment. It also adds a new gdbarch method and updates i386-tdep.c. None of this new functionality is used anywhere yet, so tests will wait until the next patch. 2018-04-30 Tom Tromey <tom@tromey.com> * i386-tdep.c (i386_type_align): New function. (i386_gdbarch_init): Update. * gdbarch.sh (type_align): New method. * gdbarch.c, gdbarch.h: Rebuild. * arch-utils.h (default_type_align): Declare. * arch-utils.c (default_type_align): New function. * gdbtypes.h (TYPE_ALIGN_BITS): New define. (struct type) <align_log2>: New field. <instance_flags>: Now a bitfield. (TYPE_RAW_ALIGN): New macro. (type_align, type_raw_align, set_type_align): Declare. * gdbtypes.c (type_align, type_raw_align, set_type_align): New functions. * dwarf2read.c (quirk_rust_enum): Set type alignment. (get_alignment, maybe_set_alignment): New functions. (read_structure_type, read_enumeration_type, read_array_type) (read_set_type, read_tag_pointer_type, read_tag_reference_type) (read_subrange_type, read_base_type): Set type alignment.
This commit is contained in:
parent
fe944acf8f
commit
2b4424c35b
10 changed files with 359 additions and 5 deletions
|
@ -987,6 +987,14 @@ default_in_indirect_branch_thunk (gdbarch *gdbarch, CORE_ADDR pc)
|
|||
return false;
|
||||
}
|
||||
|
||||
/* See arch-utils.h. */
|
||||
|
||||
ULONGEST
|
||||
default_type_align (struct gdbarch *gdbarch, struct type *type)
|
||||
{
|
||||
return TYPE_LENGTH (check_typedef (type));
|
||||
}
|
||||
|
||||
void
|
||||
_initialize_gdbarch_utils (void)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue