Module Name: src Committed By: rillig Date: Thu Mar 3 19:36:35 UTC 2022
Modified Files: src/usr.bin/make: cond.c src/usr.bin/make/unit-tests: cond-cmp-numeric.exp cond-token-plain.exp deptgt-makeflags.exp directive-export-impl.exp directive-include.exp opt-debug-cond.exp opt-debug-file.exp varmod-ifelse.exp varmod-loop.exp varmod-match-escape.exp varmod-match.exp varname-dot-shell.exp Log Message: make: make debug logging for comparisons less technical To generate a diff of this commit: cvs rdiff -u -r1.330 -r1.331 src/usr.bin/make/cond.c cvs rdiff -u -r1.6 -r1.7 src/usr.bin/make/unit-tests/cond-cmp-numeric.exp cvs rdiff -u -r1.15 -r1.16 src/usr.bin/make/unit-tests/cond-token-plain.exp \ src/usr.bin/make/unit-tests/varmod-match-escape.exp cvs rdiff -u -r1.5 -r1.6 src/usr.bin/make/unit-tests/deptgt-makeflags.exp \ src/usr.bin/make/unit-tests/opt-debug-file.exp cvs rdiff -u -r1.16 -r1.17 \ src/usr.bin/make/unit-tests/directive-export-impl.exp cvs rdiff -u -r1.8 -r1.9 src/usr.bin/make/unit-tests/directive-include.exp cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/unit-tests/opt-debug-cond.exp cvs rdiff -u -r1.11 -r1.12 src/usr.bin/make/unit-tests/varmod-ifelse.exp cvs rdiff -u -r1.14 -r1.15 src/usr.bin/make/unit-tests/varmod-loop.exp cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/unit-tests/varmod-match.exp cvs rdiff -u -r1.13 -r1.14 src/usr.bin/make/unit-tests/varname-dot-shell.exp 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/cond.c diff -u src/usr.bin/make/cond.c:1.330 src/usr.bin/make/cond.c:1.331 --- src/usr.bin/make/cond.c:1.330 Fri Feb 11 21:18:09 2022 +++ src/usr.bin/make/cond.c Thu Mar 3 19:36:35 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: cond.c,v 1.330 2022/02/11 21:18:09 rillig Exp $ */ +/* $NetBSD: cond.c,v 1.331 2022/03/03 19:36:35 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -95,7 +95,7 @@ #include "dir.h" /* "@(#)cond.c 8.2 (Berkeley) 1/2/94" */ -MAKE_RCSID("$NetBSD: cond.c,v 1.330 2022/02/11 21:18:09 rillig Exp $"); +MAKE_RCSID("$NetBSD: cond.c,v 1.331 2022/03/03 19:36:35 rillig Exp $"); /* * Conditional expressions conform to this grammar: @@ -557,7 +557,7 @@ EvalNotEmpty(CondParser *par, const char static bool EvalCompareNum(double lhs, ComparisonOp op, double rhs) { - DEBUG3(COND, "lhs = %f, rhs = %f, op = %.2s\n", lhs, rhs, opname[op]); + DEBUG3(COND, "Comparing %f %s %f\n", lhs, opname[op], rhs); switch (op) { case LT: @@ -586,8 +586,7 @@ EvalCompareStr(CondParser *par, const ch return TOK_ERROR; } - DEBUG3(COND, "lhs = \"%s\", rhs = \"%s\", op = %.2s\n", - lhs, rhs, opname[op]); + DEBUG3(COND, "Comparing \"%s\" %s \"%s\"\n", lhs, opname[op], rhs); return ToToken((op == EQ) == (strcmp(lhs, rhs) == 0)); } Index: src/usr.bin/make/unit-tests/cond-cmp-numeric.exp diff -u src/usr.bin/make/unit-tests/cond-cmp-numeric.exp:1.6 src/usr.bin/make/unit-tests/cond-cmp-numeric.exp:1.7 --- src/usr.bin/make/unit-tests/cond-cmp-numeric.exp:1.6 Thu Jul 29 06:31:18 2021 +++ src/usr.bin/make/unit-tests/cond-cmp-numeric.exp Thu Mar 3 19:36:35 2022 @@ -3,11 +3,11 @@ make: "cond-cmp-numeric.mk" line 11: Str CondParser_Eval: ${:UNaN} > NaN make: "cond-cmp-numeric.mk" line 16: String comparison operator must be either == or != CondParser_Eval: !(${:UNaN} == NaN) -lhs = "NaN", rhs = "NaN", op = == +Comparing "NaN" == "NaN" CondParser_Eval: 123 ! 123 make: "cond-cmp-numeric.mk" line 34: Malformed conditional (123 ! 123) CondParser_Eval: ${:U 123} < 124 -lhs = 123.000000, rhs = 124.000000, op = < +Comparing 123.000000 < 124.000000 CondParser_Eval: ${:U123 } < 124 make: "cond-cmp-numeric.mk" line 50: String comparison operator must be either == or != make: Fatal errors encountered -- cannot continue Index: src/usr.bin/make/unit-tests/cond-token-plain.exp diff -u src/usr.bin/make/unit-tests/cond-token-plain.exp:1.15 src/usr.bin/make/unit-tests/cond-token-plain.exp:1.16 --- src/usr.bin/make/unit-tests/cond-token-plain.exp:1.15 Sat Jan 8 20:21:34 2022 +++ src/usr.bin/make/unit-tests/cond-token-plain.exp Thu Mar 3 19:36:35 2022 @@ -1,31 +1,31 @@ CondParser_Eval: ${:Uvalue} != value -lhs = "value", rhs = "value", op = != +Comparing "value" != "value" CondParser_Eval: ${:U} != " -lhs = "", rhs = "", op = != +Comparing "" != "" CondParser_Eval: ${:U#hash} != "#hash" -lhs = "#hash", rhs = "#hash", op = != +Comparing "#hash" != "#hash" CondParser_Eval: ${:U\\} != "\\ -lhs = "\", rhs = "\", op = != +Comparing "\" != "\" CondParser_Eval: ${:U#hash} != #hash -lhs = "#hash", rhs = "#hash", op = != +Comparing "#hash" != "#hash" CondParser_Eval: 0 # This is treated as a comment, but why? CondParser_Eval: ${0 # comment :?yes:no} != no CondParser_Eval: 0 # comment -lhs = "no", rhs = "no", op = != +Comparing "no" != "no" CondParser_Eval: ${1 # comment :?yes:no} != yes CondParser_Eval: 1 # comment -lhs = "yes", rhs = "yes", op = != +Comparing "yes" != "yes" CondParser_Eval: ${UNDEF:Uundefined}!=undefined -lhs = "undefined", rhs = "undefined", op = != +Comparing "undefined" != "undefined" CondParser_Eval: ${UNDEF:U12345}>12345 -lhs = 12345.000000, rhs = 12345.000000, op = > +Comparing 12345.000000 > 12345.000000 CondParser_Eval: ${UNDEF:U12345}<12345 -lhs = 12345.000000, rhs = 12345.000000, op = < +Comparing 12345.000000 < 12345.000000 CondParser_Eval: (${UNDEF:U0})||0 CondParser_Eval: ${:Uvar}&&name != "var&&name" -lhs = "var&&name", rhs = "var&&name", op = != +Comparing "var&&name" != "var&&name" CondParser_Eval: ${:Uvar}||name != "var||name" -lhs = "var||name", rhs = "var||name", op = != +Comparing "var||name" != "var||name" CondParser_Eval: bare make: "cond-token-plain.mk" line 105: A bare word is treated like defined(...), and the variable 'bare' is not defined. CondParser_Eval: VAR @@ -47,7 +47,7 @@ make: "cond-token-plain.mk" line 167: Th CondParser_Eval: \\ make: "cond-token-plain.mk" line 172: Now the variable '\\' is defined. CondParser_Eval: "unquoted\"quoted" != unquoted"quoted -lhs = "unquoted"quoted", rhs = "unquoted"quoted", op = != +Comparing "unquoted"quoted" != "unquoted"quoted" CondParser_Eval: $$$$$$$$ != "" CondParser_Eval: left == right make: "cond-token-plain.mk" line 195: Malformed conditional (left == right) Index: src/usr.bin/make/unit-tests/varmod-match-escape.exp diff -u src/usr.bin/make/unit-tests/varmod-match-escape.exp:1.15 src/usr.bin/make/unit-tests/varmod-match-escape.exp:1.16 --- src/usr.bin/make/unit-tests/varmod-match-escape.exp:1.15 Sat Apr 10 22:09:54 2021 +++ src/usr.bin/make/unit-tests/varmod-match-escape.exp Thu Mar 3 19:36:35 2022 @@ -10,7 +10,7 @@ Evaluating modifier ${SPECIALS:M...} on Pattern for ':M' is ":" ModifyWords: split "\: : \\ * \*" into 5 words Result of ${SPECIALS:M\:${:U}} is ":" -lhs = ":", rhs = ":", op = != +Comparing ":" != ":" Global: VALUES = : :: :\: CondParser_Eval: ${VALUES:M\:${:U\:}} != ${VALUES:M${:U\:}\:} Var_Parse: ${VALUES:M\:${:U\:}} != ${VALUES:M${:U\:}\:} (eval-defined) @@ -29,7 +29,7 @@ Result of ${:U\:} is ":" (eval-defined, Pattern for ':M' is ":\:" ModifyWords: split ": :: :\:" into 3 words Result of ${VALUES:M${:U\:}\:} is "::" -lhs = ":", rhs = "::", op = != +Comparing ":" != "::" make: "varmod-match-escape.mk" line 42: warning: XXX: Oops Global: .MAKEFLAGS = -r -k -d cv -d Global: .MAKEFLAGS = -r -k -d cv -d 0 Index: src/usr.bin/make/unit-tests/deptgt-makeflags.exp diff -u src/usr.bin/make/unit-tests/deptgt-makeflags.exp:1.5 src/usr.bin/make/unit-tests/deptgt-makeflags.exp:1.6 --- src/usr.bin/make/unit-tests/deptgt-makeflags.exp:1.5 Mon Apr 5 13:35:41 2021 +++ src/usr.bin/make/unit-tests/deptgt-makeflags.exp Thu Mar 3 19:36:35 2022 @@ -3,7 +3,7 @@ Command: DOLLAR = $$$$ Global: .MAKEOVERRIDES = VAR DOLLAR CondParser_Eval: ${DOLLAR} != "\$\$" Var_Parse: ${DOLLAR} != "\$\$" (eval-defined) -lhs = "$$", rhs = "$$", op = != +Comparing "$$" != "$$" Global: .MAKEFLAGS = -r -k -D VAR -D VAR -d cv -d Global: .MAKEFLAGS = -r -k -D VAR -D VAR -d cv -d 0 make: Unterminated quoted string [make VAR=initial UNBALANCED='] Index: src/usr.bin/make/unit-tests/opt-debug-file.exp diff -u src/usr.bin/make/unit-tests/opt-debug-file.exp:1.5 src/usr.bin/make/unit-tests/opt-debug-file.exp:1.6 --- src/usr.bin/make/unit-tests/opt-debug-file.exp:1.5 Tue Jan 11 19:47:34 2022 +++ src/usr.bin/make/unit-tests/opt-debug-file.exp Thu Mar 3 19:36:35 2022 @@ -2,11 +2,11 @@ make: "opt-debug-file.mk" line 43: This make: "opt-debug-file.mk" line 45: This goes to stderr only, once. make: "opt-debug-file.mk" line 47: This goes to stderr, and in addition to the debug log. CondParser_Eval: ${:!cat opt-debug-file.debuglog!:Maddition:[#]} != 1 -lhs = 1.000000, rhs = 1.000000, op = != +Comparing 1.000000 != 1.000000 make: Missing delimiter for modifier ':S' make: Missing delimiter for modifier ':S' make: Missing delimiter for modifier ':S' CondParser_Eval: ${:!cat opt-debug-file.debuglog!:Mdelimiter:[#]} != 1 -lhs = 1.000000, rhs = 1.000000, op = != +Comparing 1.000000 != 1.000000 Cannot open debug file "/nonexistent-6f21c672-a22d-4ef7/opt-debug-file.debuglog" exit status 2 Index: src/usr.bin/make/unit-tests/directive-export-impl.exp diff -u src/usr.bin/make/unit-tests/directive-export-impl.exp:1.16 src/usr.bin/make/unit-tests/directive-export-impl.exp:1.17 --- src/usr.bin/make/unit-tests/directive-export-impl.exp:1.16 Mon Jan 10 20:32:29 2022 +++ src/usr.bin/make/unit-tests/directive-export-impl.exp Thu Mar 3 19:36:35 2022 @@ -23,7 +23,7 @@ Result of ${.MAKE.EXPORTED:u} is "UT_VAR Var_Parse: ${UT_VAR} (eval) Var_Parse: ${REF}> (eval) Result of ${:!echo "\$UT_VAR"!} is "<>" (eval-defined, defined) -lhs = "<>", rhs = "<>", op = != +Comparing "<>" != "<>" Parsing line 50: : ${UT_VAR:N*} Var_Parse: ${UT_VAR:N*} (eval-defined) Var_Parse: ${REF}> (eval-defined) @@ -47,7 +47,7 @@ Result of ${.MAKE.EXPORTED:u} is "UT_VAR Var_Parse: ${UT_VAR} (eval) Var_Parse: ${REF}> (eval) Result of ${:!echo "\$UT_VAR"!} is "<defined>" (eval-defined, defined) -lhs = "<defined>", rhs = "<defined>", op = != +Comparing "<defined>" != "<defined>" Parsing line 62: all: ParseDependency(all:) Global: .ALLTARGETS = all Index: src/usr.bin/make/unit-tests/directive-include.exp diff -u src/usr.bin/make/unit-tests/directive-include.exp:1.8 src/usr.bin/make/unit-tests/directive-include.exp:1.9 --- src/usr.bin/make/unit-tests/directive-include.exp:1.8 Tue Dec 14 01:00:04 2021 +++ src/usr.bin/make/unit-tests/directive-include.exp Thu Mar 3 19:36:35 2022 @@ -1,7 +1,7 @@ CondParser_Eval: ${.MAKE.MAKEFILES:T} != "${.PARSEFILE} null" -lhs = "directive-include.mk null", rhs = "directive-include.mk null", op = != +Comparing "directive-include.mk null" != "directive-include.mk null" CondParser_Eval: ${.MAKE.MAKEFILES:T} != "${.PARSEFILE} null" -lhs = "directive-include.mk null", rhs = "directive-include.mk null", op = != +Comparing "directive-include.mk null" != "directive-include.mk null" make: "directive-include.mk" line 25: Could not find nonexistent.mk make: "directive-include.mk" line 47: Could not find " make: "directive-include.mk" line 52: Unknown modifier "Z" Index: src/usr.bin/make/unit-tests/opt-debug-cond.exp diff -u src/usr.bin/make/unit-tests/opt-debug-cond.exp:1.2 src/usr.bin/make/unit-tests/opt-debug-cond.exp:1.3 --- src/usr.bin/make/unit-tests/opt-debug-cond.exp:1.2 Sun Jan 23 16:09:38 2022 +++ src/usr.bin/make/unit-tests/opt-debug-cond.exp Thu Mar 3 19:36:35 2022 @@ -1,6 +1,6 @@ CondParser_Eval: ${:U12345} > ${:U55555} -lhs = 12345.000000, rhs = 55555.000000, op = > +Comparing 12345.000000 > 55555.000000 CondParser_Eval: "string" != "string" -lhs = "string", rhs = "string", op = != +Comparing "string" != "string" CondParser_Eval: "nonempty" exit status 0 Index: src/usr.bin/make/unit-tests/varmod-ifelse.exp diff -u src/usr.bin/make/unit-tests/varmod-ifelse.exp:1.11 src/usr.bin/make/unit-tests/varmod-ifelse.exp:1.12 --- src/usr.bin/make/unit-tests/varmod-ifelse.exp:1.11 Fri Jun 11 13:01:28 2021 +++ src/usr.bin/make/unit-tests/varmod-ifelse.exp Thu Mar 3 19:36:35 2022 @@ -7,14 +7,14 @@ make: Bad conditional expression '1 == = make: "varmod-ifelse.mk" line 66: Malformed conditional (${1 == == 2:?yes:no} != "") CondParser_Eval: "${1 == == 2:?yes:no}" != "" CondParser_Eval: 1 == == 2 -lhs = 1.000000, rhs = 0.000000, op = == +Comparing 1.000000 == 0.000000 make: Bad conditional expression '1 == == 2' in '1 == == 2?yes:no' -lhs = "", rhs = "", op = != +Comparing "" != "" make: "varmod-ifelse.mk" line 92: warning: Oops, the parse error should have been propagated. CondParser_Eval: ${ ${:U\$}{VAR} == value :?ok:bad} != "ok" CondParser_Eval: ${VAR} == value -lhs = "value", rhs = "value", op = == -lhs = "ok", rhs = "ok", op = != +Comparing "value" == "value" +Comparing "ok" != "ok" make: "varmod-ifelse.mk" line 153: no. make: "varmod-ifelse.mk" line 154: String comparison operator must be either == or != make: Bad conditional expression 'string == "literal" || no >= 10' in 'string == "literal" || no >= 10?yes:no' Index: src/usr.bin/make/unit-tests/varmod-loop.exp diff -u src/usr.bin/make/unit-tests/varmod-loop.exp:1.14 src/usr.bin/make/unit-tests/varmod-loop.exp:1.15 --- src/usr.bin/make/unit-tests/varmod-loop.exp:1.14 Tue Dec 28 15:49:00 2021 +++ src/usr.bin/make/unit-tests/varmod-loop.exp Thu Mar 3 19:36:35 2022 @@ -1,9 +1,9 @@ Parsing line 78: USE_8_DOLLARS= ${:U1:@var@${8_DOLLARS}@} ${8_DOLLARS} $$$$$$$$ CondParser_Eval: ${USE_8_DOLLARS} != "\$\$\$\$ \$\$\$\$ \$\$\$\$" -lhs = "$$$$ $$$$ $$$$", rhs = "$$$$ $$$$ $$$$", op = != +Comparing "$$$$ $$$$ $$$$" != "$$$$ $$$$ $$$$" Parsing line 83: SUBST_CONTAINING_LOOP:= ${USE_8_DOLLARS} CondParser_Eval: ${SUBST_CONTAINING_LOOP} != "\$\$ \$\$\$\$ \$\$\$\$" -lhs = "$$ $$$$ $$$$", rhs = "$$ $$$$ $$$$", op = != +Comparing "$$ $$$$ $$$$" != "$$ $$$$ $$$$" Parsing line 108: .MAKEFLAGS: -d0 ParseDependency(.MAKEFLAGS: -d0) :varname-overwriting-target: :x1y x2y x3y: :: Index: src/usr.bin/make/unit-tests/varmod-match.exp diff -u src/usr.bin/make/unit-tests/varmod-match.exp:1.3 src/usr.bin/make/unit-tests/varmod-match.exp:1.4 --- src/usr.bin/make/unit-tests/varmod-match.exp:1.3 Sat Sep 12 22:35:43 2020 +++ src/usr.bin/make/unit-tests/varmod-match.exp Thu Mar 3 19:36:35 2022 @@ -1,12 +1,12 @@ CondParser_Eval: ${NUMBERS:M[A-Z]*} != "One Two Three Four" -lhs = "One Two Three Four", rhs = "One Two Three Four", op = != +Comparing "One Two Three Four" != "One Two Three Four" CondParser_Eval: ${NUMBERS:M[^A-Z]*} != "five six seven" -lhs = "five six seven", rhs = "five six seven", op = != +Comparing "five six seven" != "five six seven" CondParser_Eval: ${NUMBERS:M[^s]*[ex]} != "One Three five" -lhs = "One Three five", rhs = "One Three five", op = != +Comparing "One Three five" != "One Three five" CondParser_Eval: ${:U****************:M****************b} CondParser_Eval: ${:Ua \$ sign:M*$$*} != "\$" -lhs = "$", rhs = "$", op = != +Comparing "$" != "$" CondParser_Eval: ${:Ua \$ sign any-asterisk:M*\$*} != "any-asterisk" -lhs = "any-asterisk", rhs = "any-asterisk", op = != +Comparing "any-asterisk" != "any-asterisk" exit status 0 Index: src/usr.bin/make/unit-tests/varname-dot-shell.exp diff -u src/usr.bin/make/unit-tests/varname-dot-shell.exp:1.13 src/usr.bin/make/unit-tests/varname-dot-shell.exp:1.14 --- src/usr.bin/make/unit-tests/varname-dot-shell.exp:1.13 Tue Dec 28 15:49:00 2021 +++ src/usr.bin/make/unit-tests/varname-dot-shell.exp Thu Mar 3 19:36:35 2022 @@ -9,14 +9,14 @@ Global: .SHELL = overwritten CondParser_Eval: ${.SHELL} != ${ORIG_SHELL} Var_Parse: ${.SHELL} != ${ORIG_SHELL} (eval-defined) Var_Parse: ${ORIG_SHELL} (eval-defined) -lhs = "(details omitted)", rhs = "(details omitted)", op = != +Comparing "(details omitted)" != "(details omitted)" Parsing line 19: .MAKEFLAGS: .SHELL+=appended ParseDependency(.MAKEFLAGS: .SHELL+=appended) Ignoring append to .SHELL since it is read-only CondParser_Eval: ${.SHELL} != ${ORIG_SHELL} Var_Parse: ${.SHELL} != ${ORIG_SHELL} (eval-defined) Var_Parse: ${ORIG_SHELL} (eval-defined) -lhs = "(details omitted)", rhs = "(details omitted)", op = != +Comparing "(details omitted)" != "(details omitted)" Parsing line 27: .undef .SHELL Global:delete .SHELL Parsing line 28: .SHELL= newly overwritten @@ -24,7 +24,7 @@ Global: .SHELL = newly overwritten CondParser_Eval: ${.SHELL} != ${ORIG_SHELL} Var_Parse: ${.SHELL} != ${ORIG_SHELL} (eval-defined) Var_Parse: ${ORIG_SHELL} (eval-defined) -lhs = "(details omitted)", rhs = "(details omitted)", op = != +Comparing "(details omitted)" != "(details omitted)" Parsing line 33: .MAKEFLAGS: -d0 ParseDependency(.MAKEFLAGS: -d0) Global: .MAKEFLAGS = -r -k -d cpv -d