Bob*_*Bob 6 c c++ instrumentation gcc
如果我有
void func(int a, char * c)
{
// Something
}
Run Code Online (Sandbox Code Playgroud)
并希望使用标志 -finstrument-functions进行检测
生成函数进入和退出的仪器调用。在函数进入之后和函数退出之前,将使用当前函数的地址及其调用位置来调用以下分析函数。(在某些平台上,__builtin_return_address 无法在当前函数之外工作,因此调用站点信息可能无法用于分析函数。)
Run Code Online (Sandbox Code Playgroud)void __cyg_profile_func_enter (void *this_fn, void *call_site); void __cyg_profile_func_exit (void *this_fn, void *call_site);
是否可以获取函数开头和结尾的参数?
更新#1
我只需转储每个参数的二进制 blob,然后事后重建对象、整数等即可。