[strace/strace] [RFC] Add 64-bit LoongArch support (PR #205)

Huacai Chen notifications at github.com
Sat Jan 8 15:21:08 UTC 2022


> > ```
> > regs->orig_a0 = regs->regs[4];
> > regs->regs[4] = -ENOSYS;
> > nr = syscall_enter_from_user_mode(regs, nr);
> > ```
> 
> This way the first syscall argument won't be available for ptracers because `regs->orig_a0` is not exposed in `struct user_pt_regs` and not handled by `gpr_get` and `gpr_set`.

Hmm, can we keep do_syscall() as is and solve the ptrace problem by overriding arch_syscall_enter_tracehook() like this?
static inline __must_check int arch_syscall_enter_tracehook(struct pt_regs *regs)
{
        ret = tracehook_report_syscall_entry(regs);
        if (ret)
                syscall_set_return_value(current, current_pt_regs(), -ENOSYS, 0);

        return ret;
}



-- 
Reply to this email directly or view it on GitHub:
https://github.com/strace/strace/pull/205#issuecomment-1008023467
You are receiving this because you are subscribed to this thread.

Message ID: <strace/strace/pull/205/c1008023467 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20220108/27b60b4d/attachment.htm>


More information about the Strace-devel mailing list