Translate Instruction Pointer Address (in shared library) to Source Instruction

JacksGT Source

Are there any tools or libraries one can use on Linux to get the original (source) instruction only from the PID and the current instruction pointer address, even if the IP currently points into a shared library?

AFAIK it should be possible, since the location of the library mapping is available through /proc/[PID]/maps, though I haven't found any applications or examples doing so.

Any suggestions?

EDIT: an assembly instruction or the nearest symbol suffice (source code line is not necessarily needed)



comments powered by Disqus