X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Frts%2FPrinter.c;h=ca9b00890cc5b654f3cbc3a7b478d9ab8a88ea1d;hb=57fadb77f1643b9096132a45adfde4cf3e7abdcf;hp=ef474f396bf955f77978610eb67fbd19971db311;hpb=0f3205e6c40575910d50bc2cc42020ccf55e07ba;p=ghc-hetmet.git diff --git a/ghc/rts/Printer.c b/ghc/rts/Printer.c index ef474f3..ca9b008 100644 --- a/ghc/rts/Printer.c +++ b/ghc/rts/Printer.c @@ -33,7 +33,6 @@ int fixed_hs = sizeof(StgHeader), itbl_sz = sizeofW(StgInfoTable), * local function decls * ------------------------------------------------------------------------*/ -static void printStdObject( StgClosure *obj, char* tag ); static void printStdObjPayload( StgClosure *obj ); #ifdef USING_LIBBFD static void reset_table ( int size ); @@ -114,13 +113,6 @@ printThunkPayload( StgThunk *obj ) } static void -printStdObject( StgClosure *obj, char* tag ) -{ - printStdObjHdr( obj, tag ); - printStdObjPayload( obj ); -} - -static void printThunkObject( StgThunk *obj, char* tag ) { printStdObjHdr( (StgClosure *)obj, tag ); @@ -146,9 +138,6 @@ printClosure( StgClosure *obj ) case CONSTR_STATIC: case CONSTR_NOCAF_STATIC: { - /* We can't use printStdObject because we want to print the - * tag as well. - */ StgWord i, j; #ifdef PROFILING debugBelch("%s(", info->prof.closure_desc); @@ -338,34 +327,18 @@ printClosure( StgClosure *obj ) putchar(arrWordsGetChar(obj,i)); } */ for (i=0; i<((StgArrWords *)obj)->words; i++) - debugBelch("%lu", ((StgArrWords *)obj)->payload[i]); + debugBelch("%lu", (lnat)((StgArrWords *)obj)->payload[i]); debugBelch("\")\n"); break; } case MUT_ARR_PTRS: - debugBelch("MUT_ARR_PTRS(size=%ld)\n", ((StgMutArrPtrs *)obj)->ptrs); + debugBelch("MUT_ARR_PTRS(size=%lu)\n", (lnat)((StgMutArrPtrs *)obj)->ptrs); break; case MUT_ARR_PTRS_FROZEN: -#if !defined(XMLAMBDA) - debugBelch("MUT_ARR_PTRS_FROZEN(size=%ld)\n", ((StgMutArrPtrs *)obj)->ptrs); + debugBelch("MUT_ARR_PTRS_FROZEN(size=%lu)\n", (lnat)((StgMutArrPtrs *)obj)->ptrs); break; -#else - { - /* rows are mutarrays in xmlambda, maybe we should make a new type: ROW */ - StgWord i; - StgMutArrPtrs* p = stgCast(StgMutArrPtrs*,obj); - - debugBelch("Row<%i>(",p->ptrs); - for (i = 0; i < p->ptrs; ++i) { - if (i > 0) debugBelch(", "); - printPtr((StgPtr)(p->payload[i])); - } - debugBelch(")\n"); - break; - } -#endif case MVAR: { @@ -391,14 +364,8 @@ printClosure( StgClosure *obj ) /* ToDo: chase 'link' ? */ break; - case FOREIGN: - debugBelch("FOREIGN("); - printPtr((StgPtr)( ((StgForeignObj*)obj)->data )); - debugBelch(")\n"); - break; - case STABLE_NAME: - debugBelch("STABLE_NAME(%ld)\n", ((StgStableName*)obj)->sn); + debugBelch("STABLE_NAME(%lu)\n", (lnat)((StgStableName*)obj)->sn); break; case TSO: @@ -515,12 +482,12 @@ printSmallBitmap( StgPtr spBottom, StgPtr payload, StgWord bitmap, nat size ) p = payload; for(i = 0; i < size; i++, bitmap >>= 1 ) { - debugBelch(" stk[%ld] (%p) = ", spBottom-(payload+i), payload+i); + debugBelch(" stk[%ld] (%p) = ", (long)(spBottom-(payload+i)), payload+i); if ((bitmap & 1) == 0) { printPtr((P_)payload[i]); debugBelch("\n"); } else { - debugBelch("Word# %ld\n", payload[i]); + debugBelch("Word# %lu\n", (lnat)payload[i]); } } } @@ -536,12 +503,12 @@ printLargeBitmap( StgPtr spBottom, StgPtr payload, StgLargeBitmap* large_bitmap, StgWord bitmap = large_bitmap->bitmap[bmp]; j = 0; for(; i < size && j < BITS_IN(W_); j++, i++, bitmap >>= 1 ) { - debugBelch(" stk[%ld] (%p) = ", spBottom-(payload+i), payload+i); + debugBelch(" stk[%lu] (%p) = ", (lnat)(spBottom-(payload+i)), payload+i); if ((bitmap & 1) == 0) { printPtr((P_)payload[i]); debugBelch("\n"); } else { - debugBelch("Word# %ld\n", payload[i]); + debugBelch("Word# %lu\n", (lnat)payload[i]); } } } @@ -1105,11 +1072,7 @@ findPtr(P_ p, int follow) for (g = 0; g < RtsFlags.GcFlags.generations; g++) { for (s = 0; s < generations[g].n_steps; s++) { - if (RtsFlags.GcFlags.generations == 1) { - bd = generations[g].steps[s].to_blocks; - } else { - bd = generations[g].steps[s].blocks; - } + bd = generations[g].steps[s].blocks; for (; bd; bd = bd->link) { for (q = bd->start; q < bd->free; q++) { if (*q == (W_)p) {