问题描述
我发现llvm-project中有拦截器。 https://github.com/llvm/llvm-project/blob/1a2eaebc09c6a200f93b8beb37130c8b8aab3934/compiler-rt/lib/interception/interception.h
在文档中他们说 我们可以通过定义 INTERCEPTOR(return type,function name,args ...){} 来拦截函数 并调用 INTERCEPT_FUNCTION(函数名)。
所以我定义了 INTERCEPTOR(void,free,void* p){ //print message} 并在compiler-rt文件中执行了INTERCEPT_FUNCION(free)。
但是我遇到了以下错误。
undefined reference to `__interception::InterceptFunction(char const*,unsigned long*,unsigned long,unsigned long)'
我认为它需要更多信息或实施。
谢谢。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)