Commit 49072b75 authored by sewardj's avatar sewardj
Browse files

[project @ 1999-11-22 16:44:30 by sewardj]

Nuke DEBUG_EXTRA once and for all, and make Hugs use the same stack
tags as GHC.
parent 4d2936c0
/* -----------------------------------------------------------------------------
* $Id: StgMacros.h,v 1.18 1999/11/09 15:57:40 simonmar Exp $
* $Id: StgMacros.h,v 1.19 1999/11/22 16:44:30 sewardj Exp $
*
* (c) The GHC Team, 1998-1999
*
......@@ -70,58 +70,22 @@
words in the block.
-------------------------------------------------------------------------- */
#ifndef DEBUG_EXTRA
#define ARGTAG_MAX 16 /* probably arbitrary */
#define ARG_TAG(n) (n)
#define ARG_SIZE(n) stgCast(StgWord,n)
#define ARG_SIZE(n) (StgWord)n
typedef enum {
REALWORLD_TAG = 0,
INT_TAG = sizeofW(StgInt),
INT64_TAG = sizeofW(StgInt64),
WORD_TAG = sizeofW(StgWord),
ADDR_TAG = sizeofW(StgAddr),
CHAR_TAG = sizeofW(StgChar),
FLOAT_TAG = sizeofW(StgFloat),
DOUBLE_TAG = sizeofW(StgDouble),
STABLE_TAG = sizeofW(StgWord),
INT_TAG = sizeofW(StgInt),
INT64_TAG = sizeofW(StgInt64),
WORD_TAG = sizeofW(StgWord),
ADDR_TAG = sizeofW(StgAddr),
CHAR_TAG = sizeofW(StgChar),
FLOAT_TAG = sizeofW(StgFloat),
DOUBLE_TAG = sizeofW(StgDouble),
STABLE_TAG = sizeofW(StgWord),
} StackTag;
#else /* DEBUG_EXTRA */
typedef enum {
ILLEGAL_TAG,
REALWORLD_TAG,
INT_TAG ,
INT64_TAG ,
WORD_TAG ,
ADDR_TAG ,
CHAR_TAG ,
FLOAT_TAG ,
DOUBLE_TAG ,
STABLE_TAG ,
ARGTAG_MAX = DOUBLE_TAG
} StackTag;
/* putting this in a .h file generates many copies - but its only a
* debugging build.
*/
static StgWord stg_arg_size[] = {
[REALWORLD_TAG] = 0,
[INT_TAG ] = sizeofW(StgInt),
[INT64_TAG ] = sizeofW(StgInt64),
[WORD_TAG ] = sizeofW(StgWord),
[ADDR_TAG ] = sizeofW(StgAddr),
[CHAR_TAG ] = sizeofW(StgChar),
[FLOAT_TAG ] = sizeofW(StgFloat),
[DOUBLE_TAG] = sizeofW(StgDouble),
[STABLE_TAG] = sizeofW(StgWord)
};
#define ARG_SIZE(tag) stg_arg_size[stgCast(StgWord,tag)]
#endif /* DEBUG_EXTRA */
static inline int IS_ARG_TAG( StgWord p );
static inline int IS_ARG_TAG( StgWord p ) { return p <= ARGTAG_MAX; }
......
......@@ -13,8 +13,8 @@
* Hugs version 1.4, December 1997
*
* $RCSfile: options.h,v $
* $Revision: 1.12 $
* $Date: 1999/11/12 17:32:36 $
* $Revision: 1.13 $
* $Date: 1999/11/22 16:44:31 $
* ------------------------------------------------------------------------*/
......@@ -218,11 +218,6 @@
*/
/*#define DEBUG*/
/* Make stack tags more informative than just their size.
* Helps when printing the stack and when running sanity checks.
*/
/*#define DEBUG_EXTRA*/
/* NB: LAZY_BLACKHOLING has been moved up to Stg.h where both Hugs and GHC can see it,
* and EAGER_BLACKHOLING has been introduced also. KSW 1999-01.
*/
......
# --------------------------------------------------------------------------- #
# $Id: Makefile,v 1.19 1999/11/22 10:13:00 sewardj Exp $ #
# $Id: Makefile,v 1.20 1999/11/22 16:44:32 sewardj Exp $ #
# --------------------------------------------------------------------------- #
TOP = ..
......@@ -38,7 +38,7 @@ C_SRCS = link.c type.c static.c storage.c derive.c input.c compiler.c subst.c \
translate.c codegen.c lift.c free.c stgSubst.c output.c \
hugs.c dynamic.c stg.c sainteger.c interface.c
SRC_CC_OPTS = -g -O -I$(GHC_INTERPRETER_DIR) -I$(GHC_INCLUDE_DIR) -I$(GHC_RUNTIME_DIR) -D__HUGS__ -DCOMPILING_RTS -Wall -Wstrict-prototypes -Wno-unused -DDEBUG -DDEBUG_EXTRA -Winline
SRC_CC_OPTS = -g -O -I$(GHC_INTERPRETER_DIR) -I$(GHC_INCLUDE_DIR) -I$(GHC_RUNTIME_DIR) -D__HUGS__ -DCOMPILING_RTS -Wall -Wstrict-prototypes -Wno-unused -DDEBUG -Winline
GHC_LIBS_NEEDED = $(GHC_RUNTIME_DIR)/libHSrts.a
......
/* -----------------------------------------------------------------------------
* $Id: Printer.c,v 1.16 1999/11/22 16:16:35 sewardj Exp $
* $Id: Printer.c,v 1.17 1999/11/22 16:44:33 sewardj Exp $
*
* Copyright (c) 1994-1999.
*
......@@ -299,7 +299,8 @@ void printClosure( StgClosure *obj )
}
default:
//barf("printClosure %d",get_itbl(obj)->type);
fprintf(stderr, "*** printClosure: unknown type %d ****\n",get_itbl(obj)->type );
fprintf(stderr, "*** printClosure: unknown type %d ****\n",
get_itbl(obj)->type );
return;
}
}
......@@ -309,53 +310,12 @@ StgPtr printStackObj( StgPtr sp )
/*fprintf(stderr,"Stack[%d] = ", &stgStack[STACK_SIZE] - sp); */
if (IS_ARG_TAG(*sp)) {
#ifdef DEBUG
StackTag tag = (StackTag)*sp;
switch ( tag ) {
case ILLEGAL_TAG:
barf("printStackObj: ILLEGAL_TAG");
break;
case REALWORLD_TAG:
fprintf(stderr,"RealWorld#\n");
break;
case INT_TAG:
fprintf(stderr,"Int# %d\n", *(StgInt*)(sp+1));
break;
case INT64_TAG:
fprintf(stderr,"Int64# %lld\n", *(StgInt64*)(sp+1));
break;
case WORD_TAG:
fprintf(stderr,"Word# %d\n", *(StgWord*)(sp+1));
break;
case ADDR_TAG:
fprintf(stderr,"Addr# "); printPtr(*(StgAddr*)(sp+1)); fprintf(stderr,"\n");
break;
case CHAR_TAG:
fprintf(stderr,"Char# %d\n", *(StgChar*)(sp+1));
break;
case FLOAT_TAG:
fprintf(stderr,"Float# %f\n", PK_FLT(sp+1));
break;
case DOUBLE_TAG:
fprintf(stderr,"Double# %f\n", PK_DBL(sp+1));
break;
default:
barf("printStackObj: unrecognised ARGTAG %d",tag);
nat i;
StgWord tag = *sp++;
fprintf(stderr,"Tag: %d words\n", tag);
for (i = 0; i < tag; i++) {
fprintf(stderr,"Word# %d\n", *sp++);
}
sp += 1 + ARG_SIZE(tag);
#else /* !DEBUG */
{
StgWord tag = *sp++;
nat i;
fprintf(stderr,"Tag: %d words\n", tag);
for (i = 0; i < tag; i++) {
fprintf(stderr,"Word# %d\n", *sp++);
}
}
#endif
} else {
StgClosure* c = (StgClosure*)(*sp);
printPtr((StgPtr)*sp);
......
......@@ -114,6 +114,9 @@
/* Define if you support the production (and use) of Win32 DLLs. */
#undef HAVE_WIN32_DLL_SUPPORT
/* Define if you have and want to use readline in Hugs. */
#undef HAVE_LIBREADLINE
/* Define if C Symbols have a leading underscore added by the compiler */
#undef LEADING_UNDERSCORE
......@@ -457,6 +460,3 @@
/* Define if you have the iberty library (-liberty). */
#undef HAVE_LIBIBERTY
/* Define if you have the readline library (-lreadline). */
#undef HAVE_LIBREADLINE
Supports Markdown
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