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

Dmitry V. Levin notifications at github.com
Sun Jan 9 16:30:45 UTC 2022

On Sun, Jan 09, 2022 at 05:58:44AM -0800, Huacai Chen wrote:
> > > With @chenhuacai's [latest patch](https://github.com/xen0n/linux/commit/593f8c0180fc1056e3ea0ca91ce9a8096f40b7ef), every test passes except this:
> > 
> > Yes, this looks plausible.
> > 
> > As I said earlier, another problem with the current implementation of `do_syscall` is that unlike other architectures, here the ptracer cannot change the first syscall argument because it is currently stored in `regs->orig_a0` which is out of reach of ptracers. What do you think about exposing `regs->orig_a0` to ptracers?
> Exposing orig_a0 means modifying user_pt_regs, gpr_get(), gpr_set() and all tracers (gdb, strace, etc) and don't need to overriding arch_syscall_enter_tracehook(), right?

Yes, exposing orig_a0 means modifying user_pt_regs, gpr_get(), gpr_set(),
and all tracers.
This would allow to do
	regs->regs[4] = -ENOSYS;
in do_syscall() right before the syscall_enter_from_user_mode()
invocation, and there won't be any need to override
arch_syscall_enter_tracehook() then.

Reply to this email directly or view it on GitHub:
You are receiving this because you are subscribed to this thread.

Message ID: <strace/strace/pull/205/c1008331290 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20220109/32dd97e1/attachment.htm>

More information about the Strace-devel mailing list