Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 8 Mar 2008 22:18:32 +0200
From:      Kostik Belousov <kostikbel@gmail.com>
To:        Yoshihiro Ota <ota@j.email.ne.jp>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Remote Kernel Debugging over QEMU?
Message-ID:  <20080308201832.GA10374@deviant.kiev.zoral.com.ua>
In-Reply-To: <20080308144505.9c72e484.ota@j.email.ne.jp>
References:  <20080308144505.9c72e484.ota@j.email.ne.jp>

next in thread | previous in thread | raw e-mail | index | archive | help

--fUYQa+Pmc3FrFX/N
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sat, Mar 08, 2008 at 02:45:05PM -0500, Yoshihiro Ota wrote:
> Hello, folks,
>=20
> Has anyone tried to remote-debugging of a system running on Qemu?
>=20
> 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.
>=20
> 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.

--fUYQa+Pmc3FrFX/N
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (FreeBSD)

iEYEARECAAYFAkfS9JgACgkQC3+MBN1Mb4iHNQCbBubdFeHFsSqyyZHKNAnrWJ81
5toAoM9dWG4+oP90qgidR6uTZKvnUwPR
=mySC
-----END PGP SIGNATURE-----

--fUYQa+Pmc3FrFX/N--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080308201832.GA10374>