在c语言中输出调用栈
2020-12-13 05:26
标签:-- oid ack bsp ret ace nbsp clu 语言 #include void my_backtrace() { void *buffer[100] = {NULL}; char **trace = NULL; int i = 0; int size = 0; size = backtrace(buffer, 100); trace = backtrace_symbols(buffer, size); if (NULL == trace) { return; } for (i = 0; i
{ printf("%s\n", trace[i]); } free(trace); printf("----------done----------\n"); } 在c语言中输出调用栈 标签:-- oid ack bsp ret ace nbsp clu 语言 原文地址:https://www.cnblogs.com/duanqibo/p/11140613.html