|
From: | Steve Ellenoff |
Subject: | Re: [Qemu-devel] Trouble with GDB & Some 'Can it be done' Debugging questions |
Date: | Thu, 27 Jul 2006 03:11:48 +0000 |
Thanks for your help!! That goes for all the people who responded on the thread! :)
Turns out, I just didn't understand what the vmlinux part meant. Being totally new to linux, I just thought that was the required syntax for using gdb with qemu. I didn't realize it was supposed to be the name of the file containing the debug symbols.
The reason it was also a bit confusing was that in my case I don't have source code or debug symbols for the code I'm trying to trace through qemu, so for me I found out the correct syntax is just to call gdb with no parameters.
When I did that, it properly displayed all the correct instructions (in assembly of course) at each memory location I wanted to view.
I think the reason the instructions weren't decoding was because I had called GDB with vmlinux, but that of course, didn't exist, and it confused gdb.
Thanks again for all your help.
-Steve
From: Mulyadi Santosa <address@hidden>
Reply-To: address@hidden
To: address@hidden, "Steve Ellenoff" <address@hidden>
Subject: Re: [Qemu-devel] Trouble with GDB & Some 'Can it be done' Debugging questions
Date: Thu, 20 Jul 2006 14:11:43 +0700
>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
>
[Prev in Thread] | Current Thread | [Next in Thread] |