This is the mail archive of the gdb@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]

using bfd and shared libraries


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


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