我试图通过其地址在内存中获取符号名称由它的地址符号的更多信息。我使用dlfcn.h
int dladdr(void *addr, Dl_info *info)
函数来获取信息:我如何获得有关在内存
typedef struct { const char *dli_fname; /* Pathname of shared object that contains address */ void *dli_fbase; /* Address at which shared object is loaded */ const char *dli_sname; /* Name of nearest symbol with address lower than addr */ void *dli_saddr; /* Exact address of symbol named in dli_sname */ } Dl_info;
但是这个功能不能找到符号匹配的地址,并设置dli_sname和saddr为NULL。
我怎样才能得到符号的名称或任何其他信息(种类,属性等)约在这种情况下,符号?
注意:我试图找到的符号的名称是_ZTv0_n24_N4QGst13PropertyProbeD0Ev
。它在QGst::PropertyProbe
类的虚函数表由g++ -fdump-class-hierarchy
上市:
Vtable for QGst::PropertyProbe QGst::PropertyProbe::_ZTVN4QGst13PropertyProbeE: 14u entries ... 80 (int (*)(...))QGst::PropertyProbe::_ZTv0_n24_N4QGst13PropertyProbeD1Ev ...
但它不是由dladdr
通过其地址寻找到共享对象时dlopen
和符号_ZTVN4QGst13PropertyProbeE
的dlsym
并通过列表迭代,我已经得到发现的虚拟函数指针。 v表中的所有其他功能可通过dladdr
找到。
'objdump --syms libQtGStreamer-0.10.so.0' returns'SYMBOL TABLE:no symbols' – aponomarenko 2013-03-15 07:03:11