summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2014-03-03 23:45:26 +0000
committerDmitry V. Levin <ldv@altlinux.org>2014-03-03 23:54:14 +0000
commit7a28f7f128fcca6ef0010b98cb21adcf8c3b8ae1 (patch)
tree2ce882a045c2f7a40a684f3162a0b620006a3212
parent54cabefc753cc72417bb610cb9f7873f4389e9f5 (diff)
downloadstrace-7a28f7f128fcca6ef0010b98cb21adcf8c3b8ae1.tar.gz
strace-7a28f7f128fcca6ef0010b98cb21adcf8c3b8ae1.tar.bz2
strace-7a28f7f128fcca6ef0010b98cb21adcf8c3b8ae1.tar.xz
aarch64: fix decoding of arm syscall numbers
If an aarch64 strace is tracing a process using the arm personality, it also needs to call the shuffle_scno function for the ARM-specific syscalls. * syscall.c (shuffle_scno): Define on AARCH64. (get_scno) [AARCH64]: Call shuffle_scno when the tracee is in 32-bit mode. Signed-off-by: Elliott Hughes <enh@google.com>
-rw-r--r--syscall.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/syscall.c b/syscall.c
index a0cc312..5c4b42e 100644
--- a/syscall.c
+++ b/syscall.c
@@ -926,7 +926,7 @@ print_pc(struct tcb *tcp)
/* Shuffle syscall numbers so that we don't have huge gaps in syscall table.
* The shuffling should be reversible: shuffle_scno(shuffle_scno(n)) == n.
*/
-#if defined(ARM) /* So far only ARM needs this */
+#if defined(ARM) || defined(AARCH64) /* So far only 32-bit ARM needs this */
static long
shuffle_scno(unsigned long scno)
{
@@ -1347,6 +1347,7 @@ get_scno(struct tcb *tcp)
/* We are in 32-bit mode */
/* Note: we don't support OABI, unlike 32-bit ARM build */
scno = arm_regs.ARM_r7;
+ scno = shuffle_scno(scno);
update_personality(tcp, 0);
break;
}