This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH 2/3] Add ILP32 support to gdb.
On Thu, Sep 1, 2016 at 8:36 AM, Andrew Pinski <apinski@cavium.com> wrote:
> 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.
It should be * aarch64-tdep.h (gdbarch_tdep) <ilp32>: New 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.
> diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c
> index 3b7e954..1730ef8 100644
> --- a/gdb/aarch64-tdep.c
> +++ b/gdb/aarch64-tdep.c
> @@ -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;
s/char/int/
> +
> + if (info.abfd
> + && bfd_get_flavour (info.abfd) == bfd_target_elf_flavour
> + && elf_elfheader (info.abfd)->e_ident[EI_CLASS] == ELFCLASS32)
> + ilp32 = TRUE;
How about this?
if (info.bfd_arch_info->mach == bfd_mach_aarch64_ilp32)
ilp32 = TRUE;
> --- a/gdb/aarch64-tdep.h
> +++ b/gdb/aarch64-tdep.h
> @@ -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;
We don't use bool in GDB, use int instead.
--
Yao (齐尧)