From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1G3Siv-0001xT-S0 for qemu-devel@nongnu.org; Thu, 20 Jul 2006 03:13:29 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1G3Sis-0001nr-Tq for qemu-devel@nongnu.org; Thu, 20 Jul 2006 03:13:29 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1G3Sis-0001nT-GU for qemu-devel@nongnu.org; Thu, 20 Jul 2006 03:13:26 -0400 Received: from [66.54.152.27] (helo=jive.SoftHome.net) by monty-python.gnu.org with smtp (Exim 4.52) id 1G3Sj0-0008RO-Tw for qemu-devel@nongnu.org; Thu, 20 Jul 2006 03:13:35 -0400 From: Mulyadi Santosa Subject: Re: [Qemu-devel] Trouble with GDB & Some 'Can it be done' Debugging questions Date: Thu, 20 Jul 2006 14:11:43 +0700 References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200607201411.43580.a_mulyadi@softhome.net> Reply-To: a_mulyadi@softhome.net, 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, Steve Ellenoff Hi Steve... > Hi - > > I'm having a bit of trouble getting gdb to do what I was hoping it > would with qemu. Following the instructions in the docs: > > #1) I launch qemu with -S -s flags ( since I want to trace the > bootloader code ) > It says: Waiting gdb connection on port 1234 - which is correct, and > it opens the monitor window. > > #2) I open a second terminal window and type gdb vmlinux >[cut]... > "i386-redhat-linux-gnu"...vmlinux: No such file or directory. This message obviously said: either you don't actually have "vmlinux" file or you don't give correct path to the vmlinux file. Can you confirm that you had given correct path? Also, it is possible that its name isn't vmlinux (since one is free to rename it)... > #3) Anytime I try to dump the instruction at the current IP such as: > (gdb) x /10i $eip > > I get this - which means it's not actually reading or displaying the > memory properly, since those look to be what you would see if it was > all 0 in memory (or maybe it's all 0xff - whichever).l are you sure you had executed this command in gdb?: target remote localhost:1234 Seems like gdb is dumping a wrong address space... > This leads to my next question: > > #4) Can you use gdb to debug and set breakpoints on binary code you > don't have any source code or other file for the binary, except the > binary file itself? Everything I've read so far on GDB (and > especially any GDB Gui front end) seems to suggest it's not possible. > That would really suck. Well, you can, but of course you can't set the breakpoint at certain source code's line, but instead put the breakpoint explicitly as memory address. Anyway, i really suggest to read more about gdb by typing: info gdb in your shell prompt. It will display the complete gdb manual. Don't be hesitate to ask (we're all still learning after all)... regards, Mulyadi