2 debug.cc -- implement debugging routines
4 source file of the GNU LilyPond music typesetter
6 (c) 1996,98 Han-Wen Nienhuys <hanwen@stack.nl>
15 #include "flower-debug.hh"
26 nulldev = new ofstream ("/dev/null");
27 monitor = new Dstream (&cout,".dstreamrc");
39 want to do a stacktrace .
50 cerr << _("Floating point exception .. \n")<< flush;
54 /// just to make sure print_rat is linked in
55 static void (*rat_printer)(Moment const&);
60 rat_printer = print_rat;
62 set_new_handler (&mynewhandler);
64 set_flower_debug (*monitor, check_debug);
66 signal (SIGFPE, float_handler);
69 bool check_debug=false;
72 bool check_malloc_b = false;
74 // #define MEMORY_PARANOID
76 #ifdef MEMORY_PARANOID
78 operator new (size_t size)
81 result = malloc (size);
83 memfrob (result, size);
89 operator delete (void *p)
94 memfrob (p, 8); // ugh. Need the blocksize. 8 is sysdependant
98 #endif // MEMORY_PARANOID
104 set_flower_debug (*monitor, check_debug);
105 check_malloc_b = experimental_features_global_b;