Sun Apr 14 12:30:48 2024 UTC (25d)
make: add debug logging for .if and .for lines in -dp mode

This helps track down in which line a condition is evaluated.


(rillig)
diff -r1.718 -r1.719 src/usr.bin/make/parse.c
diff -r1.17 -r1.18 src/usr.bin/make/unit-tests/directive-export-impl.exp
diff -r1.23 -r1.24 src/usr.bin/make/unit-tests/directive-for-escape.exp
diff -r1.23 -r1.24 src/usr.bin/make/unit-tests/var-eval-short.exp
diff -r1.10 -r1.11 src/usr.bin/make/unit-tests/opt-debug-parse.exp
diff -r1.19 -r1.20 src/usr.bin/make/unit-tests/varmod-loop.exp
diff -r1.20 -r1.21 src/usr.bin/make/unit-tests/varname-dot-shell.exp

cvs diff -r1.718 -r1.719 src/usr.bin/make/parse.c (expand / switch to unified diff)

--- src/usr.bin/make/parse.c 2024/04/01 12:26:02 1.718
+++ src/usr.bin/make/parse.c 2024/04/14 12:30:47 1.719
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: parse.c,v 1.718 2024/04/01 12:26:02 rillig Exp $ */ 1/* $NetBSD: parse.c,v 1.719 2024/04/14 12:30:47 rillig Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1988, 1989, 1990, 1993 4 * Copyright (c) 1988, 1989, 1990, 1993
5 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to Berkeley by 7 * This code is derived from software contributed to Berkeley by
8 * Adam de Boor. 8 * Adam de Boor.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -95,27 +95,27 @@ @@ -95,27 +95,27 @@
95 */ 95 */
96 96
97#include <sys/types.h> 97#include <sys/types.h>
98#include <sys/stat.h> 98#include <sys/stat.h>
99#include <errno.h> 99#include <errno.h>
100#include <stdarg.h> 100#include <stdarg.h>
101 101
102#include "make.h" 102#include "make.h"
103#include "dir.h" 103#include "dir.h"
104#include "job.h" 104#include "job.h"
105#include "pathnames.h" 105#include "pathnames.h"
106 106
107/* "@(#)parse.c 8.3 (Berkeley) 3/19/94" */ 107/* "@(#)parse.c 8.3 (Berkeley) 3/19/94" */
108MAKE_RCSID("$NetBSD: parse.c,v 1.718 2024/04/01 12:26:02 rillig Exp $"); 108MAKE_RCSID("$NetBSD: parse.c,v 1.719 2024/04/14 12:30:47 rillig Exp $");
109 109
110/* Detects a multiple-inclusion guard in a makefile. */ 110/* Detects a multiple-inclusion guard in a makefile. */
111typedef enum { 111typedef enum {
112 GS_START, /* at the beginning of the file */ 112 GS_START, /* at the beginning of the file */
113 GS_COND, /* after the guard condition */ 113 GS_COND, /* after the guard condition */
114 GS_DONE, /* after the closing .endif */ 114 GS_DONE, /* after the closing .endif */
115 GS_NO /* the file is not guarded */ 115 GS_NO /* the file is not guarded */
116} GuardState; 116} GuardState;
117 117
118/* A file being parsed. */ 118/* A file being parsed. */
119typedef struct IncludedFile { 119typedef struct IncludedFile {
120 FStr name; /* absolute or relative to the cwd */ 120 FStr name; /* absolute or relative to the cwd */
121 unsigned lineno; /* 1-based */ 121 unsigned lineno; /* 1-based */
@@ -2597,26 +2597,27 @@ ReadHighLevelLine(void) @@ -2597,26 +2597,27 @@ ReadHighLevelLine(void)
2597 char *line; 2597 char *line;
2598 CondResult condResult; 2598 CondResult condResult;
2599 2599
2600 for (;;) { 2600 for (;;) {
2601 IncludedFile *curFile = CurFile(); 2601 IncludedFile *curFile = CurFile();
2602 line = ReadLowLevelLine(LK_NONEMPTY); 2602 line = ReadLowLevelLine(LK_NONEMPTY);
2603 if (posix_state == PS_MAYBE_NEXT_LINE) 2603 if (posix_state == PS_MAYBE_NEXT_LINE)
2604 posix_state = PS_NOW_OR_NEVER; 2604 posix_state = PS_NOW_OR_NEVER;
2605 else 2605 else
2606 posix_state = PS_TOO_LATE; 2606 posix_state = PS_TOO_LATE;
2607 if (line == NULL) 2607 if (line == NULL)
2608 return NULL; 2608 return NULL;
2609 2609
 2610 DEBUG2(PARSE, "Parsing line %u: %s\n", curFile->lineno, line);
2610 if (curFile->guardState != GS_NO 2611 if (curFile->guardState != GS_NO
2611 && ((curFile->guardState == GS_START && line[0] != '.') 2612 && ((curFile->guardState == GS_START && line[0] != '.')
2612 || curFile->guardState == GS_DONE)) 2613 || curFile->guardState == GS_DONE))
2613 curFile->guardState = GS_NO; 2614 curFile->guardState = GS_NO;
2614 if (line[0] != '.') 2615 if (line[0] != '.')
2615 return line; 2616 return line;
2616 2617
2617 condResult = Cond_EvalLine(line); 2618 condResult = Cond_EvalLine(line);
2618 if (curFile->guardState == GS_START) { 2619 if (curFile->guardState == GS_START) {
2619 Guard *guard; 2620 Guard *guard;
2620 if (condResult != CR_ERROR 2621 if (condResult != CR_ERROR
2621 && (guard = Cond_ExtractGuard(line)) != NULL) { 2622 && (guard = Cond_ExtractGuard(line)) != NULL) {
2622 curFile->guardState = GS_COND; 2623 curFile->guardState = GS_COND;
@@ -2919,28 +2920,26 @@ Parse_File(const char *name, int fd) @@ -2919,28 +2920,26 @@ Parse_File(const char *name, int fd)
2919 char *line; 2920 char *line;
2920 Buffer buf; 2921 Buffer buf;
2921 2922
2922 buf = LoadFile(name, fd != -1 ? fd : STDIN_FILENO); 2923 buf = LoadFile(name, fd != -1 ? fd : STDIN_FILENO);
2923 if (fd != -1) 2924 if (fd != -1)
2924 (void)close(fd); 2925 (void)close(fd);
2925 2926
2926 assert(targets == NULL); 2927 assert(targets == NULL);
2927 2928
2928 Parse_PushInput(name, 1, 0, buf, NULL); 2929 Parse_PushInput(name, 1, 0, buf, NULL);
2929 2930
2930 do { 2931 do {
2931 while ((line = ReadHighLevelLine()) != NULL) { 2932 while ((line = ReadHighLevelLine()) != NULL) {
2932 DEBUG2(PARSE, "Parsing line %u: %s\n", 
2933 CurFile()->lineno, line); 
2934 ParseLine(line); 2933 ParseLine(line);
2935 } 2934 }
2936 } while (ParseEOF()); 2935 } while (ParseEOF());
2937 2936
2938 FinishDependencyGroup(); 2937 FinishDependencyGroup();
2939 2938
2940 if (parseErrors != 0) { 2939 if (parseErrors != 0) {
2941 (void)fflush(stdout); 2940 (void)fflush(stdout);
2942 (void)fprintf(stderr, 2941 (void)fprintf(stderr,
2943 "%s: Fatal errors encountered -- cannot continue\n", 2942 "%s: Fatal errors encountered -- cannot continue\n",
2944 progname); 2943 progname);
2945 PrintOnError(NULL, ""); 2944 PrintOnError(NULL, "");
2946 exit(1); 2945 exit(1);

cvs diff -r1.17 -r1.18 src/usr.bin/make/unit-tests/directive-export-impl.exp (expand / switch to unified diff)

--- src/usr.bin/make/unit-tests/directive-export-impl.exp 2022/03/03 19:36:35 1.17
+++ src/usr.bin/make/unit-tests/directive-export-impl.exp 2024/04/14 12:30:47 1.18
@@ -1,49 +1,51 @@ @@ -1,49 +1,51 @@
1Parsing line 21: UT_VAR= <${REF}> 1Parsing line 21: UT_VAR= <${REF}>
2Global: UT_VAR = <${REF}> 2Global: UT_VAR = <${REF}>
3Parsing line 28: .export UT_VAR 3Parsing line 28: .export UT_VAR
4Global: .MAKE.EXPORTED = UT_VAR 4Global: .MAKE.EXPORTED = UT_VAR
5Parsing line 32: : ${UT_VAR:N*} 5Parsing line 32: : ${UT_VAR:N*}
6Var_Parse: ${UT_VAR:N*} (eval-defined) 6Var_Parse: ${UT_VAR:N*} (eval-defined)
7Var_Parse: ${REF}> (eval-defined) 7Var_Parse: ${REF}> (eval-defined)
8Evaluating modifier ${UT_VAR:N...} on value "<>" 8Evaluating modifier ${UT_VAR:N...} on value "<>"
9Pattern for ':N' is "*" 9Pattern for ':N' is "*"
10ModifyWords: split "<>" into 1 word 10ModifyWords: split "<>" into 1 word
11Result of ${UT_VAR:N*} is "" 11Result of ${UT_VAR:N*} is ""
12ParseDependency(: ) 12ParseDependency(: )
 13Parsing line 42: .if ${:!echo "\$UT_VAR"!} != "<>"
13CondParser_Eval: ${:!echo "\$UT_VAR"!} != "<>" 14CondParser_Eval: ${:!echo "\$UT_VAR"!} != "<>"
14Var_Parse: ${:!echo "\$UT_VAR"!} != "<>" (eval-defined) 15Var_Parse: ${:!echo "\$UT_VAR"!} != "<>" (eval-defined)
15Evaluating modifier ${:!...} on value "" (eval-defined, undefined) 16Evaluating modifier ${:!...} on value "" (eval-defined, undefined)
16Modifier part: "echo "$UT_VAR"" 17Modifier part: "echo "$UT_VAR""
17Capturing the output of command "echo "$UT_VAR"" 18Capturing the output of command "echo "$UT_VAR""
18Var_Parse: ${.MAKE.EXPORTED:O:u} (eval) 19Var_Parse: ${.MAKE.EXPORTED:O:u} (eval)
19Evaluating modifier ${.MAKE.EXPORTED:O} on value "UT_VAR" 20Evaluating modifier ${.MAKE.EXPORTED:O} on value "UT_VAR"
20Result of ${.MAKE.EXPORTED:O} is "UT_VAR" 21Result of ${.MAKE.EXPORTED:O} is "UT_VAR"
21Evaluating modifier ${.MAKE.EXPORTED:u} on value "UT_VAR" 22Evaluating modifier ${.MAKE.EXPORTED:u} on value "UT_VAR"
22Result of ${.MAKE.EXPORTED:u} is "UT_VAR" 23Result of ${.MAKE.EXPORTED:u} is "UT_VAR"
23Var_Parse: ${UT_VAR} (eval) 24Var_Parse: ${UT_VAR} (eval)
24Var_Parse: ${REF}> (eval) 25Var_Parse: ${REF}> (eval)
25Result of ${:!echo "\$UT_VAR"!} is "<>" (eval-defined, defined) 26Result of ${:!echo "\$UT_VAR"!} is "<>" (eval-defined, defined)
26Comparing "<>" != "<>" 27Comparing "<>" != "<>"
27Parsing line 50: : ${UT_VAR:N*} 28Parsing line 50: : ${UT_VAR:N*}
28Var_Parse: ${UT_VAR:N*} (eval-defined) 29Var_Parse: ${UT_VAR:N*} (eval-defined)
29Var_Parse: ${REF}> (eval-defined) 30Var_Parse: ${REF}> (eval-defined)
30Evaluating modifier ${UT_VAR:N...} on value "<>" 31Evaluating modifier ${UT_VAR:N...} on value "<>"
31Pattern for ':N' is "*" 32Pattern for ':N' is "*"
32ModifyWords: split "<>" into 1 word 33ModifyWords: split "<>" into 1 word
33Result of ${UT_VAR:N*} is "" 34Result of ${UT_VAR:N*} is ""
34ParseDependency(: ) 35ParseDependency(: )
35Parsing line 54: REF= defined 36Parsing line 54: REF= defined
36Global: REF = defined 37Global: REF = defined
 38Parsing line 58: .if ${:!echo "\$UT_VAR"!} != "<defined>"
37CondParser_Eval: ${:!echo "\$UT_VAR"!} != "<defined>" 39CondParser_Eval: ${:!echo "\$UT_VAR"!} != "<defined>"
38Var_Parse: ${:!echo "\$UT_VAR"!} != "<defined>" (eval-defined) 40Var_Parse: ${:!echo "\$UT_VAR"!} != "<defined>" (eval-defined)
39Evaluating modifier ${:!...} on value "" (eval-defined, undefined) 41Evaluating modifier ${:!...} on value "" (eval-defined, undefined)
40Modifier part: "echo "$UT_VAR"" 42Modifier part: "echo "$UT_VAR""
41Capturing the output of command "echo "$UT_VAR"" 43Capturing the output of command "echo "$UT_VAR""
42Var_Parse: ${.MAKE.EXPORTED:O:u} (eval) 44Var_Parse: ${.MAKE.EXPORTED:O:u} (eval)
43Evaluating modifier ${.MAKE.EXPORTED:O} on value "UT_VAR" 45Evaluating modifier ${.MAKE.EXPORTED:O} on value "UT_VAR"
44Result of ${.MAKE.EXPORTED:O} is "UT_VAR" 46Result of ${.MAKE.EXPORTED:O} is "UT_VAR"
45Evaluating modifier ${.MAKE.EXPORTED:u} on value "UT_VAR" 47Evaluating modifier ${.MAKE.EXPORTED:u} on value "UT_VAR"
46Result of ${.MAKE.EXPORTED:u} is "UT_VAR" 48Result of ${.MAKE.EXPORTED:u} is "UT_VAR"
47Var_Parse: ${UT_VAR} (eval) 49Var_Parse: ${UT_VAR} (eval)
48Var_Parse: ${REF}> (eval) 50Var_Parse: ${REF}> (eval)
49Result of ${:!echo "\$UT_VAR"!} is "<defined>" (eval-defined, defined) 51Result of ${:!echo "\$UT_VAR"!} is "<defined>" (eval-defined, defined)

cvs diff -r1.23 -r1.24 src/usr.bin/make/unit-tests/directive-for-escape.exp (expand / switch to unified diff)

--- src/usr.bin/make/unit-tests/directive-for-escape.exp 2023/11/19 22:06:15 1.23
+++ src/usr.bin/make/unit-tests/directive-for-escape.exp 2024/04/14 12:30:47 1.24
@@ -96,26 +96,27 @@ For: end for 1 @@ -96,26 +96,27 @@ For: end for 1
96make: "directive-for-escape.mk" line 213: eight and no cents. 96make: "directive-for-escape.mk" line 213: eight and no cents.
97For: end for 1 97For: end for 1
98make: "directive-for-escape.mk" line 226: newline in .for value 98make: "directive-for-escape.mk" line 226: newline in .for value
99make: "directive-for-escape.mk" line 226: newline in .for value 99make: "directive-for-escape.mk" line 226: newline in .for value
100For: loop body with i = " 100For: loop body with i = "
101": 101":
102. info short: ${:U" "} 102. info short: ${:U" "}
103. info long: ${:U" "} 103. info long: ${:U" "}
104make: "directive-for-escape.mk" line 227: short: " " 104make: "directive-for-escape.mk" line 227: short: " "
105make: "directive-for-escape.mk" line 228: long: " " 105make: "directive-for-escape.mk" line 228: long: " "
106For: end for 1 106For: end for 1
107For: loop body with i = " 107For: loop body with i = "
108": 108":
 109Parsing line 244: .for i in "${.newline}"
109For: end for 1 110For: end for 1
110Parse_PushInput: .for loop in directive-for-escape.mk, line 244 111Parse_PushInput: .for loop in directive-for-escape.mk, line 244
111make: "directive-for-escape.mk" line 244: newline in .for value 112make: "directive-for-escape.mk" line 244: newline in .for value
112 in .for loop from directive-for-escape.mk:244 with i = " 113 in .for loop from directive-for-escape.mk:244 with i = "
113" 114"
114For: loop body with i = " 115For: loop body with i = "
115": 116":
116: ${:U" "} 117: ${:U" "}
117SetFilenameVars: ${.PARSEDIR} = <some-dir> ${.PARSEFILE} = `directive-for-escape.mk' 118SetFilenameVars: ${.PARSEDIR} = <some-dir> ${.PARSEFILE} = `directive-for-escape.mk'
118Parsing line 245: : ${:U" "} 119Parsing line 245: : ${:U" "}
119ParseDependency(: " ") 120ParseDependency(: " ")
120ParseEOF: returning to file directive-for-escape.mk, line 247 121ParseEOF: returning to file directive-for-escape.mk, line 247
121SetFilenameVars: ${.PARSEDIR} = <some-dir> ${.PARSEFILE} = `directive-for-escape.mk' 122SetFilenameVars: ${.PARSEDIR} = <some-dir> ${.PARSEFILE} = `directive-for-escape.mk'

cvs diff -r1.23 -r1.24 src/usr.bin/make/unit-tests/var-eval-short.exp (expand / switch to unified diff)

--- src/usr.bin/make/unit-tests/var-eval-short.exp 2023/06/01 20:56:35 1.23
+++ src/usr.bin/make/unit-tests/var-eval-short.exp 2024/04/14 12:30:47 1.24
@@ -1,25 +1,27 @@ @@ -1,25 +1,27 @@
1make: "var-eval-short.mk" line 46: In the :@ modifier of "", the variable name "${FAIL}" must not contain a dollar 1make: "var-eval-short.mk" line 46: In the :@ modifier of "", the variable name "${FAIL}" must not contain a dollar
2make: "var-eval-short.mk" line 46: Malformed conditional (0 && ${:Uword:@${FAIL}@expr@}) 2make: "var-eval-short.mk" line 46: Malformed conditional (0 && ${:Uword:@${FAIL}@expr@})
 3Parsing line 159: .if 0 && ${0:?${FAIL}then:${FAIL}else}
3CondParser_Eval: 0 && ${0:?${FAIL}then:${FAIL}else} 4CondParser_Eval: 0 && ${0:?${FAIL}then:${FAIL}else}
4Var_Parse: ${0:?${FAIL}then:${FAIL}else} (parse-only) 5Var_Parse: ${0:?${FAIL}then:${FAIL}else} (parse-only)
5Parsing modifier ${0:?...} 6Parsing modifier ${0:?...}
6Var_Parse: ${FAIL}then:${FAIL}else} (parse-only) 7Var_Parse: ${FAIL}then:${FAIL}else} (parse-only)
7Modifier part: "${FAIL}then" 8Modifier part: "${FAIL}then"
8Var_Parse: ${FAIL}else} (parse-only) 9Var_Parse: ${FAIL}else} (parse-only)
9Modifier part: "${FAIL}else" 10Modifier part: "${FAIL}else"
10Result of ${0:?${FAIL}then:${FAIL}else} is "" (parse-only, defined) 11Result of ${0:?${FAIL}then:${FAIL}else} is "" (parse-only, defined)
11Parsing line 167: DEFINED= defined 12Parsing line 167: DEFINED= defined
12Global: DEFINED = defined 13Global: DEFINED = defined
 14Parsing line 168: .if 0 && ${DEFINED:L:?${FAIL}then:${FAIL}else}
13CondParser_Eval: 0 && ${DEFINED:L:?${FAIL}then:${FAIL}else} 15CondParser_Eval: 0 && ${DEFINED:L:?${FAIL}then:${FAIL}else}
14Var_Parse: ${DEFINED:L:?${FAIL}then:${FAIL}else} (parse-only) 16Var_Parse: ${DEFINED:L:?${FAIL}then:${FAIL}else} (parse-only)
15Parsing modifier ${DEFINED:L} 17Parsing modifier ${DEFINED:L}
16Result of ${DEFINED:L} is "defined" (parse-only, regular) 18Result of ${DEFINED:L} is "defined" (parse-only, regular)
17Parsing modifier ${DEFINED:?...} 19Parsing modifier ${DEFINED:?...}
18Var_Parse: ${FAIL}then:${FAIL}else} (parse-only) 20Var_Parse: ${FAIL}then:${FAIL}else} (parse-only)
19Modifier part: "${FAIL}then" 21Modifier part: "${FAIL}then"
20Var_Parse: ${FAIL}else} (parse-only) 22Var_Parse: ${FAIL}else} (parse-only)
21Modifier part: "${FAIL}else" 23Modifier part: "${FAIL}else"
22Result of ${DEFINED:?${FAIL}then:${FAIL}else} is "defined" (parse-only, regular) 24Result of ${DEFINED:?${FAIL}then:${FAIL}else} is "defined" (parse-only, regular)
23Parsing line 170: .MAKEFLAGS: -d0 25Parsing line 170: .MAKEFLAGS: -d0
24ParseDependency(.MAKEFLAGS: -d0) 26ParseDependency(.MAKEFLAGS: -d0)
25Global: .MAKEFLAGS = -r -k -d cpv -d 27Global: .MAKEFLAGS = -r -k -d cpv -d

cvs diff -r1.10 -r1.11 src/usr.bin/make/unit-tests/opt-debug-parse.exp (expand / switch to unified diff)

--- src/usr.bin/make/unit-tests/opt-debug-parse.exp 2023/06/01 20:56:35 1.10
+++ src/usr.bin/make/unit-tests/opt-debug-parse.exp 2024/04/14 12:30:47 1.11
@@ -1,26 +1,28 @@ @@ -1,26 +1,28 @@
 1Parsing line 16: .for var in value
1Parse_PushInput: .for loop in opt-debug-parse.mk, line 16 2Parse_PushInput: .for loop in opt-debug-parse.mk, line 16
2SetFilenameVars: ${.PARSEDIR} = <some-dir> ${.PARSEFILE} = `opt-debug-parse.mk' 3SetFilenameVars: ${.PARSEDIR} = <some-dir> ${.PARSEFILE} = `opt-debug-parse.mk'
3Parsing line 21: .info trace with multi-line .for loop head 4Parsing line 21: .info trace with multi-line .for loop head
4make: "opt-debug-parse.mk" line 21: trace with multi-line .for loop head 5make: "opt-debug-parse.mk" line 21: trace with multi-line .for loop head
5 in .for loop from opt-debug-parse.mk:16 with var = value 6 in .for loop from opt-debug-parse.mk:16 with var = value
6ParseEOF: returning to file opt-debug-parse.mk, line 23 7ParseEOF: returning to file opt-debug-parse.mk, line 23
7SetFilenameVars: ${.PARSEDIR} = <some-dir> ${.PARSEFILE} = `opt-debug-parse.mk' 8SetFilenameVars: ${.PARSEDIR} = <some-dir> ${.PARSEFILE} = `opt-debug-parse.mk'
8Parsing line 26: .include "/dev/null" 9Parsing line 26: .include "/dev/null"
9Parse_PushInput: file /dev/null, line 1 10Parse_PushInput: file /dev/null, line 1
10SetFilenameVars: ${.PARSEDIR} = <some-dir> ${.PARSEFILE} = `null' 11SetFilenameVars: ${.PARSEDIR} = <some-dir> ${.PARSEFILE} = `null'
11SetFilenameVars: ${.INCLUDEDFROMDIR} = <some-dir> ${.INCLUDEDFROMFILE} = `opt-debug-parse.mk' 12SetFilenameVars: ${.INCLUDEDFROMDIR} = <some-dir> ${.INCLUDEDFROMFILE} = `opt-debug-parse.mk'
12ParseEOF: returning to file opt-debug-parse.mk, line 27 13ParseEOF: returning to file opt-debug-parse.mk, line 27
13SetFilenameVars: ${.PARSEDIR} = <some-dir> ${.PARSEFILE} = `opt-debug-parse.mk' 14SetFilenameVars: ${.PARSEDIR} = <some-dir> ${.PARSEFILE} = `opt-debug-parse.mk'
 15Parsing line 31: .for a b c in 1 2 3 ${:U4 5 6}
14Parse_PushInput: .for loop in opt-debug-parse.mk, line 31 16Parse_PushInput: .for loop in opt-debug-parse.mk, line 31
15SetFilenameVars: ${.PARSEDIR} = <some-dir> ${.PARSEFILE} = `opt-debug-parse.mk' 17SetFilenameVars: ${.PARSEDIR} = <some-dir> ${.PARSEFILE} = `opt-debug-parse.mk'
16Parsing line 34: .info trace 18Parsing line 34: .info trace
17make: "opt-debug-parse.mk" line 34: trace 19make: "opt-debug-parse.mk" line 34: trace
18 in .for loop from opt-debug-parse.mk:31 with a = 1, b = 2, c = 3 20 in .for loop from opt-debug-parse.mk:31 with a = 1, b = 2, c = 3
19Parsing line 34: .info trace 21Parsing line 34: .info trace
20make: "opt-debug-parse.mk" line 34: trace 22make: "opt-debug-parse.mk" line 34: trace
21 in .for loop from opt-debug-parse.mk:31 with a = 4, b = 5, c = 6 23 in .for loop from opt-debug-parse.mk:31 with a = 4, b = 5, c = 6
22ParseEOF: returning to file opt-debug-parse.mk, line 36 24ParseEOF: returning to file opt-debug-parse.mk, line 36
23SetFilenameVars: ${.PARSEDIR} = <some-dir> ${.PARSEFILE} = `opt-debug-parse.mk' 25SetFilenameVars: ${.PARSEDIR} = <some-dir> ${.PARSEFILE} = `opt-debug-parse.mk'
24Parsing line 38: .MAKEFLAGS: -d0 26Parsing line 38: .MAKEFLAGS: -d0
25ParseDependency(.MAKEFLAGS: -d0) 27ParseDependency(.MAKEFLAGS: -d0)
26exit status 0 28exit status 0

cvs diff -r1.19 -r1.20 src/usr.bin/make/unit-tests/varmod-loop.exp (expand / switch to unified diff)

--- src/usr.bin/make/unit-tests/varmod-loop.exp 2023/02/18 11:55:20 1.19
+++ src/usr.bin/make/unit-tests/varmod-loop.exp 2024/04/14 12:30:48 1.20
@@ -1,17 +1,19 @@ @@ -1,17 +1,19 @@
1Parsing line 91: USE_8_DOLLARS= ${:U1:@var@${8_DOLLARS}@} ${8_DOLLARS} $$$$$$$$ 1Parsing line 91: USE_8_DOLLARS= ${:U1:@var@${8_DOLLARS}@} ${8_DOLLARS} $$$$$$$$
 2Parsing line 92: .if ${USE_8_DOLLARS} != "\$\$\$\$ \$\$\$\$ \$\$\$\$"
2CondParser_Eval: ${USE_8_DOLLARS} != "\$\$\$\$ \$\$\$\$ \$\$\$\$" 3CondParser_Eval: ${USE_8_DOLLARS} != "\$\$\$\$ \$\$\$\$ \$\$\$\$"
3Comparing "$$$$ $$$$ $$$$" != "$$$$ $$$$ $$$$" 4Comparing "$$$$ $$$$ $$$$" != "$$$$ $$$$ $$$$"
4Parsing line 96: SUBST_CONTAINING_LOOP:= ${USE_8_DOLLARS} 5Parsing line 96: SUBST_CONTAINING_LOOP:= ${USE_8_DOLLARS}
 6Parsing line 118: .if ${SUBST_CONTAINING_LOOP} != "\$\$ \$\$\$\$ \$\$\$\$"
5CondParser_Eval: ${SUBST_CONTAINING_LOOP} != "\$\$ \$\$\$\$ \$\$\$\$" 7CondParser_Eval: ${SUBST_CONTAINING_LOOP} != "\$\$ \$\$\$\$ \$\$\$\$"
6Comparing "$$ $$$$ $$$$" != "$$ $$$$ $$$$" 8Comparing "$$ $$$$ $$$$" != "$$ $$$$ $$$$"
7Parsing line 121: .MAKEFLAGS: -d0 9Parsing line 121: .MAKEFLAGS: -d0
8ParseDependency(.MAKEFLAGS: -d0) 10ParseDependency(.MAKEFLAGS: -d0)
9:varname-overwriting-target: :x1y x2y x3y: :: 11:varname-overwriting-target: :x1y x2y x3y: ::
10mod-loop-dollar:1: 12mod-loop-dollar:1:
11mod-loop-dollar:${word}$: 13mod-loop-dollar:${word}$:
12mod-loop-dollar:$3$: 14mod-loop-dollar:$3$:
13mod-loop-dollar:$${word}$$: 15mod-loop-dollar:$${word}$$:
14mod-loop-dollar:$$5$$: 16mod-loop-dollar:$$5$$:
15mod-loop-dollar:$$${word}$$$: 17mod-loop-dollar:$$${word}$$$:
16: t=$(( ${t:-0} + 1 )) 18: t=$(( ${t:-0} + 1 ))
17: dollar=end 19: dollar=end

cvs diff -r1.20 -r1.21 src/usr.bin/make/unit-tests/varname-dot-shell.exp (expand / switch to unified diff)

--- src/usr.bin/make/unit-tests/varname-dot-shell.exp 2023/12/20 09:03:09 1.20
+++ src/usr.bin/make/unit-tests/varname-dot-shell.exp 2024/04/14 12:30:48 1.21
@@ -1,32 +1,35 @@ @@ -1,32 +1,35 @@
1Parsing line 10: ORIG_SHELL:= ${.SHELL} 1Parsing line 10: ORIG_SHELL:= ${.SHELL}
2Global: ORIG_SHELL = # (empty) 2Global: ORIG_SHELL = # (empty)
3Var_Parse: ${.SHELL} (eval-keep-dollar-and-undefined) 3Var_Parse: ${.SHELL} (eval-keep-dollar-and-undefined)
4Global: ignoring delete '.SHELL' as it is not found 4Global: ignoring delete '.SHELL' as it is not found
5Command: .SHELL = (details omitted) 5Command: .SHELL = (details omitted)
6Global: ORIG_SHELL = (details omitted) 6Global: ORIG_SHELL = (details omitted)
7Parsing line 12: .SHELL= overwritten 7Parsing line 12: .SHELL= overwritten
8Global: ignoring '.SHELL = overwritten' due to a command line variable of the same name 8Global: ignoring '.SHELL = overwritten' due to a command line variable of the same name
 9Parsing line 13: .if ${.SHELL} != ${ORIG_SHELL}
9CondParser_Eval: ${.SHELL} != ${ORIG_SHELL} 10CondParser_Eval: ${.SHELL} != ${ORIG_SHELL}
10Var_Parse: ${.SHELL} != ${ORIG_SHELL} (eval-defined) 11Var_Parse: ${.SHELL} != ${ORIG_SHELL} (eval-defined)
11Var_Parse: ${ORIG_SHELL} (eval-defined) 12Var_Parse: ${ORIG_SHELL} (eval-defined)
12Comparing "(details omitted)" != "(details omitted)" 13Comparing "(details omitted)" != "(details omitted)"
13Parsing line 19: .MAKEFLAGS: .SHELL+=appended 14Parsing line 19: .MAKEFLAGS: .SHELL+=appended
14ParseDependency(.MAKEFLAGS: .SHELL+=appended) 15ParseDependency(.MAKEFLAGS: .SHELL+=appended)
15Command: ignoring '.SHELL += appended' as it is read-only 16Command: ignoring '.SHELL += appended' as it is read-only
 17Parsing line 20: .if ${.SHELL} != ${ORIG_SHELL}
16CondParser_Eval: ${.SHELL} != ${ORIG_SHELL} 18CondParser_Eval: ${.SHELL} != ${ORIG_SHELL}
17Var_Parse: ${.SHELL} != ${ORIG_SHELL} (eval-defined) 19Var_Parse: ${.SHELL} != ${ORIG_SHELL} (eval-defined)
18Var_Parse: ${ORIG_SHELL} (eval-defined) 20Var_Parse: ${ORIG_SHELL} (eval-defined)
19Comparing "(details omitted)" != "(details omitted)" 21Comparing "(details omitted)" != "(details omitted)"
20Parsing line 27: .undef .SHELL 22Parsing line 27: .undef .SHELL
21Global: ignoring delete '.SHELL' as it is not found 23Global: ignoring delete '.SHELL' as it is not found
22Parsing line 28: .SHELL= newly overwritten 24Parsing line 28: .SHELL= newly overwritten
23Global: ignoring '.SHELL = newly overwritten' due to a command line variable of the same name 25Global: ignoring '.SHELL = newly overwritten' due to a command line variable of the same name
 26Parsing line 29: .if ${.SHELL} != ${ORIG_SHELL}
24CondParser_Eval: ${.SHELL} != ${ORIG_SHELL} 27CondParser_Eval: ${.SHELL} != ${ORIG_SHELL}
25Var_Parse: ${.SHELL} != ${ORIG_SHELL} (eval-defined) 28Var_Parse: ${.SHELL} != ${ORIG_SHELL} (eval-defined)
26Var_Parse: ${ORIG_SHELL} (eval-defined) 29Var_Parse: ${ORIG_SHELL} (eval-defined)
27Comparing "(details omitted)" != "(details omitted)" 30Comparing "(details omitted)" != "(details omitted)"
28Parsing line 33: .MAKEFLAGS: -d0 31Parsing line 33: .MAKEFLAGS: -d0
29ParseDependency(.MAKEFLAGS: -d0) 32ParseDependency(.MAKEFLAGS: -d0)
30Global: .MAKEFLAGS = -r -k -d cpv -d 33Global: .MAKEFLAGS = -r -k -d cpv -d
31Global: .MAKEFLAGS = -r -k -d cpv -d 0 34Global: .MAKEFLAGS = -r -k -d cpv -d 0
32exit status 0 35exit status 0