diff options
Diffstat (limited to 'src/debug.cc')
-rw-r--r-- | src/debug.cc | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/debug.cc b/src/debug.cc new file mode 100644 index 0000000000..d55c901945 --- /dev/null +++ b/src/debug.cc @@ -0,0 +1,27 @@ +#include <fstream.h> +#include <std/new.h> +#include "debug.hh" +#include "dstream.hh" +#include "vector.hh" + +Dstream monitor(&cout,".dstreamrc"); +ostream * nulldev = new ofstream("/dev/null"); + + +/* + want to do a stacktrace . + */ +void +mynewhandler() +{ + cerr << "Out of free store memory. Aborting.. "<< flush; + assert(false); +} + + +void +debug_init() +{ + set_new_handler(&mynewhandler); + set_matrix_debug(monitor); +} |