This is the first of two new patches for ILP32 support on aarch64. This one is the gdb changes, the next will be the bfd changes. The standard gdb testsuite run on 64 bit aarch64 executables results in 65 failures (30627 passes), running it on 32 bit aarch64 executables results in 213 failures (30354 passes). I believe most of the new failures are due to two problems.  One is unwinding through signal handlers and the other is accessing thread local data.  I think the thread problem may be due to a version mismatch between the thread_db library that gdb (a 64 bit process) is using and a newer thread_db library that the 32 bit executables being debugged are using and not a problem with the code. I am working on the signal unwinding problem but I was hoping that the part that is already working is sufficiently useful to check in while I work on fixing this problem.  The current code handles the usual gdb functionality of breakpoints, stepping, printing variables, etc. Steve Ellcey sellcey@cavium.com gdb ChangeLog: 2017-03-06  Andrew Pinski       Steve Ellcey       Yao Qi   * aarch64-linux-nat.c (IS_ARM32): New macro. (fetch_gregs_from_thread): Use IS_ARM32 macro. (store_gregs_to_thread): Ditto. (fetch_fpregs_from_thread): Ditto. (store_fpregs_to_thread): Ditto. (ps_get_thread_area): Ditto. (aarch64_linux_siginfo_fixup): Ditto. * aarch64-linux-tdep.c (aarch64_linux_init_abi): Set link map offsets to 32 or 64 bits. * aarch64-tdep.c (aarch64_ilp32_register_type): New function. (aarch64_gdbarch_init): Setup ILP32 support. Make sure the gdbarches have compatible ilp32 flags. Set long and ptr sizes correctly for ilp32. * aarch64-tdep.h (gdbarch_tdep) : New field. gdbserver ChangeLog: 2017-03-06  Andrew Pinski       Steve Ellcey   * linux-aarch64-low.c (aarch64_linux_read_description): Use machine instead of is_elf64 to determine architecture.  Give an error when using 32 bit gdbserver on 64 bit program.