This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFC: Improve support for "debugging" unlinked objects


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]