From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41676) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VP4ka-0007PU-Gb for qemu-devel@nongnu.org; Thu, 26 Sep 2013 02:08:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VP4kT-0004t2-60 for qemu-devel@nongnu.org; Thu, 26 Sep 2013 02:08:32 -0400 Received: from mout.web.de ([212.227.15.4]:52453) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VP4kS-0004sm-Sy for qemu-devel@nongnu.org; Thu, 26 Sep 2013 02:08:25 -0400 Received: from mchn199C.mchp.siemens.de ([95.157.58.223]) by smtp.web.de (mrweb002) with ESMTPSA (Nemesis) id 0LbImQ-1W8bqm41Ji-00ktLo for ; Thu, 26 Sep 2013 08:08:23 +0200 Message-ID: <5243CF52.6020400@web.de> Date: Thu, 26 Sep 2013 08:08:18 +0200 From: Jan Kiszka MIME-Version: 1.0 References: In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="no9V6u6bdX1LrOVk81IHlNe1lOu3h9Bgr" Subject: Re: [Qemu-devel] Fwd: Guest VM debug (Int 3 panic) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Hu Yaohui Cc: qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --no9V6u6bdX1LrOVk81IHlNe1lOu3h9Bgr Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 2013-09-25 20:08, Hu Yaohui wrote: > Hi All, > I am trying to debug guest OS through qemu with kvm enabled. > Following is what I have done: > 1: fire the qemu-kvm > > sudo qemu-system-x86_64 -hda vdisk.img -m 4096 -smp 2 -vnc :2 -boot c -= s > >=20 > 2: wait until login into guest OS (ubuntu 10.04) >=20 > 3: fire gdb > > gdb vmlinux > target remote :1234 > b do_fork > set arch i386:x86-64 "set arch" is unneeded. vmlinux already tells gdb that you are debugging x86-64. > c > >=20 > 4: after I typed "ls" in guest OS. The guest OS paniced with some messa= ge > related to "int 3 blah blah". Then crashed. >=20 > Someone said we should use hardware breakpoint when kvm is enabled, or You can use hardware breakpoints as well but it is not required unless the target code can be overwritten (e.g. due to a reset). > "monitor system_reset" after set the breakpoint, but it didn't work for= me. > The hardware breakpoint could not been hit anyway. >=20 > I have tried with "-no-kvm", it works normally with breakpoints. But I = want > to debug the guest OS with kvm enabled. I don't know whether someone ha= s > met this similar situation. You didn't tell us which version of QEMU (or is it old qemu-kvm?) you are using, what host kernel and which CPU type (AMD vs. Intel). Did you try a recent version of all of them already? I'm currently not aware of gdb problems with QEMU/KVM, I'm rather using it on an almost daily basis (typically git head versions). If you want to debug your issue: there is ftrace to record what KVM events happen, and you can switch gdb into verbose mode as well, comparing the communication between KVM on/off: set debug remote 1. Jan --no9V6u6bdX1LrOVk81IHlNe1lOu3h9Bgr 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 Thunderbird - http://www.enigmail.net/ iEYEARECAAYFAlJDz1UACgkQitSsb3rl5xT6xACeNt79Yq6tojI0Mfcsx/yZw9ZW ouIAoNcH47RNmhKs3PbWnY+HkualJjHi =Ni1s -----END PGP SIGNATURE----- --no9V6u6bdX1LrOVk81IHlNe1lOu3h9Bgr--