#include<execinfo.h>
#include<stdio.h>
#include<stdlib.h>
#include<unistd.h>
#define SIZE 100
cout<<"yq File::writeAllv"<<endl;
int j, nptrs;
void *buffer[100];
char **strings;
nptrs = backtrace(buffer, SIZE);
cout<<"backtrace() returned %d addresses\n"<< nptrs<<endl;
/* The call backtrace_symbols_fd(buffer, nptrs, STDOUT_FILENO)
* would produce similar output to the following: */
strings = backtrace_symbols(buffer, nptrs);
if (strings == NULL) {
perror("backtrace_symbols");
exit(EXIT_FAILURE);
}
for (j = 0; j < nptrs; j++)
cout<<strings[j]<<endl;
free(strings);
回调函数
最新推荐文章于 2023-06-21 11:05:36 发布