make: add debug logging for .if and .for lines in -dp mode This helps track down in which line a condition is evaluated.diff -r1.718 -r1.719 src/usr.bin/make/parse.c
(rillig)
--- 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" */ | |
108 | MAKE_RCSID("$NetBSD: parse.c,v 1.718 2024/04/01 12:26:02 rillig Exp $"); | 108 | MAKE_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. */ | |
111 | typedef enum { | 111 | typedef 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. */ | |
119 | typedef struct IncludedFile { | 119 | typedef 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); |
--- 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 @@ | |||
1 | Parsing line 21: UT_VAR= <${REF}> | 1 | Parsing line 21: UT_VAR= <${REF}> | |
2 | Global: UT_VAR = <${REF}> | 2 | Global: UT_VAR = <${REF}> | |
3 | Parsing line 28: .export UT_VAR | 3 | Parsing line 28: .export UT_VAR | |
4 | Global: .MAKE.EXPORTED = UT_VAR | 4 | Global: .MAKE.EXPORTED = UT_VAR | |
5 | Parsing line 32: : ${UT_VAR:N*} | 5 | Parsing line 32: : ${UT_VAR:N*} | |
6 | Var_Parse: ${UT_VAR:N*} (eval-defined) | 6 | Var_Parse: ${UT_VAR:N*} (eval-defined) | |
7 | Var_Parse: ${REF}> (eval-defined) | 7 | Var_Parse: ${REF}> (eval-defined) | |
8 | Evaluating modifier ${UT_VAR:N...} on value "<>" | 8 | Evaluating modifier ${UT_VAR:N...} on value "<>" | |
9 | Pattern for ':N' is "*" | 9 | Pattern for ':N' is "*" | |
10 | ModifyWords: split "<>" into 1 word | 10 | ModifyWords: split "<>" into 1 word | |
11 | Result of ${UT_VAR:N*} is "" | 11 | Result of ${UT_VAR:N*} is "" | |
12 | ParseDependency(: ) | 12 | ParseDependency(: ) | |
13 | Parsing line 42: .if ${:!echo "\$UT_VAR"!} != "<>" | |||
13 | CondParser_Eval: ${:!echo "\$UT_VAR"!} != "<>" | 14 | CondParser_Eval: ${:!echo "\$UT_VAR"!} != "<>" | |
14 | Var_Parse: ${:!echo "\$UT_VAR"!} != "<>" (eval-defined) | 15 | Var_Parse: ${:!echo "\$UT_VAR"!} != "<>" (eval-defined) | |
15 | Evaluating modifier ${:!...} on value "" (eval-defined, undefined) | 16 | Evaluating modifier ${:!...} on value "" (eval-defined, undefined) | |
16 | Modifier part: "echo "$UT_VAR"" | 17 | Modifier part: "echo "$UT_VAR"" | |
17 | Capturing the output of command "echo "$UT_VAR"" | 18 | Capturing the output of command "echo "$UT_VAR"" | |
18 | Var_Parse: ${.MAKE.EXPORTED:O:u} (eval) | 19 | Var_Parse: ${.MAKE.EXPORTED:O:u} (eval) | |
19 | Evaluating modifier ${.MAKE.EXPORTED:O} on value "UT_VAR" | 20 | Evaluating modifier ${.MAKE.EXPORTED:O} on value "UT_VAR" | |
20 | Result of ${.MAKE.EXPORTED:O} is "UT_VAR" | 21 | Result of ${.MAKE.EXPORTED:O} is "UT_VAR" | |
21 | Evaluating modifier ${.MAKE.EXPORTED:u} on value "UT_VAR" | 22 | Evaluating modifier ${.MAKE.EXPORTED:u} on value "UT_VAR" | |
22 | Result of ${.MAKE.EXPORTED:u} is "UT_VAR" | 23 | Result of ${.MAKE.EXPORTED:u} is "UT_VAR" | |
23 | Var_Parse: ${UT_VAR} (eval) | 24 | Var_Parse: ${UT_VAR} (eval) | |
24 | Var_Parse: ${REF}> (eval) | 25 | Var_Parse: ${REF}> (eval) | |
25 | Result of ${:!echo "\$UT_VAR"!} is "<>" (eval-defined, defined) | 26 | Result of ${:!echo "\$UT_VAR"!} is "<>" (eval-defined, defined) | |
26 | Comparing "<>" != "<>" | 27 | Comparing "<>" != "<>" | |
27 | Parsing line 50: : ${UT_VAR:N*} | 28 | Parsing line 50: : ${UT_VAR:N*} | |
28 | Var_Parse: ${UT_VAR:N*} (eval-defined) | 29 | Var_Parse: ${UT_VAR:N*} (eval-defined) | |
29 | Var_Parse: ${REF}> (eval-defined) | 30 | Var_Parse: ${REF}> (eval-defined) | |
30 | Evaluating modifier ${UT_VAR:N...} on value "<>" | 31 | Evaluating modifier ${UT_VAR:N...} on value "<>" | |
31 | Pattern for ':N' is "*" | 32 | Pattern for ':N' is "*" | |
32 | ModifyWords: split "<>" into 1 word | 33 | ModifyWords: split "<>" into 1 word | |
33 | Result of ${UT_VAR:N*} is "" | 34 | Result of ${UT_VAR:N*} is "" | |
34 | ParseDependency(: ) | 35 | ParseDependency(: ) | |
35 | Parsing line 54: REF= defined | 36 | Parsing line 54: REF= defined | |
36 | Global: REF = defined | 37 | Global: REF = defined | |
38 | Parsing line 58: .if ${:!echo "\$UT_VAR"!} != "<defined>" | |||
37 | CondParser_Eval: ${:!echo "\$UT_VAR"!} != "<defined>" | 39 | CondParser_Eval: ${:!echo "\$UT_VAR"!} != "<defined>" | |
38 | Var_Parse: ${:!echo "\$UT_VAR"!} != "<defined>" (eval-defined) | 40 | Var_Parse: ${:!echo "\$UT_VAR"!} != "<defined>" (eval-defined) | |
39 | Evaluating modifier ${:!...} on value "" (eval-defined, undefined) | 41 | Evaluating modifier ${:!...} on value "" (eval-defined, undefined) | |
40 | Modifier part: "echo "$UT_VAR"" | 42 | Modifier part: "echo "$UT_VAR"" | |
41 | Capturing the output of command "echo "$UT_VAR"" | 43 | Capturing the output of command "echo "$UT_VAR"" | |
42 | Var_Parse: ${.MAKE.EXPORTED:O:u} (eval) | 44 | Var_Parse: ${.MAKE.EXPORTED:O:u} (eval) | |
43 | Evaluating modifier ${.MAKE.EXPORTED:O} on value "UT_VAR" | 45 | Evaluating modifier ${.MAKE.EXPORTED:O} on value "UT_VAR" | |
44 | Result of ${.MAKE.EXPORTED:O} is "UT_VAR" | 46 | Result of ${.MAKE.EXPORTED:O} is "UT_VAR" | |
45 | Evaluating modifier ${.MAKE.EXPORTED:u} on value "UT_VAR" | 47 | Evaluating modifier ${.MAKE.EXPORTED:u} on value "UT_VAR" | |
46 | Result of ${.MAKE.EXPORTED:u} is "UT_VAR" | 48 | Result of ${.MAKE.EXPORTED:u} is "UT_VAR" | |
47 | Var_Parse: ${UT_VAR} (eval) | 49 | Var_Parse: ${UT_VAR} (eval) | |
48 | Var_Parse: ${REF}> (eval) | 50 | Var_Parse: ${REF}> (eval) | |
49 | Result of ${:!echo "\$UT_VAR"!} is "<defined>" (eval-defined, defined) | 51 | Result of ${:!echo "\$UT_VAR"!} is "<defined>" (eval-defined, defined) |
--- 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 | |||
96 | make: "directive-for-escape.mk" line 213: eight and no cents. | 96 | make: "directive-for-escape.mk" line 213: eight and no cents. | |
97 | For: end for 1 | 97 | For: end for 1 | |
98 | make: "directive-for-escape.mk" line 226: newline in .for value | 98 | make: "directive-for-escape.mk" line 226: newline in .for value | |
99 | make: "directive-for-escape.mk" line 226: newline in .for value | 99 | make: "directive-for-escape.mk" line 226: newline in .for value | |
100 | For: loop body with i = " | 100 | For: loop body with i = " | |
101 | ": | 101 | ": | |
102 | . info short: ${:U" "} | 102 | . info short: ${:U" "} | |
103 | . info long: ${:U" "} | 103 | . info long: ${:U" "} | |
104 | make: "directive-for-escape.mk" line 227: short: " " | 104 | make: "directive-for-escape.mk" line 227: short: " " | |
105 | make: "directive-for-escape.mk" line 228: long: " " | 105 | make: "directive-for-escape.mk" line 228: long: " " | |
106 | For: end for 1 | 106 | For: end for 1 | |
107 | For: loop body with i = " | 107 | For: loop body with i = " | |
108 | ": | 108 | ": | |
109 | Parsing line 244: .for i in "${.newline}" | |||
109 | For: end for 1 | 110 | For: end for 1 | |
110 | Parse_PushInput: .for loop in directive-for-escape.mk, line 244 | 111 | Parse_PushInput: .for loop in directive-for-escape.mk, line 244 | |
111 | make: "directive-for-escape.mk" line 244: newline in .for value | 112 | make: "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 | " | |
114 | For: loop body with i = " | 115 | For: loop body with i = " | |
115 | ": | 116 | ": | |
116 | : ${:U" "} | 117 | : ${:U" "} | |
117 | SetFilenameVars: ${.PARSEDIR} = <some-dir> ${.PARSEFILE} = `directive-for-escape.mk' | 118 | SetFilenameVars: ${.PARSEDIR} = <some-dir> ${.PARSEFILE} = `directive-for-escape.mk' | |
118 | Parsing line 245: : ${:U" "} | 119 | Parsing line 245: : ${:U" "} | |
119 | ParseDependency(: " ") | 120 | ParseDependency(: " ") | |
120 | ParseEOF: returning to file directive-for-escape.mk, line 247 | 121 | ParseEOF: returning to file directive-for-escape.mk, line 247 | |
121 | SetFilenameVars: ${.PARSEDIR} = <some-dir> ${.PARSEFILE} = `directive-for-escape.mk' | 122 | SetFilenameVars: ${.PARSEDIR} = <some-dir> ${.PARSEFILE} = `directive-for-escape.mk' |
--- 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 @@ | |||
1 | make: "var-eval-short.mk" line 46: In the :@ modifier of "", the variable name "${FAIL}" must not contain a dollar | 1 | make: "var-eval-short.mk" line 46: In the :@ modifier of "", the variable name "${FAIL}" must not contain a dollar | |
2 | make: "var-eval-short.mk" line 46: Malformed conditional (0 && ${:Uword:@${FAIL}@expr@}) | 2 | make: "var-eval-short.mk" line 46: Malformed conditional (0 && ${:Uword:@${FAIL}@expr@}) | |
3 | Parsing line 159: .if 0 && ${0:?${FAIL}then:${FAIL}else} | |||
3 | CondParser_Eval: 0 && ${0:?${FAIL}then:${FAIL}else} | 4 | CondParser_Eval: 0 && ${0:?${FAIL}then:${FAIL}else} | |
4 | Var_Parse: ${0:?${FAIL}then:${FAIL}else} (parse-only) | 5 | Var_Parse: ${0:?${FAIL}then:${FAIL}else} (parse-only) | |
5 | Parsing modifier ${0:?...} | 6 | Parsing modifier ${0:?...} | |
6 | Var_Parse: ${FAIL}then:${FAIL}else} (parse-only) | 7 | Var_Parse: ${FAIL}then:${FAIL}else} (parse-only) | |
7 | Modifier part: "${FAIL}then" | 8 | Modifier part: "${FAIL}then" | |
8 | Var_Parse: ${FAIL}else} (parse-only) | 9 | Var_Parse: ${FAIL}else} (parse-only) | |
9 | Modifier part: "${FAIL}else" | 10 | Modifier part: "${FAIL}else" | |
10 | Result of ${0:?${FAIL}then:${FAIL}else} is "" (parse-only, defined) | 11 | Result of ${0:?${FAIL}then:${FAIL}else} is "" (parse-only, defined) | |
11 | Parsing line 167: DEFINED= defined | 12 | Parsing line 167: DEFINED= defined | |
12 | Global: DEFINED = defined | 13 | Global: DEFINED = defined | |
14 | Parsing line 168: .if 0 && ${DEFINED:L:?${FAIL}then:${FAIL}else} | |||
13 | CondParser_Eval: 0 && ${DEFINED:L:?${FAIL}then:${FAIL}else} | 15 | CondParser_Eval: 0 && ${DEFINED:L:?${FAIL}then:${FAIL}else} | |
14 | Var_Parse: ${DEFINED:L:?${FAIL}then:${FAIL}else} (parse-only) | 16 | Var_Parse: ${DEFINED:L:?${FAIL}then:${FAIL}else} (parse-only) | |
15 | Parsing modifier ${DEFINED:L} | 17 | Parsing modifier ${DEFINED:L} | |
16 | Result of ${DEFINED:L} is "defined" (parse-only, regular) | 18 | Result of ${DEFINED:L} is "defined" (parse-only, regular) | |
17 | Parsing modifier ${DEFINED:?...} | 19 | Parsing modifier ${DEFINED:?...} | |
18 | Var_Parse: ${FAIL}then:${FAIL}else} (parse-only) | 20 | Var_Parse: ${FAIL}then:${FAIL}else} (parse-only) | |
19 | Modifier part: "${FAIL}then" | 21 | Modifier part: "${FAIL}then" | |
20 | Var_Parse: ${FAIL}else} (parse-only) | 22 | Var_Parse: ${FAIL}else} (parse-only) | |
21 | Modifier part: "${FAIL}else" | 23 | Modifier part: "${FAIL}else" | |
22 | Result of ${DEFINED:?${FAIL}then:${FAIL}else} is "defined" (parse-only, regular) | 24 | Result of ${DEFINED:?${FAIL}then:${FAIL}else} is "defined" (parse-only, regular) | |
23 | Parsing line 170: .MAKEFLAGS: -d0 | 25 | Parsing line 170: .MAKEFLAGS: -d0 | |
24 | ParseDependency(.MAKEFLAGS: -d0) | 26 | ParseDependency(.MAKEFLAGS: -d0) | |
25 | Global: .MAKEFLAGS = -r -k -d cpv -d | 27 | Global: .MAKEFLAGS = -r -k -d cpv -d |
--- 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 @@ | |||
1 | Parsing line 16: .for var in value | |||
1 | Parse_PushInput: .for loop in opt-debug-parse.mk, line 16 | 2 | Parse_PushInput: .for loop in opt-debug-parse.mk, line 16 | |
2 | SetFilenameVars: ${.PARSEDIR} = <some-dir> ${.PARSEFILE} = `opt-debug-parse.mk' | 3 | SetFilenameVars: ${.PARSEDIR} = <some-dir> ${.PARSEFILE} = `opt-debug-parse.mk' | |
3 | Parsing line 21: .info trace with multi-line .for loop head | 4 | Parsing line 21: .info trace with multi-line .for loop head | |
4 | make: "opt-debug-parse.mk" line 21: trace with multi-line .for loop head | 5 | make: "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 | |
6 | ParseEOF: returning to file opt-debug-parse.mk, line 23 | 7 | ParseEOF: returning to file opt-debug-parse.mk, line 23 | |
7 | SetFilenameVars: ${.PARSEDIR} = <some-dir> ${.PARSEFILE} = `opt-debug-parse.mk' | 8 | SetFilenameVars: ${.PARSEDIR} = <some-dir> ${.PARSEFILE} = `opt-debug-parse.mk' | |
8 | Parsing line 26: .include "/dev/null" | 9 | Parsing line 26: .include "/dev/null" | |
9 | Parse_PushInput: file /dev/null, line 1 | 10 | Parse_PushInput: file /dev/null, line 1 | |
10 | SetFilenameVars: ${.PARSEDIR} = <some-dir> ${.PARSEFILE} = `null' | 11 | SetFilenameVars: ${.PARSEDIR} = <some-dir> ${.PARSEFILE} = `null' | |
11 | SetFilenameVars: ${.INCLUDEDFROMDIR} = <some-dir> ${.INCLUDEDFROMFILE} = `opt-debug-parse.mk' | 12 | SetFilenameVars: ${.INCLUDEDFROMDIR} = <some-dir> ${.INCLUDEDFROMFILE} = `opt-debug-parse.mk' | |
12 | ParseEOF: returning to file opt-debug-parse.mk, line 27 | 13 | ParseEOF: returning to file opt-debug-parse.mk, line 27 | |
13 | SetFilenameVars: ${.PARSEDIR} = <some-dir> ${.PARSEFILE} = `opt-debug-parse.mk' | 14 | SetFilenameVars: ${.PARSEDIR} = <some-dir> ${.PARSEFILE} = `opt-debug-parse.mk' | |
15 | Parsing line 31: .for a b c in 1 2 3 ${:U4 5 6} | |||
14 | Parse_PushInput: .for loop in opt-debug-parse.mk, line 31 | 16 | Parse_PushInput: .for loop in opt-debug-parse.mk, line 31 | |
15 | SetFilenameVars: ${.PARSEDIR} = <some-dir> ${.PARSEFILE} = `opt-debug-parse.mk' | 17 | SetFilenameVars: ${.PARSEDIR} = <some-dir> ${.PARSEFILE} = `opt-debug-parse.mk' | |
16 | Parsing line 34: .info trace | 18 | Parsing line 34: .info trace | |
17 | make: "opt-debug-parse.mk" line 34: trace | 19 | make: "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 | |
19 | Parsing line 34: .info trace | 21 | Parsing line 34: .info trace | |
20 | make: "opt-debug-parse.mk" line 34: trace | 22 | make: "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 | |
22 | ParseEOF: returning to file opt-debug-parse.mk, line 36 | 24 | ParseEOF: returning to file opt-debug-parse.mk, line 36 | |
23 | SetFilenameVars: ${.PARSEDIR} = <some-dir> ${.PARSEFILE} = `opt-debug-parse.mk' | 25 | SetFilenameVars: ${.PARSEDIR} = <some-dir> ${.PARSEFILE} = `opt-debug-parse.mk' | |
24 | Parsing line 38: .MAKEFLAGS: -d0 | 26 | Parsing line 38: .MAKEFLAGS: -d0 | |
25 | ParseDependency(.MAKEFLAGS: -d0) | 27 | ParseDependency(.MAKEFLAGS: -d0) | |
26 | exit status 0 | 28 | exit status 0 |
--- 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 @@ | |||
1 | Parsing line 91: USE_8_DOLLARS= ${:U1:@var@${8_DOLLARS}@} ${8_DOLLARS} $$$$$$$$ | 1 | Parsing line 91: USE_8_DOLLARS= ${:U1:@var@${8_DOLLARS}@} ${8_DOLLARS} $$$$$$$$ | |
2 | Parsing line 92: .if ${USE_8_DOLLARS} != "\$\$\$\$ \$\$\$\$ \$\$\$\$" | |||
2 | CondParser_Eval: ${USE_8_DOLLARS} != "\$\$\$\$ \$\$\$\$ \$\$\$\$" | 3 | CondParser_Eval: ${USE_8_DOLLARS} != "\$\$\$\$ \$\$\$\$ \$\$\$\$" | |
3 | Comparing "$$$$ $$$$ $$$$" != "$$$$ $$$$ $$$$" | 4 | Comparing "$$$$ $$$$ $$$$" != "$$$$ $$$$ $$$$" | |
4 | Parsing line 96: SUBST_CONTAINING_LOOP:= ${USE_8_DOLLARS} | 5 | Parsing line 96: SUBST_CONTAINING_LOOP:= ${USE_8_DOLLARS} | |
6 | Parsing line 118: .if ${SUBST_CONTAINING_LOOP} != "\$\$ \$\$\$\$ \$\$\$\$" | |||
5 | CondParser_Eval: ${SUBST_CONTAINING_LOOP} != "\$\$ \$\$\$\$ \$\$\$\$" | 7 | CondParser_Eval: ${SUBST_CONTAINING_LOOP} != "\$\$ \$\$\$\$ \$\$\$\$" | |
6 | Comparing "$$ $$$$ $$$$" != "$$ $$$$ $$$$" | 8 | Comparing "$$ $$$$ $$$$" != "$$ $$$$ $$$$" | |
7 | Parsing line 121: .MAKEFLAGS: -d0 | 9 | Parsing line 121: .MAKEFLAGS: -d0 | |
8 | ParseDependency(.MAKEFLAGS: -d0) | 10 | ParseDependency(.MAKEFLAGS: -d0) | |
9 | :varname-overwriting-target: :x1y x2y x3y: :: | 11 | :varname-overwriting-target: :x1y x2y x3y: :: | |
10 | mod-loop-dollar:1: | 12 | mod-loop-dollar:1: | |
11 | mod-loop-dollar:${word}$: | 13 | mod-loop-dollar:${word}$: | |
12 | mod-loop-dollar:$3$: | 14 | mod-loop-dollar:$3$: | |
13 | mod-loop-dollar:$${word}$$: | 15 | mod-loop-dollar:$${word}$$: | |
14 | mod-loop-dollar:$$5$$: | 16 | mod-loop-dollar:$$5$$: | |
15 | mod-loop-dollar:$$${word}$$$: | 17 | mod-loop-dollar:$$${word}$$$: | |
16 | : t=$(( ${t:-0} + 1 )) | 18 | : t=$(( ${t:-0} + 1 )) | |
17 | : dollar=end | 19 | : dollar=end |
--- 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 @@ | |||
1 | Parsing line 10: ORIG_SHELL:= ${.SHELL} | 1 | Parsing line 10: ORIG_SHELL:= ${.SHELL} | |
2 | Global: ORIG_SHELL = # (empty) | 2 | Global: ORIG_SHELL = # (empty) | |
3 | Var_Parse: ${.SHELL} (eval-keep-dollar-and-undefined) | 3 | Var_Parse: ${.SHELL} (eval-keep-dollar-and-undefined) | |
4 | Global: ignoring delete '.SHELL' as it is not found | 4 | Global: ignoring delete '.SHELL' as it is not found | |
5 | Command: .SHELL = (details omitted) | 5 | Command: .SHELL = (details omitted) | |
6 | Global: ORIG_SHELL = (details omitted) | 6 | Global: ORIG_SHELL = (details omitted) | |
7 | Parsing line 12: .SHELL= overwritten | 7 | Parsing line 12: .SHELL= overwritten | |
8 | Global: ignoring '.SHELL = overwritten' due to a command line variable of the same name | 8 | Global: ignoring '.SHELL = overwritten' due to a command line variable of the same name | |
9 | Parsing line 13: .if ${.SHELL} != ${ORIG_SHELL} | |||
9 | CondParser_Eval: ${.SHELL} != ${ORIG_SHELL} | 10 | CondParser_Eval: ${.SHELL} != ${ORIG_SHELL} | |
10 | Var_Parse: ${.SHELL} != ${ORIG_SHELL} (eval-defined) | 11 | Var_Parse: ${.SHELL} != ${ORIG_SHELL} (eval-defined) | |
11 | Var_Parse: ${ORIG_SHELL} (eval-defined) | 12 | Var_Parse: ${ORIG_SHELL} (eval-defined) | |
12 | Comparing "(details omitted)" != "(details omitted)" | 13 | Comparing "(details omitted)" != "(details omitted)" | |
13 | Parsing line 19: .MAKEFLAGS: .SHELL+=appended | 14 | Parsing line 19: .MAKEFLAGS: .SHELL+=appended | |
14 | ParseDependency(.MAKEFLAGS: .SHELL+=appended) | 15 | ParseDependency(.MAKEFLAGS: .SHELL+=appended) | |
15 | Command: ignoring '.SHELL += appended' as it is read-only | 16 | Command: ignoring '.SHELL += appended' as it is read-only | |
17 | Parsing line 20: .if ${.SHELL} != ${ORIG_SHELL} | |||
16 | CondParser_Eval: ${.SHELL} != ${ORIG_SHELL} | 18 | CondParser_Eval: ${.SHELL} != ${ORIG_SHELL} | |
17 | Var_Parse: ${.SHELL} != ${ORIG_SHELL} (eval-defined) | 19 | Var_Parse: ${.SHELL} != ${ORIG_SHELL} (eval-defined) | |
18 | Var_Parse: ${ORIG_SHELL} (eval-defined) | 20 | Var_Parse: ${ORIG_SHELL} (eval-defined) | |
19 | Comparing "(details omitted)" != "(details omitted)" | 21 | Comparing "(details omitted)" != "(details omitted)" | |
20 | Parsing line 27: .undef .SHELL | 22 | Parsing line 27: .undef .SHELL | |
21 | Global: ignoring delete '.SHELL' as it is not found | 23 | Global: ignoring delete '.SHELL' as it is not found | |
22 | Parsing line 28: .SHELL= newly overwritten | 24 | Parsing line 28: .SHELL= newly overwritten | |
23 | Global: ignoring '.SHELL = newly overwritten' due to a command line variable of the same name | 25 | Global: ignoring '.SHELL = newly overwritten' due to a command line variable of the same name | |
26 | Parsing line 29: .if ${.SHELL} != ${ORIG_SHELL} | |||
24 | CondParser_Eval: ${.SHELL} != ${ORIG_SHELL} | 27 | CondParser_Eval: ${.SHELL} != ${ORIG_SHELL} | |
25 | Var_Parse: ${.SHELL} != ${ORIG_SHELL} (eval-defined) | 28 | Var_Parse: ${.SHELL} != ${ORIG_SHELL} (eval-defined) | |
26 | Var_Parse: ${ORIG_SHELL} (eval-defined) | 29 | Var_Parse: ${ORIG_SHELL} (eval-defined) | |
27 | Comparing "(details omitted)" != "(details omitted)" | 30 | Comparing "(details omitted)" != "(details omitted)" | |
28 | Parsing line 33: .MAKEFLAGS: -d0 | 31 | Parsing line 33: .MAKEFLAGS: -d0 | |
29 | ParseDependency(.MAKEFLAGS: -d0) | 32 | ParseDependency(.MAKEFLAGS: -d0) | |
30 | Global: .MAKEFLAGS = -r -k -d cpv -d | 33 | Global: .MAKEFLAGS = -r -k -d cpv -d | |
31 | Global: .MAKEFLAGS = -r -k -d cpv -d 0 | 34 | Global: .MAKEFLAGS = -r -k -d cpv -d 0 | |
32 | exit status 0 | 35 | exit status 0 |