| 61 | #ifndef _WIN32 |
| 62 | |
| 63 | void fault_handler(int sig) { |
| 64 | void *array[30]; |
| 65 | size_t size; |
| 66 | |
| 67 | // get void*'s for all entries on the stack |
| 68 | size = backtrace(array, 30); |
| 69 | |
| 70 | // print out all the frames to stderr |
| 71 | fprintf(stderr, "Error: signal %d:\n", sig); |
| 72 | backtrace_symbols_fd(array, size, 2); |
| 73 | if (w!=NULL) { |
| 74 | fprintf(stderr, "Forcing save\n"); |
| 75 | w->saveState(); |
| 76 | } |
| 77 | exit(1); |
| 78 | } |
| 79 | |
| 80 | |
| 81 |
nothing calls this directly
no outgoing calls
no test coverage detected