Commit 392f58c8 authored by sewardj's avatar sewardj
Browse files

[project @ 1999-04-27 12:27:49 by sewardj]

Correctify usage of -DDEBUG and -DDEBUG_EXTRA.
parent 99471691
......@@ -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.
......
......@@ -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);
......
/* -----------------------------------------------------------------------------
* $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 */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment