From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:53772) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rp2UA-00027s-ET for qemu-devel@nongnu.org; Sun, 22 Jan 2012 13:49:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rp2U9-0005Wv-8P for qemu-devel@nongnu.org; Sun, 22 Jan 2012 13:49:50 -0500 Received: from fmmailgate02.web.de ([217.72.192.227]:38804) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rp2U8-0005Wp-SH for qemu-devel@nongnu.org; Sun, 22 Jan 2012 13:49:49 -0500 Received: from moweb001.kundenserver.de (moweb001.kundenserver.de [172.19.20.114]) by fmmailgate02.web.de (Postfix) with ESMTP id 6D1731C06138D for ; Sun, 22 Jan 2012 19:49:33 +0100 (CET) Message-ID: <4F1C5A39.10907@web.de> Date: Sun, 22 Jan 2012 19:49:29 +0100 From: Jan Kiszka MIME-Version: 1.0 References: In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigEAE7C1D441B1C5989009FB37" Subject: Re: [Qemu-devel] Failed to use gdb with qemu 15.1 (with and without kvm support) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Francis Moreau Cc: qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigEAE7C1D441B1C5989009FB37 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 2012-01-22 15:20, Francis Moreau wrote: > Hello, >=20 > I'm trying to debug a 64 bits kernel (3.2) using qemu (with and > without KVM support). The host is also 64 bits. Version of gdb I'm > using is 7.1. >=20 > To do that I simply start qemu like the following: >=20 > $ qemu-system-x86_64 -kernel bzImage -append "root=3D/dev/sda1 > console=3DttyS0 3" -serial stdio -S -s >=20 > and in another term, I start gdb like this: >=20 > $ gdb vmlinux > $ target remote locahost:1234 > $ b prepare_namespace > $ continue > Continuing. > Remote 'g' packet reply is too long: af75919effffffff0............. >=20 > So it fails when gdb stops on the breakpoint with the above message. >=20 > If I try to dump the backtrace I got: >=20 > $ bt > Target is executing. > $ info thread > * 1 Thread 1 (CPU#0 [running]) (running) >=20 > But the VM seems to be stopped because if I'm asking the status to qemu= : >=20 > $ info status > VM status: paused >=20 > I also tried qemu with KVM support but I get one more problem: gdb is > ignoring my breakpoint. >=20 > Could anybody help me to make gdb work ? When stopping the guest with -S before it booted, gdb will interrupt it while it is still in 16-bit real mode. Later on, when Linux runs, the guest is in 64-bit protected mode. gdb is not prepared for such a switch. All you can do: - let the guest run until it surely reached 64-bit mode - interrupt it and set a breakpoint at the desired early-boot location, important: if using KVM, set a hardware breakpoint! - continue and reboot the guest without detaching gdb - on next boot, the breakpoint will trigger HTH, Jan --------------enigEAE7C1D441B1C5989009FB37 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk8cWjwACgkQitSsb3rl5xRxegCcCrh+qs1whqcVcte07Rlj0OhZ dFIAoJN5NkmmmlKoE9yhsMrBEJIhwWcX =1Fzj -----END PGP SIGNATURE----- --------------enigEAE7C1D441B1C5989009FB37--