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>
13 // #include <std/new.h>
17 #include "flower-debug.hh"
29 nulldev = new ofstream ("/dev/null");
30 monitor = new Dstream (&cout,".dstreamrc");
42 want to do a stacktrace .
53 cerr << _("Floating point exception .. \n")<< flush;
62 // libg++ 2.8.0 doesn't have set_new_handler
63 // set_new_handler (&mynewhandler);
65 set_flower_debug (*monitor, check_debug);
67 signal (SIGFPE, float_handler);
70 bool check_debug=false;
73 bool check_malloc_b = false;
75 // #define MEMORY_PARANOID
77 #ifdef MEMORY_PARANOID
82 operator new (size_t size)
85 result = malloc (size);
87 memfrob (result, size);
93 operator delete (void *p)
98 memfrob (p, 8); // ugh. Need the blocksize. 8 is sysdependant
102 #endif // MEMORY_PARANOID
108 set_flower_debug (*monitor, check_debug);
109 check_malloc_b = experimental_features_global_b;
110 #ifdef MEMORY_PARANOID
113 warning ("Can't set mem-checking!");