Module Name:    src
Committed By:   rillig
Date:           Sun Jan  2 03:23:55 UTC 2022

Modified Files:
        src/usr.bin/make/unit-tests: opt-debug-parse.exp opt-debug-parse.mk

Log Message:
tests/make: demonstrate bugs in PrintStackTrace


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/make/unit-tests/opt-debug-parse.exp \
    src/usr.bin/make/unit-tests/opt-debug-parse.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/make/unit-tests/opt-debug-parse.exp
diff -u src/usr.bin/make/unit-tests/opt-debug-parse.exp:1.1 src/usr.bin/make/unit-tests/opt-debug-parse.exp:1.2
--- src/usr.bin/make/unit-tests/opt-debug-parse.exp:1.1	Sat Sep  5 06:20:51 2020
+++ src/usr.bin/make/unit-tests/opt-debug-parse.exp	Sun Jan  2 03:23:55 2022
@@ -1 +1,10 @@
+Parse_PushInput: .for loop in opt-debug-parse.mk, line 16
+SetFilenameVars: ${.PARSEDIR} = `<curdir>' ${.PARSEFILE} = `opt-debug-parse.mk'
+Parsing line 17: .info trace with multi-line .for loop head
+make: "opt-debug-parse.mk" line 17: trace with multi-line .for loop head
+	in .include from opt-debug-parse.mk:18
+ParseEOF: returning to file opt-debug-parse.mk, line 18
+SetFilenameVars: ${.PARSEDIR} = `<curdir>' ${.PARSEFILE} = `opt-debug-parse.mk'
+Parsing line 22: .MAKEFLAGS: -d0
+ParseDependency(.MAKEFLAGS: -d0)
 exit status 0
Index: src/usr.bin/make/unit-tests/opt-debug-parse.mk
diff -u src/usr.bin/make/unit-tests/opt-debug-parse.mk:1.1 src/usr.bin/make/unit-tests/opt-debug-parse.mk:1.2
--- src/usr.bin/make/unit-tests/opt-debug-parse.mk:1.1	Sat Sep  5 06:20:51 2020
+++ src/usr.bin/make/unit-tests/opt-debug-parse.mk	Sun Jan  2 03:23:55 2022
@@ -1,9 +1,24 @@
-# $NetBSD: opt-debug-parse.mk,v 1.1 2020/09/05 06:20:51 rillig Exp $
+# $NetBSD: opt-debug-parse.mk,v 1.2 2022/01/02 03:23:55 rillig Exp $
 #
 # Tests for the -dp command line option, which adds debug logging about
 # makefile parsing.
 
+.MAKEFLAGS: -dp
+
 # TODO: Implementation
 
-all:
-	@:;
+# In PrintStackTrace, the line number of the .for loop is wrong.  The actual
+# line number printed is the last line before the loop body, while it should
+# rather be the line number where the .for loop starts.
+.for \
+    var \
+    in \
+    value
+.info trace with multi-line .for loop head
+.endfor
+# FIXME: The .exp file says 'in .include from opt-debug-parse.mk:18', which is
+# completely wrong.  It should rather say 'in .for loop from :13'.
+
+.MAKEFLAGS: -d0
+
+all: .PHONY

Reply via email to