forked from Imagelibrary/binutils-gdb
Add ILP32 support to gdb.
This patch adds AARCH64:ilp32 support to gdb and sets up the correct sizes for some types like pointers and long. Also sets up the correct linker map offsets for Linux. 2016-08-31 Andrew Pinski <apinski@cavium.com> * aarch64-tdep.h (gdbarch_tdep): Add ilp32 field. * aarch64-tdep.c (aarch64_gdbarch_init): Setup ILP32 support. Make sure the gdbarches have compatible ilp32 flags. Set long and ptr sizes correctly for ilp32. * aarch64-linux-tdep.c (aarch64_linux_init_abi): Add support for ILP32.
This commit is contained in:
@@ -1,3 +1,12 @@
|
||||
2015-08-31 Andrew Pinski <apinski@cavium.com>
|
||||
|
||||
* aarch64-tdep.h (gdbarch_tdep): Add ilp32 field.
|
||||
* aarch64-tdep.c (aarch64_gdbarch_init): Setup ILP32 support.
|
||||
Make sure the gdbarches have compatible ilp32 flags.
|
||||
Set long and ptr sizes correctly for ilp32.
|
||||
* aarch64-linux-tdep.c (aarch64_linux_init_abi):
|
||||
Add support for ILP32.
|
||||
|
||||
2016-08-31 Yao Qi <yao.qi@linaro.org>
|
||||
|
||||
* record-full.c (record_full_insert_breakpoint): Fix typo.
|
||||
|
||||
@@ -1000,8 +1000,12 @@ aarch64_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
|
||||
|
||||
linux_init_abi (info, gdbarch);
|
||||
|
||||
set_solib_svr4_fetch_link_map_offsets (gdbarch,
|
||||
svr4_lp64_fetch_link_map_offsets);
|
||||
if (tdep->ilp32)
|
||||
set_solib_svr4_fetch_link_map_offsets (gdbarch,
|
||||
svr4_ilp32_fetch_link_map_offsets);
|
||||
else
|
||||
set_solib_svr4_fetch_link_map_offsets (gdbarch,
|
||||
svr4_lp64_fetch_link_map_offsets);
|
||||
|
||||
/* Enable TLS support. */
|
||||
set_gdbarch_fetch_tls_load_module_address (gdbarch,
|
||||
|
||||
@@ -2646,6 +2646,12 @@ aarch64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
|
||||
const struct tdesc_feature *feature;
|
||||
int num_regs = 0;
|
||||
int num_pseudo_regs = 0;
|
||||
char ilp32 = FALSE;
|
||||
|
||||
if (info.abfd
|
||||
&& bfd_get_flavour (info.abfd) == bfd_target_elf_flavour
|
||||
&& bfd_arch_bits_per_address (info.abfd) == 32)
|
||||
ilp32 = TRUE;
|
||||
|
||||
/* Ensure we always have a target descriptor. */
|
||||
if (!tdesc_has_registers (tdesc))
|
||||
@@ -2703,6 +2709,9 @@ aarch64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
|
||||
best_arch != NULL;
|
||||
best_arch = gdbarch_list_lookup_by_info (best_arch->next, &info))
|
||||
{
|
||||
/* ILP32 and LP64 are incompatible. */
|
||||
if (gdbarch_tdep (arches->gdbarch)->ilp32 != ilp32)
|
||||
continue;
|
||||
/* Found a match. */
|
||||
break;
|
||||
}
|
||||
@@ -2721,6 +2730,7 @@ aarch64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
|
||||
tdep->lowest_pc = 0x20;
|
||||
tdep->jb_pc = -1; /* Longjump support not enabled by default. */
|
||||
tdep->jb_elt_size = 8;
|
||||
tdep->ilp32 = ilp32;
|
||||
|
||||
set_gdbarch_push_dummy_call (gdbarch, aarch64_push_dummy_call);
|
||||
set_gdbarch_frame_align (gdbarch, aarch64_frame_align);
|
||||
@@ -2760,9 +2770,9 @@ aarch64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
|
||||
set_gdbarch_float_bit (gdbarch, 32);
|
||||
set_gdbarch_double_bit (gdbarch, 64);
|
||||
set_gdbarch_long_double_bit (gdbarch, 128);
|
||||
set_gdbarch_long_bit (gdbarch, 64);
|
||||
set_gdbarch_long_bit (gdbarch, ilp32 ? 32 : 64);
|
||||
set_gdbarch_long_long_bit (gdbarch, 64);
|
||||
set_gdbarch_ptr_bit (gdbarch, 64);
|
||||
set_gdbarch_ptr_bit (gdbarch, ilp32 ? 32 : 64);
|
||||
set_gdbarch_char_signed (gdbarch, 0);
|
||||
set_gdbarch_float_format (gdbarch, floatformats_ieee_single);
|
||||
set_gdbarch_double_format (gdbarch, floatformats_ieee_double);
|
||||
|
||||
@@ -95,6 +95,9 @@ struct gdbarch_tdep
|
||||
|
||||
/* syscall record. */
|
||||
int (*aarch64_syscall_record) (struct regcache *regcache, unsigned long svc_number);
|
||||
/* If this is ILP32 or LP64. */
|
||||
bool ilp32;
|
||||
|
||||
};
|
||||
|
||||
extern struct target_desc *tdesc_aarch64;
|
||||
|
||||
Reference in New Issue
Block a user