b89a0f612e03a14dd85aa14da7ac665e19fa9ec5 tdreszer Fri Jul 30 17:13:43 2010 -0700 Hiram noticed this code broke cygwin build, so I ifdef'd it out. It is a rarely handy tool to peak at the stack in a cgi without aborting diff --git src/lib/errabort.c src/lib/errabort.c index 849902b..eb25734 100644 --- src/lib/errabort.c +++ src/lib/errabort.c @@ -62,12 +62,20 @@ dyStringAppend(dy, format); #define STACK_LIMIT 20 +char **strings = NULL; +int count = 0; + +// developer: this is an occasionally useful means of getting stack info without crashing +// however, it is not supported on cygwin. Conditionally compile this in when desired. +//#ifdef BACKTRACE_EXISTS +#ifdef BACKTRACE_EXISTS void *buffer[STACK_LIMIT]; -char **strings; -int count = backtrace(buffer, STACK_LIMIT); +count = backtrace(buffer, STACK_LIMIT); strings = backtrace_symbols(buffer, count); +#endif///def BACKTRACE_EXISTS + if (strings == NULL) - dyStringAppend(dy,"\nno backtrace_symbols."); + dyStringAppend(dy,"\nno backtrace_symbols available in errabort::warnWithBackTrace()."); else { dyStringAppend(dy,"\nBACKTRACE [can use 'addr2line -Cfise {exe} addr addr ...']:");