using bfd and shared libraries

Robert Schweikert Robert.Schweikert@abaqus.com
Mon Jun 23 17:59:00 GMT 2003


Hi,

I am trying to come up with some basic memory tracking tools and one
thing I'd like to do is to write out the function/method in which memory
was being allocated. So far what I have found is that I can use
__builtin_return_address(0) to get the address of function on the stack
that allocates the memory. Then using bfd I can figure out the
function/method symbol. My problem now is that this works for monolithic
executables but not for executables with shared libraries. 

Since gdb handles shared libraries just fine and also uses bfd I was
hoping someone could provide some ideas on how to go about this, or
point me to the code in the gdb source, or to some documentation where
this issue is addressed.

Thanks,
Robert

-- 
Robert Schweikert <Robert.Schweikert@abaqus.com>
ABAQUS



More information about the Gdb mailing list