Re: [PATCH v2] MIPS: Add basic support for ptrace single step

From: Thomas Bogendoerfer
Date: Thu Feb 11 2021 - 05:35:53 EST


On Wed, Feb 10, 2021 at 02:52:41PM +0800, Tiezhu Yang wrote:
> In the current code, arch_has_single_step() is not defined on MIPS,
> that means MIPS does not support instruction single-step for user mode.
>
> Delve is a debugger for the Go programming language, the ptrace syscall
> PtraceSingleStep() failed [1] on MIPS and then the single step function
> can not work well, we can see that PtraceSingleStep() definition returns
> ptrace(PTRACE_SINGLESTEP) [2].
>
> So it is necessary to support ptrace single step on MIPS.

one way to see it. The other way is, that the Go debugger needs to learn
single stepping without ptrace single step support. IMHO gdb is already
able to do that.

IMHO ptrace single step is for CPUs supporting single stepping and not
for emulating it in the kernel.

Thomas.

--
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea. [ RFC1925, 2.3 ]