2005-01-27 02:14:22 -08:00
|
|
|
/*
|
|
|
|
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
|
2005-03-18 09:02:47 -08:00
|
|
|
* NOTE TO FreeBSD users. Install libexecinfo from
|
|
|
|
* ports/devel/libexecinfo and add -lexecinfo to LDFLAGS
|
|
|
|
* to add backtrace support.
|
2005-01-27 02:14:22 -08:00
|
|
|
*/
|
|
|
|
#include "e.h"
|
2005-02-07 05:51:09 -08:00
|
|
|
#include <execinfo.h>
|
2005-01-27 02:14:22 -08:00
|
|
|
|
|
|
|
/* a tricky little devil, requires e and it's libs to be built
|
|
|
|
* with the -rdynamic flag to GCC for any sort of decent output.
|
|
|
|
*/
|
|
|
|
void e_sigseg_act(int x, siginfo_t *info, void *data){
|
|
|
|
|
|
|
|
void *array[255];
|
|
|
|
size_t size;
|
|
|
|
write(2, "**** SEGMENTATION FAULT ****\n", 29);
|
|
|
|
write(2, "**** Printing Backtrace... *****\n\n", 34);
|
2005-02-07 05:51:09 -08:00
|
|
|
size = backtrace(array, 255);
|
2005-01-27 02:14:22 -08:00
|
|
|
backtrace_symbols_fd(array, size, 2);
|
|
|
|
exit(-11);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|