This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: RFC: Improve support for "debugging" unlinked objects
- From: Daniel Jacobowitz <drow at false dot org>
- To: Eli Zaretskii <eliz at gnu dot org>
- Cc: gdb-patches at sourceware dot org
- Date: Thu, 9 Jun 2005 09:17:22 -0400
- Subject: Re: RFC: Improve support for "debugging" unlinked objects
- References: <20050608214956.GA10586@nevyn.them.org> <uzmu08a9m.fsf@gnu.org>
On Thu, Jun 09, 2005 at 06:44:05AM +0300, Eli Zaretskii wrote:
> > Date: Wed, 8 Jun 2005 17:49:56 -0400
> > From: Daniel Jacobowitz <drow@false.org>
> >
> > If you compile a file containing both code and initialized data, and load
> > the unlinked object (.o) file using GDB, "print Variable" won't work.
>
> In what situations would such a method (loading an unlinked object
> file) be useful? I don't see it documented anywhere in the manual, so
> I'd like to consider saying a few words about when and how to do that.
It's useful for examination: you can disassemble functions and inspect
variables. Also, with a fix that I'm going to commit to bfd soon, you
can use "gdb -write" to patch an object file.
Note that it's not _very_ useful, because gdb can neither interpret nor
modify relocations. So branches and some initialized variables will
appear to go to the wrong place. But it's still handy from time to
time.
--
Daniel Jacobowitz
CodeSourcery, LLC