This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils 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: using bfd, help please I am confused


Robert Schweikert <Robert.Schweikert@abaqus.com> writes:

> Thanks for the help. I do want to get the information from within the
> code, thus I do not want to call addr2line. I have this working if I
> have a monolithic executable, but how do I get this to work with shared
> libraries?
> 
> At this point I am assuming that I only know the name of the executable,
> since I don't know whether or not there is a way to figure out the
> library name from which the function that is currently on the stack came
> from.

Well, it's complicated, and I hesitate to even suggest this, but when
you use gdb it knows the names of the shared libraries that the
program uses.  It does this by using hooks provided by the dynamic
linker.  I can't remember the details, and I can't remember whether it
is possible to use those hooks from inside the program.

>From inside the program you might be able to paw through the dynamic
linker information, if you don't mind being specific to a particular
dynamic linker.

Ian


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