Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JOU3F-0003rx-VS for qemu-devel@nongnu.org; Mon, 11 Feb 2008 03:30:10 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JOU3E-0003q2-5N for qemu-devel@nongnu.org; Mon, 11 Feb 2008 03:30:08 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JOU3E-0003pr-0A for qemu-devel@nongnu.org; Mon, 11 Feb 2008 03:30:08 -0500 Received: from mx20.gnu.org ([199.232.41.8]) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JOU3D-0003k0-Tp for qemu-devel@nongnu.org; Mon, 11 Feb 2008 03:30:08 -0500 Received: from static-71-162-243-5.phlapa.fios.verizon.net ([71.162.243.5] helo=grelber.thyrsus.com) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JOU38-00075k-K9 for qemu-devel@nongnu.org; Mon, 11 Feb 2008 03:30:02 -0500 Received: from landley.net (localhost [127.0.0.1]) by grelber.thyrsus.com (Postfix) with ESMTP id 35A562C83DE for ; Mon, 11 Feb 2008 03:30:18 -0500 (EST) From: Rob Landley Date: Mon, 11 Feb 2008 02:29:54 -0600 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200802110229.54617.rob@landley.net> Subject: [Qemu-devel] Using gdb to debug early kernel boot? Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org I'm trying to use gdb -s to debug the early boot of the sh4 kernel, but it's not liking me. It does this: > qemu-system-sh4 -s -S -M r2d -kernel arch/sh/boot/zImage ... wait for gdb ... > qemu: fatal: Trying to execute code outside RAM or ROM at 0x88800058 > > pc=0x88800058 sr=0x400000f0 pr=0x00000000 fpscr=0x00040001 > r0=0x88800058 r1=0xabffffe0 r2=0xdc800000 r3=0x88800000 > r4=0x410ed11e r5=0xd211c711 r6=0x89253020 r7=0xd0193208 > r8=0x2019e1e0 r9=0x6103d30f r10=0x64123128 r11=0x56125511 > r12=0x00000000 r13=0x00000000 r14=0x00000000 r15=0x00000000 > r16=0x00000000 r17=0x400000f0 r18=0x00000000 r19=0x00000000 > r20=0x00000000 r21=0x00000000 r22=0x00000000 r23=0x00000000 > Aborted (core dumped) (Which is the same behavior without -s -S). Over in the gdb session, I run gdb vmlinux and then: > (gdb) target remote localhost:1234 > Remote debugging using localhost:1234 > warning: shared library handler failed to enable breakpoint > 0x00000000 in ?? () > (gdb) c > Continuing. > Watchdog has expired. Target detached. > (gdb) At which point the qemu instance in the other window has crashed. Am I doing it wrong? Rob -- "One of my most productive days was throwing away 1000 lines of code." - Ken Thompson.