[strace/strace] [RFC] Add 64-bit LoongArch support (PR #205)
WÁNG Xuěruì
notifications at github.com
Sat Jan 8 16:12:05 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;
> ```
>
> }
Hi @chenhuacai, I tried in [this commit](https://github.com/xen0n/linux/commit/d748c0a67619f77128f46ecd392fbc9f0686bcbe) and confirmed it's not working; exactly the same failures as before.
--
Reply to this email directly or view it on GitHub:
https://github.com/strace/strace/pull/205#issuecomment-1008044511
You are receiving this because you are subscribed to this thread.
Message ID: <strace/strace/pull/205/c1008044511 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20220108/4c60cffc/attachment.htm>
More information about the Strace-devel
mailing list