2 These routines customise the error messages
3 for various bits of the RTS. They are linked
4 in instead of the defaults.
7 #if __GLASGOW_HASKELL__ >= 400
13 #if __GLASGOW_HASKELL__ >= 303
16 ErrorHdrHook (long fd)
23 PatErrorHdrHook (long fd)
25 const char msg[]="\n*** Pattern-matching error within GHC!\n\nThis is a compiler bug; please report it to glasgow-haskell-bugs@haskell.org.\n\nFail:";
26 write(fd,msg,sizeof(msg)-1);
30 PreTraceHook (long fd)
32 const char msg[]="\n";
33 write(fd,msg,sizeof(msg)-1);
37 PostTraceHook (long fd)
40 const char msg[]="\n";
41 write(fd,msg,sizeof(msg)-1);
45 #else /* pre-3.03 GHC with old IO system */
48 ErrorHdrHook (FILE *where)
50 fprintf(where, "\n"); /* no "Fail: " */
54 PatErrorHdrHook (FILE *where)
56 fprintf(where, "\n*** Pattern-matching error within GHC!\n\nThis is a compiler bug; please report it to glasgow-haskell-bugs@haskell.org.\n\nFail: ");
60 PreTraceHook (FILE *where)
62 fprintf(where, "\n"); /* not "Trace On" */
66 PostTraceHook (FILE *where)
68 fprintf(where, "\n"); /* not "Trace Off" */
73 #if __GLASGOW_HASKELL__ >= 400
75 OutOfHeapHook (unsigned long request_size, unsigned long heap_size)
78 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",
84 StackOverflowHook (unsigned long stack_size) /* in bytes */
86 fprintf(stderr, "GHC stack-space overflow: current size %ld bytes.\nUse the `-K<size>' option to increase it.\n", stack_size);
89 #else /* GHC < 4.00 */
92 OutOfHeapHook (W_ request_size, W_ heap_size) /* both in bytes */
94 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",
100 StackOverflowHook (I_ stack_size) /* in bytes */
102 fprintf(stderr, "GHC stack-space overflow: current size %ld bytes.\nUse the `-K<size>' option to increase it.\n", stack_size);