Commit 95ca6bff authored by simonmar's avatar simonmar
Browse files

[project @ 2004-09-03 15:28:18 by simonmar]

Cleanup: all (well, most) messages from the RTS now go through the
functions in RtsUtils: barf(), debugBelch() and errorBelch().  The
latter two were previously called belch() and prog_belch()
respectively.  See the comments for the right usage of these message
functions.

One reason for doing this is so that we can avoid spurious uses of
stdout/stderr by Haskell apps on platforms where we shouldn't be using
them (eg. non-console apps on Windows).
parent aa07427a
......@@ -501,7 +501,7 @@ freeHaskellFunctionPtr(void* ptr)
#if defined(i386_TARGET_ARCH)
if ( *(unsigned char*)ptr != 0x68 &&
*(unsigned char*)ptr != 0x58 ) {
prog_belch("freeHaskellFunctionPtr: not for me, guv! %p\n", ptr);
errorBelch("freeHaskellFunctionPtr: not for me, guv! %p\n", ptr);
return;
}
......@@ -513,7 +513,7 @@ freeHaskellFunctionPtr(void* ptr)
}
#elif defined(sparc_TARGET_ARCH)
if ( *(unsigned long*)ptr != 0x9C23A008UL ) {
prog_belch("freeHaskellFunctionPtr: not for me, guv! %p\n", ptr);
errorBelch("freeHaskellFunctionPtr: not for me, guv! %p\n", ptr);
return;
}
......@@ -521,7 +521,7 @@ freeHaskellFunctionPtr(void* ptr)
freeStablePtr(*((StgStablePtr*)((unsigned long*)ptr + 11)));
#elif defined(alpha_TARGET_ARCH)
if ( *(StgWord64*)ptr != 0xa77b0018a61b0010L ) {
prog_belch("freeHaskellFunctionPtr: not for me, guv! %p\n", ptr);
errorBelch("freeHaskellFunctionPtr: not for me, guv! %p\n", ptr);
return;
}
......@@ -529,7 +529,7 @@ freeHaskellFunctionPtr(void* ptr)
freeStablePtr(*((StgStablePtr*)((unsigned char*)ptr + 0x10)));
#elif defined(powerpc_TARGET_ARCH)
if ( *(StgWord*)ptr != 0x7d0a4378 ) {
prog_belch("freeHaskellFunctionPtr: not for me, guv! %p\n", ptr);
errorBelch("freeHaskellFunctionPtr: not for me, guv! %p\n", ptr);
return;
}
freeStablePtr(*((StgStablePtr*)((unsigned char*)ptr + 4*12)));
......@@ -538,7 +538,7 @@ freeHaskellFunctionPtr(void* ptr)
StgWord64 *code = (StgWord64 *)(fdesc+1);
if (fdesc->ip != (StgWord64)code) {
prog_belch("freeHaskellFunctionPtr: not for me, guv! %p\n", ptr);
errorBelch("freeHaskellFunctionPtr: not for me, guv! %p\n", ptr);
return;
}
freeStablePtr((StgStablePtr)code[16]);
......
/* -----------------------------------------------------------------------------
* $Id: BlockAlloc.c,v 1.17 2003/11/12 17:49:05 sof Exp $
* $Id: BlockAlloc.c,v 1.18 2004/09/03 15:28:19 simonmar Exp $
*
* (c) The GHC Team 1998-2000
*
......@@ -325,8 +325,8 @@ checkFreeListSanity(void)
for (bd = free_list; bd != NULL; bd = bd->link) {
IF_DEBUG(block_alloc,
fprintf(stderr,"group at 0x%x, length %d blocks\n",
(nat)bd->start, bd->blocks));
debugBelch("group at 0x%x, length %d blocks\n",
(nat)bd->start, bd->blocks));
ASSERT(bd->blocks > 0);
checkWellFormedGroup(bd);
if (bd->link != NULL) {
......
......@@ -4,8 +4,8 @@
* Copyright (c) 1994-2002.
*
* $RCSfile: Disassembler.c,v $
* $Revision: 1.28 $
* $Date: 2004/08/13 13:09:46 $
* $Revision: 1.29 $
* $Date: 2004/09/03 15:28:19 $
* ---------------------------------------------------------------------------*/
#ifdef DEBUG
......@@ -23,8 +23,6 @@
#include "Disassembler.h"
#include "Interpreter.h"
#include <stdio.h>
/* --------------------------------------------------------------------------
* Disassembler
* ------------------------------------------------------------------------*/
......@@ -47,188 +45,188 @@ disInstr ( StgBCO *bco, int pc )
switch (instrs[pc++]) {
case bci_SWIZZLE:
fprintf(stderr, "SWIZZLE stkoff %d by %d\n",
debugBelch("SWIZZLE stkoff %d by %d\n",
instrs[pc], (signed int)instrs[pc+1]);
pc += 2; break;
case bci_CCALL:
fprintf(stderr, "CCALL marshaller at 0x%x\n",
debugBelch("CCALL marshaller at 0x%x\n",
literals[instrs[pc]] );
pc += 1; break;
case bci_STKCHECK:
fprintf(stderr, "STKCHECK %d\n", instrs[pc] );
debugBelch("STKCHECK %d\n", instrs[pc] );
pc += 1; break;
case bci_PUSH_L:
fprintf(stderr, "PUSH_L %d\n", instrs[pc] );
debugBelch("PUSH_L %d\n", instrs[pc] );
pc += 1; break;
case bci_PUSH_LL:
fprintf(stderr, "PUSH_LL %d %d\n", instrs[pc], instrs[pc+1] );
debugBelch("PUSH_LL %d %d\n", instrs[pc], instrs[pc+1] );
pc += 2; break;
case bci_PUSH_LLL:
fprintf(stderr, "PUSH_LLL %d %d %d\n", instrs[pc], instrs[pc+1],
debugBelch("PUSH_LLL %d %d %d\n", instrs[pc], instrs[pc+1],
instrs[pc+2] );
pc += 3; break;
case bci_PUSH_G:
fprintf(stderr, "PUSH_G " ); printPtr( ptrs[instrs[pc]] );
fprintf(stderr, "\n" );
debugBelch("PUSH_G " ); printPtr( ptrs[instrs[pc]] );
debugBelch("\n" );
pc += 1; break;
case bci_PUSH_ALTS:
fprintf(stderr, "PUSH_ALTS " ); printPtr( ptrs[instrs[pc]] );
fprintf(stderr, "\n");
debugBelch("PUSH_ALTS " ); printPtr( ptrs[instrs[pc]] );
debugBelch("\n");
pc += 1; break;
case bci_PUSH_ALTS_P:
fprintf(stderr, "PUSH_ALTS_P " ); printPtr( ptrs[instrs[pc]] );
fprintf(stderr, "\n");
debugBelch("PUSH_ALTS_P " ); printPtr( ptrs[instrs[pc]] );
debugBelch("\n");
pc += 1; break;
case bci_PUSH_ALTS_N:
fprintf(stderr, "PUSH_ALTS_N " ); printPtr( ptrs[instrs[pc]] );
fprintf(stderr, "\n");
debugBelch("PUSH_ALTS_N " ); printPtr( ptrs[instrs[pc]] );
debugBelch("\n");
pc += 1; break;
case bci_PUSH_ALTS_F:
fprintf(stderr, "PUSH_ALTS_F " ); printPtr( ptrs[instrs[pc]] );
fprintf(stderr, "\n");
debugBelch("PUSH_ALTS_F " ); printPtr( ptrs[instrs[pc]] );
debugBelch("\n");
pc += 1; break;
case bci_PUSH_ALTS_D:
fprintf(stderr, "PUSH_ALTS_D " ); printPtr( ptrs[instrs[pc]] );
fprintf(stderr, "\n");
debugBelch("PUSH_ALTS_D " ); printPtr( ptrs[instrs[pc]] );
debugBelch("\n");
pc += 1; break;
case bci_PUSH_ALTS_L:
fprintf(stderr, "PUSH_ALTS_L " ); printPtr( ptrs[instrs[pc]] );
fprintf(stderr, "\n");
debugBelch("PUSH_ALTS_L " ); printPtr( ptrs[instrs[pc]] );
debugBelch("\n");
pc += 1; break;
case bci_PUSH_ALTS_V:
fprintf(stderr, "PUSH_ALTS_V " ); printPtr( ptrs[instrs[pc]] );
fprintf(stderr, "\n");
debugBelch("PUSH_ALTS_V " ); printPtr( ptrs[instrs[pc]] );
debugBelch("\n");
pc += 1; break;
case bci_PUSH_UBX:
fprintf(stderr, "PUSH_UBX ");
debugBelch("PUSH_UBX ");
for (i = 0; i < instrs[pc+1]; i++)
fprintf(stderr, "0x%x ", literals[i + instrs[pc]] );
fprintf(stderr, "\n");
debugBelch("0x%x ", literals[i + instrs[pc]] );
debugBelch("\n");
pc += 2; break;
case bci_PUSH_APPLY_N:
fprintf(stderr, "PUSH_APPLY_N\n");
debugBelch("PUSH_APPLY_N\n");
break;
case bci_PUSH_APPLY_V:
fprintf(stderr, "PUSH_APPLY_V\n");
debugBelch("PUSH_APPLY_V\n");
break;
case bci_PUSH_APPLY_F:
fprintf(stderr, "PUSH_APPLY_F\n");
debugBelch("PUSH_APPLY_F\n");
break;
case bci_PUSH_APPLY_D:
fprintf(stderr, "PUSH_APPLY_D\n");
debugBelch("PUSH_APPLY_D\n");
break;
case bci_PUSH_APPLY_L:
fprintf(stderr, "PUSH_APPLY_L\n");
debugBelch("PUSH_APPLY_L\n");
break;
case bci_PUSH_APPLY_P:
fprintf(stderr, "PUSH_APPLY_P\n");
debugBelch("PUSH_APPLY_P\n");
break;
case bci_PUSH_APPLY_PP:
fprintf(stderr, "PUSH_APPLY_PP\n");
debugBelch("PUSH_APPLY_PP\n");
break;
case bci_PUSH_APPLY_PPP:
fprintf(stderr, "PUSH_APPLY_PPP\n");
debugBelch("PUSH_APPLY_PPP\n");
break;
case bci_PUSH_APPLY_PPPP:
fprintf(stderr, "PUSH_APPLY_PPPP\n");
debugBelch("PUSH_APPLY_PPPP\n");
break;
case bci_PUSH_APPLY_PPPPP:
fprintf(stderr, "PUSH_APPLY_PPPPP\n");
debugBelch("PUSH_APPLY_PPPPP\n");
break;
case bci_PUSH_APPLY_PPPPPP:
fprintf(stderr, "PUSH_APPLY_PPPPPP\n");
debugBelch("PUSH_APPLY_PPPPPP\n");
break;
case bci_SLIDE:
fprintf(stderr, "SLIDE %d down by %d\n", instrs[pc], instrs[pc+1] );
debugBelch("SLIDE %d down by %d\n", instrs[pc], instrs[pc+1] );
pc += 2; break;
case bci_ALLOC_AP:
fprintf(stderr, "ALLOC_AP %d words\n", instrs[pc] );
debugBelch("ALLOC_AP %d words\n", instrs[pc] );
pc += 1; break;
case bci_ALLOC_PAP:
fprintf(stderr, "ALLOC_PAP %d words, %d arity\n",
debugBelch("ALLOC_PAP %d words, %d arity\n",
instrs[pc], instrs[pc+1] );
pc += 2; break;
case bci_MKAP:
fprintf(stderr, "MKAP %d words, %d stkoff\n", instrs[pc+1],
debugBelch("MKAP %d words, %d stkoff\n", instrs[pc+1],
instrs[pc] );
pc += 2; break;
case bci_UNPACK:
fprintf(stderr, "UNPACK %d\n", instrs[pc] );
debugBelch("UNPACK %d\n", instrs[pc] );
pc += 1; break;
case bci_PACK:
fprintf(stderr, "PACK %d words with itbl ", instrs[pc+1] );
debugBelch("PACK %d words with itbl ", instrs[pc+1] );
printPtr( (StgPtr)itbls[instrs[pc]] );
fprintf(stderr, "\n");
debugBelch("\n");
pc += 2; break;
case bci_TESTLT_I:
fprintf(stderr, "TESTLT_I %d, fail to %d\n", literals[instrs[pc]],
debugBelch("TESTLT_I %d, fail to %d\n", literals[instrs[pc]],
instrs[pc+1]);
pc += 2; break;
case bci_TESTEQ_I:
fprintf(stderr, "TESTEQ_I %d, fail to %d\n", literals[instrs[pc]],
debugBelch("TESTEQ_I %d, fail to %d\n", literals[instrs[pc]],
instrs[pc+1]);
pc += 2; break;
case bci_TESTLT_F:
fprintf(stderr, "TESTLT_F %d, fail to %d\n", literals[instrs[pc]],
debugBelch("TESTLT_F %d, fail to %d\n", literals[instrs[pc]],
instrs[pc+1]);
pc += 2; break;
case bci_TESTEQ_F:
fprintf(stderr, "TESTEQ_F %d, fail to %d\n", literals[instrs[pc]],
debugBelch("TESTEQ_F %d, fail to %d\n", literals[instrs[pc]],
instrs[pc+1]);
pc += 2; break;
case bci_TESTLT_D:
fprintf(stderr, "TESTLT_D %d, fail to %d\n", literals[instrs[pc]],
debugBelch("TESTLT_D %d, fail to %d\n", literals[instrs[pc]],
instrs[pc+1]);
pc += 2; break;
case bci_TESTEQ_D:
fprintf(stderr, "TESTEQ_D %d, fail to %d\n", literals[instrs[pc]],
debugBelch("TESTEQ_D %d, fail to %d\n", literals[instrs[pc]],
instrs[pc+1]);
pc += 2; break;
case bci_TESTLT_P:
fprintf(stderr, "TESTLT_P %d, fail to %d\n", instrs[pc],
debugBelch("TESTLT_P %d, fail to %d\n", instrs[pc],
instrs[pc+1]);
pc += 2; break;
case bci_TESTEQ_P:
fprintf(stderr, "TESTEQ_P %d, fail to %d\n", instrs[pc],
debugBelch("TESTEQ_P %d, fail to %d\n", instrs[pc],
instrs[pc+1]);
pc += 2; break;
case bci_CASEFAIL:
fprintf(stderr, "CASEFAIL\n" );
debugBelch("CASEFAIL\n" );
break;
case bci_JMP:
fprintf(stderr, "JMP to %d\n", instrs[pc]);
debugBelch("JMP to %d\n", instrs[pc]);
pc += 1; break;
case bci_ENTER:
fprintf(stderr, "ENTER\n");
debugBelch("ENTER\n");
break;
case bci_RETURN:
fprintf(stderr, "RETURN\n" );
debugBelch("RETURN\n" );
break;
case bci_RETURN_P:
fprintf(stderr, "RETURN_P\n" );
debugBelch("RETURN_P\n" );
break;
case bci_RETURN_N:
fprintf(stderr, "RETURN_N\n" );
debugBelch("RETURN_N\n" );
break;
case bci_RETURN_F:
fprintf(stderr, "RETURN_F\n" );
debugBelch("RETURN_F\n" );
break;
case bci_RETURN_D:
fprintf(stderr, "RETURN_D\n" );
debugBelch("RETURN_D\n" );
break;
case bci_RETURN_L:
fprintf(stderr, "RETURN_L\n" );
debugBelch("RETURN_L\n" );
break;
case bci_RETURN_V:
fprintf(stderr, "RETURN_V\n" );
debugBelch("RETURN_V\n" );
break;
default:
......@@ -251,32 +249,32 @@ void disassemble( StgBCO *bco )
nat nbcs = (int)instrs[0];
nat pc = 1;
fprintf(stderr, "BCO\n" );
debugBelch("BCO\n" );
pc = 1;
while (pc <= nbcs) {
fprintf(stderr, "\t%2d: ", pc );
debugBelch("\t%2d: ", pc );
pc = disInstr ( bco, pc );
}
fprintf(stderr, "INSTRS:\n " );
debugBelch("INSTRS:\n " );
j = 16;
for (i = 0; i < nbcs; i++) {
fprintf(stderr, "%3d ", (int)instrs[i] );
debugBelch("%3d ", (int)instrs[i] );
j--;
if (j == 0) { j = 16; fprintf(stderr, "\n "); };
if (j == 0) { j = 16; debugBelch("\n "); };
}
fprintf(stderr, "\n");
debugBelch("\n");
fprintf(stderr, "PTRS:\n " );
debugBelch("PTRS:\n " );
j = 8;
for (i = 0; i < ptrs->ptrs; i++) {
fprintf(stderr, "%8p ", ptrs->payload[i] );
debugBelch("%8p ", ptrs->payload[i] );
j--;
if (j == 0) { j = 8; fprintf(stderr, "\n "); };
if (j == 0) { j = 8; debugBelch("\n "); };
}
fprintf(stderr, "\n");
debugBelch("\n");
fprintf(stderr, "\n");
debugBelch("\n");
ASSERT(pc == nbcs+1);
}
......
/* -----------------------------------------------------------------------------
* $Id: FrontPanel.c,v 1.9 2004/08/13 13:09:49 simonmar Exp $
* $Id: FrontPanel.c,v 1.10 2004/09/03 15:28:20 simonmar Exp $
*
* (c) The GHC Team 2000
*
......@@ -102,7 +102,7 @@ configure_event( GtkWidget *widget, GdkEventConfigure *event STG_UNUSED,
widget->allocation.width,
widget->allocation.height);
fprintf(stderr, "configure!\n");
debugBelch("configure!\n");
updateFrontPanel();
return TRUE;
}
......
/* -----------------------------------------------------------------------------
* $Id: GC.c,v 1.168 2004/08/13 13:09:49 simonmar Exp $
* $Id: GC.c,v 1.169 2004/09/03 15:28:20 simonmar Exp $
*
* (c) The GHC Team 1998-2003
*
......@@ -307,7 +307,7 @@ GarbageCollect ( void (*get_roots)(evac_fn), rtsBool force_major_gc )
#endif
#if defined(DEBUG) && defined(GRAN)
IF_DEBUG(gc, belch("@@ Starting garbage collection at %ld (%lx)\n",
IF_DEBUG(gc, debugBelch("@@ Starting garbage collection at %ld (%lx)\n",
Now, Now));
#endif
......@@ -440,7 +440,7 @@ GarbageCollect ( void (*get_roots)(evac_fn), rtsBool force_major_gc )
stp->bitmap = bitmap_bdescr;
bitmap = bitmap_bdescr->start;
IF_DEBUG(gc, belch("bitmap_size: %d, bitmap: %p",
IF_DEBUG(gc, debugBelch("bitmap_size: %d, bitmap: %p",
bitmap_size, bitmap););
// don't forget to fill it with zeros!
......@@ -851,10 +851,10 @@ GarbageCollect ( void (*get_roots)(evac_fn), rtsBool force_major_gc )
oldest_gen->steps[0].n_blocks >
(RtsFlags.GcFlags.compactThreshold * max) / 100))) {
oldest_gen->steps[0].is_compacted = 1;
// fprintf(stderr,"compaction: on\n", live);
// debugBelch("compaction: on\n", live);
} else {
oldest_gen->steps[0].is_compacted = 0;
// fprintf(stderr,"compaction: off\n", live);
// debugBelch("compaction: off\n", live);
}
// if we're going to go over the maximum heap size, reduce the
......@@ -886,7 +886,7 @@ GarbageCollect ( void (*get_roots)(evac_fn), rtsBool force_major_gc )
}
#if 0
fprintf(stderr,"live: %d, min_alloc: %d, size : %d, max = %d\n", live,
debugBelch("live: %d, min_alloc: %d, size : %d, max = %d\n", live,
min_alloc, size, max);
#endif
......@@ -968,7 +968,7 @@ GarbageCollect ( void (*get_roots)(evac_fn), rtsBool force_major_gc )
int pc_free;
adjusted_blocks = (RtsFlags.GcFlags.maxHeapSize - 2 * blocks);
IF_DEBUG(gc, belch("@@ Near maximum heap size of 0x%x blocks, blocks = %d, adjusted to %ld", RtsFlags.GcFlags.maxHeapSize, blocks, adjusted_blocks));
IF_DEBUG(gc, debugBelch("@@ Near maximum heap size of 0x%x blocks, blocks = %d, adjusted to %ld", RtsFlags.GcFlags.maxHeapSize, blocks, adjusted_blocks));
pc_free = adjusted_blocks * 100 / RtsFlags.GcFlags.maxHeapSize;
if (pc_free < RtsFlags.GcFlags.pcFreeHeap) /* might even be < 0 */ {
heapOverflow();
......@@ -1196,7 +1196,7 @@ traverse_weak_ptr_list(void)
w->link = weak_ptr_list;
weak_ptr_list = w;
flag = rtsTrue;
IF_DEBUG(weak, belch("Weak pointer still alive at %p -> %p",
IF_DEBUG(weak, debugBelch("Weak pointer still alive at %p -> %p",
w, w->key));
continue;
}
......@@ -1958,7 +1958,7 @@ loop:
//ToDo: derive size etc from reverted IP
//to = copy(q,size,stp);
IF_DEBUG(gc,
belch("@@ evacuate: RBH %p (%s) to %p (%s)",
debugBelch("@@ evacuate: RBH %p (%s) to %p (%s)",
q, info_type(q), to, info_type(to)));
return to;
}
......@@ -1967,7 +1967,7 @@ loop:
ASSERT(sizeofW(StgBlockedFetch) >= MIN_NONUPD_SIZE);
to = copy(q,sizeofW(StgBlockedFetch),stp);
IF_DEBUG(gc,
belch("@@ evacuate: %p (%s) to %p (%s)",
debugBelch("@@ evacuate: %p (%s) to %p (%s)",
q, info_type(q), to, info_type(to)));
return to;
......@@ -1978,7 +1978,7 @@ loop:
ASSERT(sizeofW(StgBlockedFetch) >= MIN_UPD_SIZE);
to = copy(q,sizeofW(StgFetchMe),stp);
IF_DEBUG(gc,
belch("@@ evacuate: %p (%s) to %p (%s)",
debugBelch("@@ evacuate: %p (%s) to %p (%s)",
q, info_type(q), to, info_type(to)));
return to;
......@@ -1986,7 +1986,7 @@ loop:
ASSERT(sizeofW(StgBlockedFetch) >= MIN_UPD_SIZE);
to = copy(q,sizeofW(StgFetchMeBlockingQueue),stp);
IF_DEBUG(gc,
belch("@@ evacuate: %p (%s) to %p (%s)",
debugBelch("@@ evacuate: %p (%s) to %p (%s)",
q, info_type(q), to, info_type(to)));
return to;
#endif
......@@ -2750,7 +2750,7 @@ scavenge(step *stp)
recordMutable((StgMutClosure *)to);
failed_to_evac = rtsFalse; // mutable anyhow.
IF_DEBUG(gc,
belch("@@ scavenge: RBH %p (%s) (new blocking_queue link=%p)",
debugBelch("@@ scavenge: RBH %p (%s) (new blocking_queue link=%p)",
p, info_type(p), (StgClosure *)rbh->blocking_queue));
// ToDo: use size of reverted closure here!
p += BLACKHOLE_sizeW();
......@@ -2771,7 +2771,7 @@ scavenge(step *stp)
recordMutable((StgMutClosure *)bf);
}
IF_DEBUG(gc,
belch("@@ scavenge: %p (%s); node is now %p; exciting, isn't it",
debugBelch("@@ scavenge: %p (%s); node is now %p; exciting, isn't it",
bf, info_type((StgClosure *)bf),
bf->node, info_type(bf->node)));
p += sizeofW(StgBlockedFetch);
......@@ -2795,7 +2795,7 @@ scavenge(step *stp)
recordMutable((StgMutClosure *)fmbq);
}
IF_DEBUG(gc,
belch("@@ scavenge: %p (%s) exciting, isn't it",
debugBelch("@@ scavenge: %p (%s) exciting, isn't it",
p, info_type((StgClosure *)p)));
p += sizeofW(StgFetchMeBlockingQueue);
break;
......@@ -3059,7 +3059,7 @@ linear_scan:
recordMutable((StgMutClosure *)rbh);
failed_to_evac = rtsFalse; // mutable anyhow.
IF_DEBUG(gc,
belch("@@ scavenge: RBH %p (%s) (new blocking_queue link=%p)",
debugBelch("@@ scavenge: RBH %p (%s) (new blocking_queue link=%p)",
p, info_type(p), (StgClosure *)rbh->blocking_queue));
break;
}
......@@ -3078,7 +3078,7 @@ linear_scan:
recordMutable((StgMutClosure *)bf);
}
IF_DEBUG(gc,
belch("@@ scavenge: %p (%s); node is now %p; exciting, isn't it",
debugBelch("@@ scavenge: %p (%s); node is now %p; exciting, isn't it",
bf, info_type((StgClosure *)bf),
bf->node, info_type(bf->node)));
break;
......@@ -3100,7 +3100,7 @@ linear_scan:
recordMutable((StgMutClosure *)fmbq);
}
IF_DEBUG(gc,
belch("@@ scavenge: %p (%s) exciting, isn't it",
debugBelch("@@ scavenge: %p (%s) exciting, isn't it",
p, info_type((StgClosure *)p)));
break;
}
......@@ -3123,7 +3123,7 @@ linear_scan:
// start a new linear scan if the mark stack overflowed at some point
if (mark_stack_overflowed && oldgen_scan_bd == NULL) {
IF_DEBUG(gc, belch("scavenge_mark_stack: starting linear scan"));
IF_DEBUG(gc, debugBelch("scavenge_mark_stack: starting linear scan"));
mark_stack_overflowed = rtsFalse;
oldgen_scan_bd = oldest_gen->steps[0].blocks;
oldgen_scan = oldgen_scan_bd->start;
......@@ -3367,7 +3367,7 @@ scavenge_mut_once_list(generation *gen)
} else {
size = gen->steps[0].scan - start;
}
belch("evac IND_OLDGEN: %ld bytes", size * sizeof(W_));
debugBelch("evac IND_OLDGEN: %ld bytes", size * sizeof(W_));
}
#endif
......@@ -3743,7 +3743,7 @@ scavenge_stack(StgPtr p, StgPtr stack_end)
StgWord bitmap;
nat size;
//IF_DEBUG(sanity, belch(" scavenging stack between %p and %p", p, stack_end));
//IF_DEBUG(sanity, debugBelch(" scavenging stack between %p and %p", p, stack_end));
/*
* Each time around this loop, we are looking at a chunk of stack
......@@ -3987,7 +3987,7 @@ gcCAFs(void)
ASSERT(info->type == IND_STATIC);
if (STATIC_LINK(info,p) == NULL) {
IF_DEBUG(gccafs, belch("CAF gc'd at 0x%04lx", (long)p));
IF_DEBUG(gccafs, debugBelch("CAF gc'd at 0x%04lx", (long)p));
// black hole it
SET_INFO(p,&stg_BLACKHOLE_info);
p = STATIC_LINK2(info,p);
......@@ -4001,7 +4001,7 @@ gcCAFs(void)
}
// belch("%d CAFs live", i);
// debugBelch("%d CAFs live", i);
}
#endif
......@@ -4048,7 +4048,7 @@ threadLazyBlackHole(StgTSO *tso)
if (bh->header.info != &stg_BLACKHOLE_BQ_info &&
bh->header.info != &stg_CAF_BLACKHOLE_info) {
#if (!defined(LAZY_BLACKHOLING)) && defined(DEBUG)
belch("Unexpected lazy BHing required at 0x%04x",(int)bh);
debugBelch("Unexpected lazy BHing required at 0x%04x",(int)bh);
#endif
#ifdef PROFILING
// @LDV profiling
......@@ -4175,7 +4175,7 @@ threadSqueezeStack(StgTSO *tso)
bh->header.info != &stg_BLACKHOLE_BQ_info &&
bh->header.info != &stg_CAF_BLACKHOLE_info) {
#if (!defined(LAZY_BLACKHOLING)) && defined(DEBUG)
belch("Unexpected lazy BHing required at 0x%04x",(int)bh);
debugBelch("Unexpected lazy BHing required at 0x%04x",(int)bh);
#endif
#ifdef DEBUG
/* zero out the slop so that the sanity checker can tell
......@@ -4310,12 +4310,12 @@ printMutOnceList(generation *gen)
p = gen->mut_once_list;
next = p->mut_link;
fprintf(stderr, "@@ Mut once list %p: ", gen->mut_once_list);
debugBelch("@@ Mut once list %p: ", gen->mut_once_list);
for (; p != END_MUT_LIST; p = next, next = p->mut_link) {
fprintf(stderr, "%p (%s), ",