#include<execinfo.h>
#include<stdio.h>
#include<stdlib.h>
#include<unistd.h>
VOID PrintBacktrace(VOID)
{
#define BTSIZE 100
int j, nptrs;
void *buffer[100];
char **strings;
nptrs = backtrace(buffer, BTSIZE);
strings = backtrace_symbols(buffer, nptrs);
if (strings == NULL) {
return;
}
CCError("Start Print Backtrace");
for (j = 0; j < nptrs; j++)
CCError("%s",strings[j]);
CCError("End Print Backtrace");
free(strings);
}
makefile
-rdynamic