Remote Kernel Debugging over QEMU?
Yoshihiro Ota
ota at j.email.ne.jp
Sun Mar 9 03:07:22 UTC 2008
On Sat, 8 Mar 2008 22:18:32 +0200
Kostik Belousov <kostikbel at gmail.com> wrote:
> On Sat, Mar 08, 2008 at 02:45:05PM -0500, Yoshihiro Ota wrote:
> > Hello, folks,
> >
> > 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 do it often, with the stock gdb built from FSF sources.
>
> Simply run the qemu with the "-s" switch, then start gdb with kernel.debug
> argument, and, in the gdb, do "target remote localhost:1234".
>
> I use latest gdb since it much better handles debugging information
> generated by the 4.2 gcc.
>
> Also, this setup allows me to use both convenience of ddb specific
> commands (inside QEMU) and gdb data inspection facilities (almost)
> simultaneously.
>
Thank you for all replies.
This one was the simplest one, indeed.
My attempt was like how Robert described but I haven't understood
to do that way enough.
Regards,
Hiro
More information about the freebsd-hackers
mailing list