diff options
author | Steve McIntyre <steve.mcintyre@linaro.org> | 2012-11-10 11:24:48 +0000 |
---|---|---|
committer | Dmitry V. Levin <ldv@altlinux.org> | 2012-11-12 15:19:58 +0000 |
commit | 890a5cad2321ae72fb5ca1b253edb874b1ca7180 (patch) | |
tree | 51cc2c84a334598ff4e1fb2849121a91080229eb /defs.h | |
parent | 716c93ecf8edc5dda092d4fa4d878f333a601b51 (diff) | |
download | strace-890a5cad2321ae72fb5ca1b253edb874b1ca7180.tar.gz strace-890a5cad2321ae72fb5ca1b253edb874b1ca7180.tar.bz2 strace-890a5cad2321ae72fb5ca1b253edb874b1ca7180.tar.xz |
Add support for tracing 32-bit ARM EABI binaries on AArch64
* defs.h [AARCH64]: Copy in the definition of arm_pt_regs and the
accessor macros, so it's possible to build on AArch64 without
ARM system headers. Set SUPPORTED_PERSONALITIES to 2.
Define PERSONALITY0_WORDSIZE and PERSONALITY1_WORDSIZE.
Set DEFAULT_PERSONALITY to 1.
* linux/aarch64/errnoent1.h: New file, includes generic errnoent.h.
* linux/aarch64/ioctlent1.h: New file, includes generic ioctlent.h.
* linux/aarch64/signalent1.h: New file, includes generic signalent.h.
* linux/aarch64/syscallent1.h: Rename from linux/aarch64/syscallent.h.
* linux/aarch64/syscallent.h: New file, includes arm/syscallent.h.
* syscall.c [AARCH64]: Define aarch64_regs.
(update_personality) [AARCH64]: Add debug output.
(get_scno) [AARCH64]: Determine if we're in ARM or AArch64 mode by
checking the size of the returned uio structure from PTRACE_GETREGSET
and interpret the structure accordingly.
(get_syscall_result): Likewise.
(get_syscall_args): Merge the AArch64 and ARM sections so that on
AArch64 we can fall back to supporting the ARM personality.
(get_error): Likewise.
Signed-off-by: Steve McIntyre <steve.mcintyre@linaro.org>
Diffstat (limited to 'defs.h')
-rw-r--r-- | defs.h | 34 |
1 files changed, 34 insertions, 0 deletions
@@ -196,6 +196,30 @@ extern long ptrace(int, int, char *, long); # define REG_PC (0*8) # define REG_SYSCALL (2*8) #endif /* SH64 */ +#ifdef AARCH64 +#define NUM_ARM_REGS 18 +struct arm_pt_regs { + int uregs[NUM_ARM_REGS]; +}; +#define ARM_cpsr uregs[16] +#define ARM_pc uregs[15] +#define ARM_lr uregs[14] +#define ARM_sp uregs[13] +#define ARM_ip uregs[12] +#define ARM_fp uregs[11] +#define ARM_r10 uregs[10] +#define ARM_r9 uregs[9] +#define ARM_r8 uregs[8] +#define ARM_r7 uregs[7] +#define ARM_r6 uregs[6] +#define ARM_r5 uregs[5] +#define ARM_r4 uregs[4] +#define ARM_r3 uregs[3] +#define ARM_r2 uregs[2] +#define ARM_r1 uregs[1] +#define ARM_r0 uregs[0] +#define ARM_ORIG_r0 uregs[17] +#endif /* AARCH64 */ #define SUPPORTED_PERSONALITIES 1 #define DEFAULT_PERSONALITY 0 @@ -241,6 +265,16 @@ extern long ptrace(int, int, char *, long); # define PERSONALITY1_WORDSIZE 4 #endif +#ifdef AARCH64 +# undef SUPPORTED_PERSONALITIES +/* The existing ARM personality, then AArch64 */ +# define SUPPORTED_PERSONALITIES 2 +# define PERSONALITY0_WORDSIZE 4 +# define PERSONALITY1_WORDSIZE 8 +# undef DEFAULT_PERSONALITY +# define DEFAULT_PERSONALITY 1 +#endif + #ifdef POWERPC64 # undef SUPPORTED_PERSONALITIES # define SUPPORTED_PERSONALITIES 2 |