diff --git a/ghc/includes/options.h b/ghc/includes/options.h index 4033d0dd22ac048830eea794e0a639289bc8845e..5847fa645b7796a77bb0482a93e5aae93ca2e59e 100644 --- a/ghc/includes/options.h +++ b/ghc/includes/options.h @@ -13,8 +13,8 @@ * Hugs version 1.4, December 1997 * * $RCSfile: options.h,v $ - * $Revision: 1.5 $ - * $Date: 1999/04/27 10:07:22 $ + * $Revision: 1.6 $ + * $Date: 1999/04/27 12:27:56 $ * ------------------------------------------------------------------------*/ @@ -232,13 +232,14 @@ /* Turn on debugging output and some sanity checks */ -#define DEBUG 1 -/*#define NDEBUG */ +/*#define DEBUG 1*/ +#undef DEBUG /* Make stack tags more informative than just their size. * Helps when printing the stack and when running sanity checks. */ -#define DEBUG_EXTRA 1 +/*#define DEBUG_EXTRA 1*/ +#undef DEBUG_EXTRA /* Turn lazy blackholing on/off. * Warning: Lazy blackholing can't be disabled in GHC generated code. diff --git a/ghc/rts/Evaluator.c b/ghc/rts/Evaluator.c index 06a3613116884ac4b3ed474348b2fdf9dff61983..f7597a65915d51e0cdd18411c7ea2c8534258289 100644 --- a/ghc/rts/Evaluator.c +++ b/ghc/rts/Evaluator.c @@ -5,8 +5,8 @@ * Copyright (c) 1994-1998. * * $RCSfile: Evaluator.c,v $ - * $Revision: 1.12 $ - * $Date: 1999/04/27 10:07:16 $ + * $Revision: 1.13 $ + * $Date: 1999/04/27 12:27:50 $ * ---------------------------------------------------------------------------*/ #include "Rts.h" @@ -68,13 +68,14 @@ #define USE_GCC_LABELS 1 #else #define USE_GCC_LABELS 0 +#error yo dudes #endif /* -------------------------------------------------------------------------- * Crude profiling stuff (mainly to assess effect of optimiser) * ------------------------------------------------------------------------*/ -#if CRUDE_PROFILING +#ifdef CRUDE_PROFILING #define M_CPTAB 10000 #define CP_NIL (-1) @@ -329,7 +330,7 @@ void SloppifyIntegerEnd ( StgPtr ); /* Macros to save/load local state. */ -#if DEBUG +#ifdef DEBUG #define SSS { tSp=Sp = xSp; tSu=Su = xSu; tSpLim=SpLim = xSpLim; } #define LLL { tSp=xSp = Sp; tSu=xSu = Su; tSpLim=xSpLim = SpLim; } #else @@ -438,7 +439,7 @@ StgThreadReturnCode enter( StgClosure* obj0 ) register StgClosure* obj; /* object currently under evaluation */ char eCount; /* enter counter, for context switching */ -#if DEBUG +#ifdef DEBUG /* use the t values to check that Su/Sp/SpLim do not change unexpectedly */ StgPtr tSp = Sp; StgUpdateFrame* tSu = Su; StgPtr tSpLim = SpLim; #endif @@ -454,7 +455,7 @@ StgThreadReturnCode enter( StgClosure* obj0 ) enterLoop: -#if DEBUG +#ifdef DEBUG assert(Sp == tSp); assert(Su == tSu); assert(SpLim == tSpLim); @@ -1196,7 +1197,7 @@ StgThreadReturnCode enter( StgClosure* obj0 ) IF_DEBUG(evaluator, fprintf(stderr, "object to enter is a constructor -- " "jumping directly to return continuation\n" ); - ) + ); goto bco_entry; } @@ -1571,7 +1572,7 @@ static inline StgStablePtr taggedStackStable ( StgStackOffset i ) static inline StgPtr grabHpUpd( nat size ) { ASSERT( size >= MIN_UPD_SIZE + sizeofW(StgHeader) ); -#if CRUDE_PROFILING +#ifdef CRUDE_PROFILING cp_bill_words ( size ); #endif return allocate(size); @@ -1580,7 +1581,7 @@ static inline StgPtr grabHpUpd( nat size ) static inline StgPtr grabHpNonUpd( nat size ) { ASSERT( size >= MIN_NONUPD_SIZE + sizeofW(StgHeader) ); -#if CRUDE_PROFILING +#ifdef CRUDE_PROFILING cp_bill_words ( size ); #endif return allocate(size); diff --git a/ghc/rts/Printer.c b/ghc/rts/Printer.c index 7ebf1934ff3ae946d4207f93d2007da7d18e46d5..092dab3279995885ba700c53dbcb54a020fcd821 100644 --- a/ghc/rts/Printer.c +++ b/ghc/rts/Printer.c @@ -1,6 +1,6 @@ /* ----------------------------------------------------------------------------- - * $Id: Printer.c,v 1.10 1999/03/15 16:30:29 simonm Exp $ + * $Id: Printer.c,v 1.11 1999/04/27 12:27:49 sewardj Exp $ * * Copyright (c) 1994-1999. * @@ -52,7 +52,7 @@ char* lookupHugsItblName ( void* v ) } #endif -extern void printPtr( StgPtr p ) +void printPtr( StgPtr p ) { char* str; const char *raw; @@ -809,4 +809,14 @@ extern void DEBUG_LoadSymbols( char *name ) #endif /* HAVE_BFD_H */ +#else /* DEBUG */ +void printPtr( StgPtr p ) +{ + fprintf(stderr, "ptr 0x%p (enable -DDEBUG for more info) " , p ); +} + +void printObj( StgClosure *obj ) +{ + fprintf(stderr, "obj 0x%p (enable -DDEBUG for more info) " , obj ); +} #endif /* DEBUG */