2 These routines customise the error messages
3 for various bits of the RTS. They are linked
4 in instead of the defaults.
8 /* Included so as to bring the right prototypes into scope */
11 #define W_ unsigned long int
14 #if __GLASGOW_HASKELL__ >= 303
16 ErrorHdrHook (long fd)
23 ErrorHdrHook (FILE *where)
25 fprintf(where, "\n"); /* no "Fail: " */
30 OutOfHeapHook (W_ request_size, W_ heap_size) /* both in bytes */
32 fprintf(stderr, "GHC's heap exhausted;\nwhile trying to allocate %lu bytes in a %lu-byte heap;\nuse the `-H<size>' option to increase the total heap size.\n",
38 StackOverflowHook (I_ stack_size) /* in bytes */
40 fprintf(stderr, "GHC stack-space overflow: current size %ld bytes.\nUse the `-K<size>' option to increase it.\n", stack_size);
43 #if __GLASGOW_HASKELL__ >= 303
45 PatErrorHdrHook (long fd)
47 const char msg[]="\n*** Pattern-matching error within GHC!\n\nThis is a compiler bug; please report it to glasgow-haskell-bugs@dcs.gla.ac.uk.\n\nFail:";
48 write(fd,msg,sizeof(msg)-1);
52 PreTraceHook (long fd)
54 const char msg[]="\n";
55 write(fd,msg,sizeof(msg)-1);
59 PostTraceHook (long fd)
62 const char msg[]="\n";
63 write(fd,msg,sizeof(msg)-1);
69 PatErrorHdrHook (FILE *where)
71 fprintf(where, "\n*** Pattern-matching error within GHC!\n\nThis is a compiler bug; please report it to glasgow-haskell-bugs@dcs.gla.ac.uk.\n\nFail: ");
75 PreTraceHook (FILE *where)
77 fprintf(where, "\n"); /* not "Trace On" */
81 PostTraceHook (FILE *where)
83 fprintf(where, "\n"); /* not "Trace Off" */