Translate an address to symbolic information
#include <dlfcn.h> int dladdr( void *address, Dl_info *dlip );
- The address for which you want symbolic information.
- A pointer to a Dl_info structure where the function can
store the symbolic information.
Your application must allocate the space for this structure;
dladdr() fills in the members, based on the specified address.
The Dl_info structure includes the following members:
- const char * dli_fname — a pointer to the filename of the object containing address.
- void * dli_fbase — the base address of the object containing address.
- const char * dli_sname — a pointer to the symbol name nearest the specified address. This symbol is either at address, or is the nearest symbol with a lower address.
- void * dli_saddr — the actual address of the dli_sname symbol.
If dladdr() can't find a symbol that describes the specified address, the function sets dli_sname and dli_saddr to NULL.
Use the -l c option to qcc to link against this library. This library is usually included automatically.
The dladdr() function determines whether the specified address is located within one of the objects that make up the calling application's address space.
0 if the specified address can't be matched, or nonzero if it could be matched.
The Dl_info pointers may become invalid if objects are removed via dlclose() .
There's no way to determine which symbol you'll get if multiple symbols are mapped to the same address.