mirror of
https://github.com/paboyle/Grid.git
synced 2025-06-16 23:07:05 +01:00
Improving the logging, got fed up with color so optionally disable.
Backtrace macro used everwhere
This commit is contained in:
@ -294,6 +294,7 @@ void Grid_sa_signal_handler(int sig,siginfo_t *si,void * ptr)
|
||||
ucontext_t * uc= (ucontext_t *)ptr;
|
||||
struct sigcontext *sc = (struct sigcontext *)&uc->uc_mcontext;
|
||||
printf(" instruction %llx\n",(unsigned long long)sc->rip);
|
||||
|
||||
#define REG(A) printf(" %s %lx\n",#A,sc-> A);
|
||||
|
||||
REG(rdi);
|
||||
@ -316,13 +317,7 @@ void Grid_sa_signal_handler(int sig,siginfo_t *si,void * ptr)
|
||||
REG(r14);
|
||||
REG(r15);
|
||||
#endif
|
||||
#ifdef HAVE_EXECINFO_H
|
||||
int symbols = backtrace (Grid_backtrace_buffer,_NBACKTRACE);
|
||||
char **strings = backtrace_symbols(Grid_backtrace_buffer,symbols);
|
||||
for (int i = 0; i < symbols; i++){
|
||||
printf ("%s\n", strings[i]);
|
||||
}
|
||||
#endif
|
||||
BACKTRACE();
|
||||
exit(0);
|
||||
return;
|
||||
};
|
||||
|
Reference in New Issue
Block a user