diff options
author | Yao Qi <yao.qi@linaro.org> | 2017-10-23 14:52:28 +0100 |
---|---|---|
committer | Christoph Muellner <christoph.muellner@theobroma-systems.com> | 2018-04-27 14:38:50 +0200 |
commit | 3adb5fee9ee3d784d8547029be2cb07a4802ace8 (patch) | |
tree | 1773005896589d4f3183f7c0764d865d90b26342 /gdb/aarch64-linux-nat.c | |
parent | 4e556d512fa9014a7c68d33310171f18301236e4 (diff) |
ILP32: GDBHEADgdb-8.1-amp-branch
Rebased 5e5a2a68c772d59c41d4e536949ce4ba3dc9b3ea from linaro's
gdb-aarch64-ilp32 branch on GDB 8.1-release.
gdb:
2017-03-06 Andrew Pinski <apinski@cavium.com>
Steve Ellcey <sellcey@cavium.com>
Yao Qi <yao.qi@linaro.org>
* 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) <ilp32>: New field.
gdb/gdbserver:
2017-03-06 Andrew Pinski <apinski@cavium.com>
Steve Ellcey <sellcey@cavium.com>
* linux-aarch64-low.c (aarch64_linux_read_description):
Diffstat (limited to 'gdb/aarch64-linux-nat.c')
-rw-r--r-- | gdb/aarch64-linux-nat.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/gdb/aarch64-linux-nat.c b/gdb/aarch64-linux-nat.c index 9385659f14..bd797fa210 100644 --- a/gdb/aarch64-linux-nat.c +++ b/gdb/aarch64-linux-nat.c @@ -49,6 +49,10 @@ #define TRAP_HWBKPT 0x0004 #endif +/* Check if we are on arm (as opposed to aarch64). */ +#define IS_ARM32(gdbarch) \ + (gdbarch_bfd_arch_info(gdbarch)->arch == bfd_arch_arm) + /* Per-process data. We don't bind this to a per-inferior registry because of targets like x86 GNU/Linux that need to keep track of processes that aren't bound to any inferior (e.g., fork children, @@ -166,7 +170,7 @@ fetch_gregs_from_thread (struct regcache *regcache) tid = ptid_get_lwp (regcache_get_ptid (regcache)); iovec.iov_base = ®s; - if (gdbarch_bfd_arch_info (gdbarch)->bits_per_word == 32) + if (IS_ARM32 (gdbarch)) iovec.iov_len = 18 * 4; else iovec.iov_len = sizeof (regs); @@ -175,7 +179,7 @@ fetch_gregs_from_thread (struct regcache *regcache) if (ret < 0) perror_with_name (_("Unable to fetch general registers.")); - if (gdbarch_bfd_arch_info (gdbarch)->bits_per_word == 32) + if (IS_ARM32 (gdbarch)) aarch32_gp_regcache_supply (regcache, (uint32_t *) regs, 1); else { @@ -203,7 +207,7 @@ store_gregs_to_thread (const struct regcache *regcache) tid = ptid_get_lwp (regcache_get_ptid (regcache)); iovec.iov_base = ®s; - if (gdbarch_bfd_arch_info (gdbarch)->bits_per_word == 32) + if (IS_ARM32 (gdbarch)) iovec.iov_len = 18 * 4; else iovec.iov_len = sizeof (regs); @@ -212,7 +216,7 @@ store_gregs_to_thread (const struct regcache *regcache) if (ret < 0) perror_with_name (_("Unable to fetch general registers.")); - if (gdbarch_bfd_arch_info (gdbarch)->bits_per_word == 32) + if (IS_ARM32 (gdbarch)) aarch32_gp_regcache_collect (regcache, (uint32_t *) regs, 1); else { @@ -248,7 +252,7 @@ fetch_fpregs_from_thread (struct regcache *regcache) iovec.iov_base = ®s; - if (gdbarch_bfd_arch_info (gdbarch)->bits_per_word == 32) + if (IS_ARM32 (gdbarch)) { iovec.iov_len = VFP_REGS_SIZE; @@ -295,7 +299,7 @@ store_fpregs_to_thread (const struct regcache *regcache) iovec.iov_base = ®s; - if (gdbarch_bfd_arch_info (gdbarch)->bits_per_word == 32) + if (IS_ARM32 (gdbarch)) { iovec.iov_len = VFP_REGS_SIZE; @@ -328,7 +332,7 @@ store_fpregs_to_thread (const struct regcache *regcache) (char *) ®s.fpcr); } - if (gdbarch_bfd_arch_info (gdbarch)->bits_per_word == 32) + if (IS_ARM32 (gdbarch)) { ret = ptrace (PTRACE_SETREGSET, tid, NT_ARM_VFP, &iovec); if (ret < 0) @@ -460,10 +464,9 @@ ps_err_e ps_get_thread_area (struct ps_prochandle *ph, lwpid_t lwpid, int idx, void **base) { - int is_64bit_p - = (gdbarch_bfd_arch_info (target_gdbarch ())->bits_per_word == 64); + int is_aarch64_p = !IS_ARM32 (target_gdbarch ()); - return aarch64_ps_get_thread_area (ph, lwpid, idx, base, is_64bit_p); + return aarch64_ps_get_thread_area (ph, lwpid, idx, base, is_aarch64_p); } @@ -517,7 +520,7 @@ aarch64_linux_siginfo_fixup (siginfo_t *native, gdb_byte *inf, int direction) /* Is the inferior 32-bit? If so, then do fixup the siginfo object. */ - if (gdbarch_bfd_arch_info (gdbarch)->bits_per_word == 32) + if (IS_ARM32 (gdbarch)) { if (direction == 0) aarch64_compat_siginfo_from_siginfo ((struct compat_siginfo *) inf, |