>  The question is not so related to QEMU itself, but I want to give it a try.
> I am running a tiny OS on QEMU and debugging it with gdbstub. The tiny OS will
> fork process 1, 2, ... and so on. I want to follow the child process, but the
> GDB command `set follow-fork-mode child` doesn't work. This seems to be a bug
> or missing feature in GDB remote protocol. [1]
QEMU gdbstub has no idea of the guest OS, its fork, its processes or threads.
All that it has is a number of VCPUs that it treats like threads, and
they execute
continuous stream of instructions. There's no special instruction for fork and
the guest OS doesn't notify gdbstub of it either.

The natural way to debug processes would be to use OS's native debugger/gdbstub.
It is still possible to use QEMU gdbstub, but you'll need to analyze
guest OS state
to determine if you e.g. hit the breakpoint in the desired process context.

-- 
Thanks.
-- Max

Reply via email to