From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=38332 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P324h-00071L-GB for qemu-devel@nongnu.org; Tue, 05 Oct 2010 03:36:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P324g-0005MB-H4 for qemu-devel@nongnu.org; Tue, 05 Oct 2010 03:36:35 -0400 Received: from goliath.siemens.de ([192.35.17.28]:19338) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P324g-0005Lq-2p for qemu-devel@nongnu.org; Tue, 05 Oct 2010 03:36:34 -0400 Message-ID: <4CAAD578.2040706@siemens.com> Date: Tue, 05 Oct 2010 09:36:24 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <4CA99797.7000402@siemens.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: 64-bit Qemu and remote GDB to Kernel Error List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Matt Davis Cc: qemu-devel Am 04.10.2010 23:32, Matt Davis wrote: > On Mon, Oct 4, 2010 at 8:00 PM, Jan Kiszka wrote: >> Am 04.10.2010 04:47, Matt Davis wrote: >>> Hello, >>> I am trying to debug a 32-bit linux kernel with gdb and qemu. My qemu >>> runs the 64-bit kernel as: >>> user@host> qemu -kernel vmlinuz -S -s (not using kvm). If I try with >>> kvm the breakpoint does not even seem to get tripped. >> >> Which qemu version is affected by this issue? > > Jan, > The version of qemu I am running is: > QEMU PC emulator version 0.12.5 (qemu-kvm-0.12.5), Copyright (c) > 2003-2008 Fabrice Bellard > > The version of gdb is: 7.2 > OK, now I realize the reason of this effect: KVM uses software breakpoints by default, i.e. it injects int3 into the guest code. If you do this before the kernel was loaded, they will be overwritten by the actual code later on. Use hardware breakpoints in case you want to trap the guest early. Otherwise activate the breakpoints after the kernel was loaded into RAM. You don't have this limitation in emulation mode as, here, you can modify the guest code transparently (effectively, all breakpoints are hardware breakpoints then, and they are not limited in amount). Jan -- Siemens AG, Corporate Technology, CT T DE IT 1 Corporate Competence Center Embedded Linux