mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-01-18 18:56:25 +00:00
added backtrace function, which sadly doesn't work on android.
This commit is contained in:
parent
844a480ae7
commit
1171e60704
19
main.c
19
main.c
@ -63,3 +63,22 @@ int form_serval_instance_path(char *buf, size_t bufsiz, const char *path)
|
|||||||
int create_serval_instance_dir() {
|
int create_serval_instance_dir() {
|
||||||
return mkdirs(serval_instancepath(), 0700);
|
return mkdirs(serval_instancepath(), 0700);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef 0
|
||||||
|
#include <execinfo.h>
|
||||||
|
#define MAX_DEPTH 64
|
||||||
|
int printBackTrace()
|
||||||
|
{
|
||||||
|
int i,depth=0;
|
||||||
|
void *functions[MAX_DEPTH];
|
||||||
|
char **function_names;
|
||||||
|
|
||||||
|
depth = backtrace (functions, MAX_DEPTH);
|
||||||
|
function_names = backtrace_symbols (functions, depth);
|
||||||
|
|
||||||
|
for(i=0;i<depth;i++)
|
||||||
|
fprintf(stderr,"%s\n", function_names[i]);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user