[RFA 7/8] Avoid crashes when stepping through ravenscar context-switching

John Baldwin jhb@FreeBSD.org
Tue Mar 26 15:44:00 GMT 2019


On 3/26/19 7:44 AM, Tom Tromey wrote:
> When stepping through the ravenscar context-switching code, gdb will
> try to single-step the current thread, while leaving the other threads
> stopped.  This results in an assertion failure in finish_step_over,
> because the event thread is not the request thread.
> 
> This patch introduces a new target method so that infrun can ask the
> target whether this can happen; and then changes infrun to handle this
> case.  When the target can have an unexpected thread switch,
> single-stepping may also switch threads.

I think single-stepping kernels via debug server stubs in things like
qemu can also do this, so it will be useful in those contexts as well.
I'm trying to think if the target is the right place to do this rather
than gdbarch, but I think you are right to do it in the target.  We
might want a way to forward this request to remote targets (FreeBSD's
gdb server for the kernel is a remote target that would probably want
to say that this is true).

-- 
John Baldwin



More information about the Gdb-patches mailing list