This post has some notes about unwinding through a signal handler. You may want to readStack unwindingfirst.12345678910111213141516171819202122232425262728293031// a.c#define_GNU_SOURCE#include#include#include#include#includestaticvoidhandler(intsigno){unw_context_tcontext;unw_cursor_tcursor;unw_getcontext(&context;);unw_init_local(&cursor;, &context;);unw_word_tpc, sp;do{unw_get_reg(&cursor;, UNW_REG_IP, &pc;);unw_get_reg(&cursor;, UNW_REG_SP, &sp;);printf("pc=0x%016zx sp=0x%016zx", (size_t)pc, (size_t)sp);Dl_info info = {};if(dladdr((void*)pc, &info;))printf(" %s:%s", inf
...
继续阅读
(69)