Remote Kernel Debugging over QEMU?

Robert Watson rwatson at FreeBSD.org
Sat Mar 8 22:32:32 UTC 2008


On Sat, 8 Mar 2008, Yoshihiro Ota wrote:

> Has anyone tried to remote-debugging of a system running on Qemu?
>
> I thought if I could attach kgdb from Qemu host to a guest FreeBSD running 
> on Qemu, it would be very helpful for many reasons, i.e. no hardware 
> requirements, avoid fscking all disks, and so on.
>
> Has anyone ever attempted?  I spent a half day but due to lack of remote 
> debugging experience and some other knowledge, it wasn't successful.

I don't use Qemu, but if it has an option to expose a host serial port as a 
guest serial port and FreeBSD works with the guest serial port emulation, you 
might take a look at nmdm(4), which creates two ttys set up as a "null modem". 
You can then attach kgdb to one end, and qemu to the other, which is a tricky 
used by our VMware users to do much the same thing.

Robert N M Watson
Computer Laboratory
University of Cambridge


More information about the freebsd-hackers mailing list