m4-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch-1_4 trace bug


From: Eric Blake
Subject: branch-1_4 trace bug
Date: Mon, 05 Jun 2006 11:59:03 +0000

I noticed that autom4te had a comment complaining about this
bug, which has since been fixed in CVS head.  It is a one-line fix,
minus documentation!  Unless I hear objections, I will apply it
the same time as my other pending tracing patch.

# This is because GNU M4 1.4's tracing of builtins is buggy.  When run on
# this input:
#
# | divert(-1)
# | changequote([, ])
# | define([m4_eval], defn([eval]))
# | eval(1)
# | m4_eval(2)
# | undefine([eval])
# | m4_eval(3)
#
# it behaves this way:
#
# | % m4 input.m4 -da -t eval
# | m4trace: -1- eval(1)
# | m4trace: -1- m4_eval(2)
# | m4trace: -1- m4_eval(3)
# | %
#
# Conversely:
#
# | % m4 input.m4 -da -t m4_eval
# | %

2006-06-04  Eric Blake  <address@hidden>

        * src/builtin.c (define_builtin): Trace status of builtins is no
        longer inherited across define(...,defn(...)).  Fixes bug that
        autom4te had been working around.
        * doc/m4.texinfo (Trace): Add test for this.
        * NEWS: Document this.
Index: NEWS
===================================================================
RCS file: /sources/m4/m4/NEWS,v
retrieving revision 1.1.1.1.2.13
diff -u -p -r1.1.1.1.2.13 NEWS
--- NEWS        1 Jun 2006 00:09:06 -0000       1.1.1.1.2.13
+++ NEWS        5 Jun 2006 11:55:15 -0000
@@ -7,6 +7,9 @@ Version 1.4.5 - ??? 2006, by ???
 * Fix a recursive push_string crashing bug.
 * Use automake to fix build portability issues.
 * Fix a recursive m4wrap crashing bug.
+* Fix a tracing bug, where "m4 -tm4_eval" failed to trace the input
+  "define(`m4_eval',defn(`eval'))m4_eval(1)".  This also means that
+  "m4 -teval" no longer traces the same input.
 
 Version 1.4.4 - October 2005, by Gary V. Vaughan
 
Index: doc/m4.texinfo
===================================================================
RCS file: /sources/m4/m4/doc/m4.texinfo,v
retrieving revision 1.1.1.1.2.15
diff -u -p -r1.1.1.1.2.15 m4.texinfo
--- doc/m4.texinfo      30 May 2006 13:52:29 -0000      1.1.1.1.2.15
+++ doc/m4.texinfo      5 Jun 2006 11:55:16 -0000
@@ -1620,6 +1620,24 @@ The number between dashes is the depth o
 of the time, signifying an expansion at the outermost level, but it
 increases when macro arguments contain unquoted macro calls.
 
+Tracing even works on builtins, but does not transfer via @command{defn}
+(@pxref{Defn}).
+
address@hidden
+define(`m4_eval')traceon(`eval', `m4_divnum')
address@hidden
+define(`m4_eval', defn(`eval'))
address@hidden
+define(`m4_divnum', defn(`divnum'))
address@hidden
+eval(divnum)
address@hidden: -1- eval(0)
address@hidden
+m4_eval(m4_divnum)
address@hidden: -2- m4_divnum
address@hidden
address@hidden example
+
 @xref{Debug Levels}, for information on controlling the details of the
 display.
 
Index: src/builtin.c
===================================================================
RCS file: /sources/m4/m4/src/Attic/builtin.c,v
retrieving revision 1.1.1.1.2.5
diff -u -p -r1.1.1.1.2.5 builtin.c
--- src/builtin.c       31 May 2006 22:54:13 -0000      1.1.1.1.2.5
+++ src/builtin.c       5 Jun 2006 11:55:16 -0000
@@ -196,7 +196,6 @@ define_builtin (const char *name, const 
   SYMBOL_MACRO_ARGS (sym) = bp->groks_macro_args;
   SYMBOL_BLIND_NO_ARGS (sym) = bp->blind_if_no_args;
   SYMBOL_FUNC (sym) = bp->func;
-  SYMBOL_TRACED (sym) = traced;
 }
 
 /*-------------------------------------------------------------------------.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]