[project @ 1999-04-27 12:27:49 by sewardj]
authorsewardj <unknown>
Tue, 27 Apr 1999 12:27:56 +0000 (12:27 +0000)
committersewardj <unknown>
Tue, 27 Apr 1999 12:27:56 +0000 (12:27 +0000)
Correctify usage of -DDEBUG and -DDEBUG_EXTRA.

ghc/includes/options.h
ghc/rts/Evaluator.c
ghc/rts/Printer.c

index 4033d0d..5847fa6 100644 (file)
@@ -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 $
  * ------------------------------------------------------------------------*/
 
 
 
 /* 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.
index 06a3613..f7597a6 100644 (file)
@@ -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"
 #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);
index 7ebf193..092dab3 100644 (file)
@@ -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 */