Re: add-symbol-file question

Daniel Jacobowitz
2007-09-06T02:40:35Z

On Wed, Sep 05, 2007 at 07:30:23PM -0400, Mentat K. wrote:
> Hello,
> I am debugging a core that was generated from an app that was compiled
> with gcc 3.2 with -O2 (but without -g). All the shared object libs
> that it links with were similary compiled with -O2 without -g
>
> One of the shared object libs has a class and I know the address in
> the core file where an object of this class resides. I want to print
> out this object without doing the byte arithmetic myself.
>
> What would be the simplest way of doing this?

If all you need is that type, build the definition of the type with
-g into a new object file. Load it with add-symbol-file at an out of
the way address so that it does not overlap the code you care about.
Then you should be able to use the class name and type.

You have to be sure that debug info for the class is in the file you
compile; sometimes it isn't, with G++.

--
Daniel Jacobowitz
CodeSourcery