Given the address of a function or a run-time variable, my code should find out the name and, if it is a variable, enter the symbol information. Or at least provide enough information for subsequent autonomous extraction of the name (and type of information).
This is Linux code, and it is assumed that debugging information is available.
I tried to peek into the ELF file format, binutils, and everything except the theme is huge, so I was hoping someone could help me narrow the scope.
I see the following types of solutions:
Find the range of code / data segments of modules loaded into memory - HOW TO DO? Save the address module and its name and offset in it. Off-line then use binutils to search for a symbol in the module debugging information - again, HOW TO DO?
use some API / system services that I don’t know about to find the symbol and information at runtime - HOW?
Thanks in advance.
source
share