I'm doing stack backtracing and lookup of return addresses per stack frame (using __builtin_frame_address and __builtin_return_address). I use dladdr() to get the name of the object a given entry point is in. I then use the bfd_xxxx routines (part of binutils) to locate the symbols within the object and match it against the return addresses to determine the flow of code. dladdr() will return the filename in the Dl_info structure. However, it is a non-absolute pathname.
-----Original Message----- There is no reliable way. This is true of Unix, and Linux. Tell me what you are trying to do and I will probably be able to tell you a better, and safer way to do it.
