ELC in dev
ELC-lang
载入中...
搜索中...
未找到
elc::APIs::function_name 命名空间参考

函数

function_name_t get_function_name (void *ptr) noexcept
 

函数说明

◆ get_function_name()

function_name_t elc::APIs::function_name::get_function_name ( void ptr)
inlinenoexcept

在文件 all_defs.cpp19218 行定义.

19218 {
19219 #if SYSTEM_TYPE==windows
19220 //SymFromAddr (dbghelp.h)
19221 struct symbol_info_t:SYMBOL_INFO{
19222 char name_addtional_space[MAX_SYM_NAME];
19223 };
19224 symbol_info_t symbol;
19225 symbol.SizeOfStruct=sizeof(SYMBOL_INFO);
19226 symbol.MaxNameLen=MAX_SYM_NAME;
19227 DWORD64 displacement;
19228 if(SymFromAddr(GetCurrentProcess(),(DWORD64)ptr,&displacement,&symbol))
19229 return function_name_t(symbol.Name,symbol.NameLen);
19230 else
19231 return function_name_t("unknown",7);
19232 #elif SYSTEM_TYPE==linux
19233 //dladdr (dlfcn.h)
19234 Dl_info info;
19235 if(dladdr(ptr,&info))
19236 return function_name_t(info.dli_sname);
19237 else
19238 return function_name_t("unknown");
19239 #endif
19240 }
函数调用图:
这是这个函数的调用关系图: