From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:54864) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S8tjL-0004cx-1Y for qemu-devel@nongnu.org; Sat, 17 Mar 2012 09:31:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S8tjJ-0000Hb-7a for qemu-devel@nongnu.org; Sat, 17 Mar 2012 09:31:34 -0400 Received: from fmmailgate07.web.de ([217.72.192.248]:47212) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S8tjI-0000HN-UI for qemu-devel@nongnu.org; Sat, 17 Mar 2012 09:31:33 -0400 Received: from moweb001.kundenserver.de (moweb001.kundenserver.de [172.19.20.114]) by fmmailgate07.web.de (Postfix) with ESMTP id 1966AEAFB9E for ; Sat, 17 Mar 2012 14:31:31 +0100 (CET) Message-ID: <4F649231.3060401@web.de> Date: Sat, 17 Mar 2012 14:31:29 +0100 From: Jan Kiszka MIME-Version: 1.0 References: <4F645124.7090001@web.de> In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigC0CC5B20052C315018FF3C90" Subject: Re: [Qemu-devel] Failed to set a breakpoint on start_kernel List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Wei Yang Cc: qemu-devel This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigC0CC5B20052C315018FF3C90 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable [ re-added qemu-devel to CC ] On 2012-03-17 13:10, Wei Yang wrote: >> Two major issues with this procedure: >> >> 1. When using kvm, a soft breakpoint (as set by 'b') will inject a tra= p >> instruction into the guest image - which is not yet loaded after the >> bios ran. You need to use a hardware breakpoint in this case. >> >> 2. Due to gdb limitations, you cannot switch between 16/32-bit mode (t= he >> CPU starts in 16 bit) and the 64-bit mode of kernel within the same gd= b >> session. Therefore: >> - let the target run into Linux is active >> - attach gdb >> - issue "hw start_kernel" >> - reboot (e.g. "monitor system_reset") >> - you will hit the breakpoint, and gdb will be usable >> >> Jan >> >> > oh, so when qemu run with kvm enabled, I couldn't debug the kernel righ= t? That's not what I said. You need to be aware of how it works. And, in contrast to pure emulation, kwm uses a non-transparent mechanism for injecting software breakpoints. Consider it the price for the gained spee= d. >=20 > I tried to run qemu with out -enable-kvm, kernel could stop at the brea= k point. >=20 > BTW, I tried "hw start_kernel", but it failed. > (gdb) hw start_kernel > Undefined command: "hw". Try "help". Sorry, typo. Must be "hb". Jan --------------enigC0CC5B20052C315018FF3C90 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/ iEYEARECAAYFAk9kkjIACgkQitSsb3rl5xQOdACfaVaH9THCEgkoH+aUWlasNyWv GZ8Anj4RB3zDr/j9qtXOlPmN6dU3ctqL =mimp -----END PGP SIGNATURE----- --------------enigC0CC5B20052C315018FF3C90--