summaryrefslogtreecommitdiff
path: root/usr.bin/m4/main.c
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2003-06-30 21:47:22 +0000
committerMarc Espie <espie@cvs.openbsd.org>2003-06-30 21:47:22 +0000
commit06c9ed6564f8bbc0056658a983d379052179aa86 (patch)
treee2c1a9ac42503c1580f5acf99ef39fea3d6c8df4 /usr.bin/m4/main.c
parent6947789365296ced45fe71914dfebf93e2dd8934 (diff)
Make the trace status of a macro an actual argument that gets pushed
in the frame for the macro expansion. (This will allow one single lookup to grab the macro definition and the trace status) okay millert@
Diffstat (limited to 'usr.bin/m4/main.c')
-rw-r--r--usr.bin/m4/main.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/usr.bin/m4/main.c b/usr.bin/m4/main.c
index d0e0e64286c..5a814d2e46c 100644
--- a/usr.bin/m4/main.c
+++ b/usr.bin/m4/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.59 2003/06/30 21:42:50 espie Exp $ */
+/* $OpenBSD: main.c,v 1.60 2003/06/30 21:47:21 espie Exp $ */
/* $NetBSD: main.c,v 1.12 1997/02/08 23:54:49 cgd Exp $ */
/*-
@@ -43,7 +43,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: main.c,v 1.59 2003/06/30 21:42:50 espie Exp $";
+static char rcsid[] = "$OpenBSD: main.c,v 1.60 2003/06/30 21:47:21 espie Exp $";
#endif
#endif /* not lint */
@@ -328,6 +328,10 @@ macro(void)
*/
pushf(fp); /* previous call frm */
pushf(macro_getdef(p)->type); /* type of the call */
+ if (traced_macros && is_traced(macro_name(p)))
+ pushf(1);
+ else
+ pushf(0);
pushf(0); /* parenthesis level */
fp = sp; /* new frame pointer */
/*
@@ -344,7 +348,7 @@ macro(void)
if (sp == STACKMAX)
errx(1, "internal stack overflow");
eval((const char **) mstack+fp+1, 2,
- CALTYP);
+ CALTYP, TRACESTATUS);
ep = PREVEP; /* flush strspace */
sp = PREVSP; /* previous sp.. */
@@ -443,7 +447,7 @@ macro(void)
errx(1, "internal stack overflow");
eval((const char **) mstack+fp+1, sp-fp,
- CALTYP);
+ CALTYP, TRACESTATUS);
ep = PREVEP; /* flush strspace */
sp = PREVSP; /* previous sp.. */