This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC 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: Access to symbol table from within a program



linguist-gcc@rich-paul.net wrote:
> 
> > I'm curious:  I have found the -finstrument-functions compiler
> > switch, and have used to it print out the addresses of functions
> > as they are called.  How could I use the symbol table from within
> > the program so that I could show the names of the functions as
> > they are called, something like: ...

John Levon wrote:
> You need to open the binary with bfd or whatever. Some very dumb code :
> 
> http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/functrace/functrace/src/

It's already been done; binutils has a program named addr2line.  If you
have a GNU/Linux system, it may already be installed in /usr/bin.


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