From f61fda368da04a569e10c9928c01cfdca0faff7e Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 24 Jun 2023 17:15:21 +0200 Subject: Argument 3 and 4 are swapped on SPARC for PTRACE_GETREGS and PTRACE_SETREGS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- sctrace.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sctrace.c') diff --git a/sctrace.c b/sctrace.c index c13c5bb..54bd977 100644 --- a/sctrace.c +++ b/sctrace.c @@ -22,7 +22,7 @@ handle_syscall(struct process *proc) switch ((int)proc->state) { default: /* Get system call arguments */ - if (ptrace(PTRACE_GETREGS, proc->pid, NULL, ®s)) + if (ptrace(PTRACE_GETREGS, proc->pid, REGARGS(NULL, ®s))) eprintf("ptrace PTRACE_GETREGS %ju NULL :", (uintmax_t)proc->pid); proc->scall = regs.SYSCALL_NUM_REG; #ifdef CHECK_ARCHITECTURE @@ -45,7 +45,7 @@ handle_syscall(struct process *proc) case CloneParent: case ForkParent: /* Get system call result */ - if (ptrace(PTRACE_GETREGS, proc->pid, NULL, ®s)) + if (ptrace(PTRACE_GETREGS, proc->pid, REGARGS(NULL, ®s))) eprintf("ptrace PTRACE_GETREGS %ju NULL :", (uintmax_t)proc->pid); /* Get or set return */ @@ -53,7 +53,7 @@ handle_syscall(struct process *proc) proc->ret = regs.SYSCALL_RET_REG; } else { regs.SYSCALL_RET_REG = proc->ret; - if (ptrace(PTRACE_SETREGS, proc->pid, NULL, ®s)) + if (ptrace(PTRACE_SETREGS, proc->pid, REGARGS(NULL, ®s))) eprintf("ptrace PTRACE_SETREGS %ju NULL :", (uintmax_t)proc->pid); if (ptrace(PTRACE_SYSCALL, proc->pid, NULL, 0)) eprintf("ptrace PTRACE_SYSCALL %ju NULL 0:", (uintmax_t)proc->pid); -- cgit v1.2.3-70-g09d2