From 459b9f6fce4aa3a0d538d153563b6c75ccb40221 Mon Sep 17 00:00:00 2001 From: "Daniel C. Sobral" Date: Tue, 6 Apr 1999 02:43:06 +0000 Subject: [PATCH] Reactivate trace! after making it egcs-friendly. --- sys/boot/ficl/Makefile | 4 ++-- sys/boot/ficl/ficl.c | 25 ++++++++++++++----------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/sys/boot/ficl/Makefile b/sys/boot/ficl/Makefile index 74eca13356f7..ab1071620704 100644 --- a/sys/boot/ficl/Makefile +++ b/sys/boot/ficl/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.8 1999/02/04 17:13:30 dcs Exp $ +# $Id: Makefile,v 1.9 1999/03/17 23:03:36 dcs Exp $ # LIB= ficl NOPROFILE= yes @@ -14,7 +14,7 @@ SOFTWORDS= softcore.fr jhlocal.fr marker.fr freebsd.fr #SOFTWORDS+= oo.fr classes.fr .PATH: ${.CURDIR}/softwords -CFLAGS+= -I${.CURDIR} # -DFICL_TRACE +CFLAGS+= -I${.CURDIR} -DFICL_TRACE softcore.c: ${SOFTWORDS} softcore.awk (cd ${.CURDIR}/softwords; cat ${SOFTWORDS} | awk -f softcore.awk) > ${.TARGET} diff --git a/sys/boot/ficl/ficl.c b/sys/boot/ficl/ficl.c index 2dada3db4f6c..9274c1bfebeb 100644 --- a/sys/boot/ficl/ficl.c +++ b/sys/boot/ficl/ficl.c @@ -176,6 +176,9 @@ int ficlBuild(char *name, FICL_CODE code, char flags) **************************************************************************/ int ficlExec(FICL_VM *pVM, char *pText, INT32 size) { +#ifdef FICL_TRACE + extern int isAFiclWord(FICL_WORD *pFW); +#endif int except; FICL_WORD *tempFW; jmp_buf vmState; @@ -230,7 +233,7 @@ int ficlExec(FICL_VM *pVM, char *pText, INT32 size) if (tempFW->code == literalParen) { - c = *(pVM->ip); + c = *PTRtoCELL(pVM->ip); if (isAFiclWord(c.p)) { FICL_WORD *pLit = (FICL_WORD *)c.p; @@ -242,12 +245,12 @@ int ficlExec(FICL_VM *pVM, char *pText, INT32 size) } else if (tempFW->code == stringLit) { - FICL_STRING *sp = (FICL_STRING *)(void *)pVM->ip; + FICL_STRING *sp = PTRtoSTRING(pVM->ip); sprintf(buffer, " s\" %.*s\"", sp->count, sp->text); } else if (tempFW->code == ifParen) { - c = *pVM->ip; + c = *PTRtoCELL(pVM->ip); if (c.i > 0) sprintf(buffer, " if / while (branch rel %ld)", c.i); else @@ -255,7 +258,7 @@ int ficlExec(FICL_VM *pVM, char *pText, INT32 size) } else if (tempFW->code == branchParen) { - c = *pVM->ip; + c = *PTRtoCELL(pVM->ip); if (c.i > 0) sprintf(buffer, " else (branch rel %ld)", c.i); else @@ -263,23 +266,23 @@ int ficlExec(FICL_VM *pVM, char *pText, INT32 size) } else if (tempFW->code == qDoParen) { - c = *pVM->ip; + c = *PTRtoCELL(pVM->ip); sprintf(buffer, " ?do (leave abs %#lx)", c.u); } else if (tempFW->code == doParen) { - c = *pVM->ip; + c = *PTRtoCELL(pVM->ip); sprintf(buffer, " do (leave abs %#lx)", c.u); } else if (tempFW->code == loopParen) { - c = *pVM->ip; - sprintf(buffer, " loop (branch rel %#ld)", c.i); + c = *PTRtoCELL(pVM->ip); + sprintf(buffer, " loop (branch rel %ld)", c.i); } else if (tempFW->code == plusLoopParen) { - c = *pVM->ip; - sprintf(buffer, " +loop (branch rel %#ld)", c.i); + c = *PTRtoCELL(pVM->ip); + sprintf(buffer, " +loop (branch rel %ld)", c.i); } else /* default: print word's name */ { @@ -292,7 +295,7 @@ int ficlExec(FICL_VM *pVM, char *pText, INT32 size) * - punt and print value */ { - sprintf(buffer, " %ld (%#lx)", ((CELL*)pVM->ip)->i, ((CELL*)pVM->ip)->u); + sprintf(buffer, " %ld (%#lx)", (PTRtoCELL(pVM->ip))->i, (PTRtoCELL(pVM->ip))->u); vmTextOut(pVM, buffer, 1); } #endif FICL_TRACE