Don't show the uc_backtrace_fd function when generating a backtrace.
This commit is contained in:
+10
-1
@@ -1,14 +1,23 @@
|
|||||||
#include <execinfo.h>
|
#include <execinfo.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
#define MAX_BACKTRACE_SYMBOLS 96
|
#define MAX_BACKTRACE_SYMBOLS 96
|
||||||
|
|
||||||
void uc_backtrace_fd(int fd)
|
void uc_backtrace_fd(int fd)
|
||||||
{
|
{
|
||||||
void *buffer[MAX_BACKTRACE_SYMBOLS];
|
void *buffer[MAX_BACKTRACE_SYMBOLS];
|
||||||
|
void **syms;
|
||||||
int ptrs;
|
int ptrs;
|
||||||
|
|
||||||
ptrs = backtrace(buffer, MAX_BACKTRACE_SYMBOLS);
|
ptrs = backtrace(buffer, MAX_BACKTRACE_SYMBOLS);
|
||||||
backtrace_symbols_fd(buffer, ptrs, fd);
|
if(ptrs > 0) { //dont print out this function
|
||||||
|
ptrs--;
|
||||||
|
syms = &buffer[1];
|
||||||
|
} else {
|
||||||
|
syms = &buffer[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
backtrace_symbols_fd(syms, ptrs, fd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user