Hi Mathieu,
This is a great advice! However, when adding blargh() function from the gridflow.c inside the sys_vgui (s_inter.c) so that when the debug is on it outptus a trace for each call, it appears it only manages to do one level which is obviously the sys_vgui call itself. Why is it not able to trace further back?
void blargh(void) { #ifdef MACOSX fprintf(stderr,"unhandled exception\n"); #else int i; void *array[25]; int nSize = backtrace(array, 25); char **symbols = backtrace_symbols(array, nSize); for (i=0; i<nSize; i++) fprintf(stderr,"%d: %s\n",i,symbols[i]); free(symbols); #endif }
void sys_vgui(char *fmt, ...) {
<snip>
if (sys_debuglevel & DEBUG_MESSUP) { blargh(); fprintf(stderr, "%s", sys_guibuf + sys_guibufhead); }
<snip>
}