You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add pc check for instruction stepping by breakpoints
NativeProcessFreeBSD::MonitorSIGTRAP (MIPS) and
NativeProcessLinux::MonitorBreakpoint (MIPS, armv7, RISCV, LoongArch)
do instruction stepping by setting a breakpoint on the next instruction
that will be executed, and resuming the thread. They check that there
was one of these "instruction step" breakpoints set for this thread,
and rewrite the stop reason from "breakpoint hit" to "trace".
However, if a user is sitting at a BreakpointSite (break instruction),
and does `stepi`, then a breakpoint instruction will be put on the
next instruction, the thread resumes, and we stop at the same
location having hit our *original* breakpoint, not the one inserted
on the next instruction for stepping. The stop reason is rewritten to
"trace" but the pc hasn't advanced. The stepping logic will try to
instruction step again and it infinite loops.
I changed NativeProcessLinux and NativeProcessFreeBSD to only rewrite
the stop reason to "trace" when the pc is the breakpoint we added
for the insn-step. I don't have any of the devices that use this
behavior, but I did at least compile test NativeProcessLinux in an
Ubuntu AArch64 VM (but my core doesn't support aarch32 so I can't
test it).
0 commit comments