qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Mulyadi Santosa <a_mulyadi@softhome.net>
To: qemu-devel@nongnu.org, Steve Ellenoff <sellenoff@hotmail.com>
Subject: Re: [Qemu-devel] Trouble with GDB & Some 'Can it be done' Debugging questions
Date: Thu, 20 Jul 2006 14:11:43 +0700	[thread overview]
Message-ID: <200607201411.43580.a_mulyadi@softhome.net> (raw)
In-Reply-To: <BAY114-F38CDA81529C08CF233B723BD600@phx.gbl>

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

  reply	other threads:[~2006-07-20  7:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-19  8:43 [Qemu-devel] Trouble with GDB & Some 'Can it be done' Debugging questions Steve Ellenoff
2006-07-20  7:11 ` Mulyadi Santosa [this message]
2006-07-27  3:11   ` Steve Ellenoff
2006-07-20 19:17 ` Daniel Jacobowitz
2006-07-20 21:04   ` Fabrice Bellard
2006-07-20 21:30     ` Daniel Jacobowitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200607201411.43580.a_mulyadi@softhome.net \
    --to=a_mulyadi@softhome.net \
    --cc=qemu-devel@nongnu.org \
    --cc=sellenoff@hotmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).