Linux相当于Solaris walkcontext

时间:2017-02-13 14:25:36

标签: c++ linux solaris

Linux walkcontext的Linux等价物是什么? 参考:https://docs.oracle.com/cd/E19683-01/816-0213/6m6ne38fv/index.html 在Linux上,我收到错误:

error: walkcontext was not declared in this scope

当我使用时:walkcontext(&uc, walk_callback, &ctx);

1 个答案:

答案 0 :(得分:0)

没有直接Linux等效的Solaris walkcontext()。正如评论中所述,有一些编译器/平台特定的方法,如libunwind和_Unwind_Backtrace。

其中一些很好地包装在ISC的绑定backtrace.c源中(用于获取正在运行的进程的回溯):

https://source.isc.org/cgi-bin/gitweb.cgi?p=bind9.git;a=blob;f=lib/isc/backtrace.c;h=1f7cd570bd28dffebb20654a692f3ee5e8079f95;hb=HEAD

相关问题