From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:54460) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S8uCr-0001Qe-IE for qemu-devel@nongnu.org; Sat, 17 Mar 2012 10:02:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S8uCX-0005Pg-EP for qemu-devel@nongnu.org; Sat, 17 Mar 2012 10:02:05 -0400 Received: from mail-iy0-f173.google.com ([209.85.210.173]:43480) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S8uCX-0005P5-7K for qemu-devel@nongnu.org; Sat, 17 Mar 2012 10:01:45 -0400 Received: by iafj26 with SMTP id j26so7801549iaf.4 for ; Sat, 17 Mar 2012 07:01:42 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <4F649231.3060401@web.de> References: <4F645124.7090001@web.de> <4F649231.3060401@web.de> Date: Sat, 17 Mar 2012 22:01:42 +0800 Message-ID: From: Wei Yang Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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: Jan Kiszka Cc: qemu-devel 2012/3/17 Jan Kiszka : > [ 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 trap >>> 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 (th= e >>> CPU starts in 16 bit) and the 64-bit mode of kernel within the same gdb >>> session. Therefore: >>> =A0- let the target run into Linux is active >>> =A0- attach gdb >>> =A0- issue "hw start_kernel" >>> =A0- reboot (e.g. "monitor system_reset") >>> =A0- 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 right= ? > > 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. > Thanks :) It works. Though I don't understand it totally, I get the rough idea of it= . :) >> >> I tried to run qemu with out -enable-kvm, kernel could stop at the break= point. >> >> BTW, I tried "hw start_kernel", but it failed. >> (gdb) hw start_kernel >> Undefined command: "hw". =A0Try "help". > > Sorry, typo. Must be "hb". > > Jan > --=20 Richard Yang Help You, Help Me