diff options
| author | rillig <rillig@NetBSD.org> | 2022-03-03 19:36:35 +0000 |
|---|---|---|
| committer | rillig <rillig@NetBSD.org> | 2022-03-03 19:36:35 +0000 |
| commit | 41d122915f0caccae9aab4fa6fb4e607d4cc8cfa (patch) | |
| tree | fc32ab667e472ec8a9c6d802ff6bb61e2ef4a984 /usr.bin/make | |
| parent | d68e31c597f1a50081d1e2575fadedb9120edd3e (diff) | |
make: make debug logging for comparisons less technical
Diffstat (limited to 'usr.bin/make')
| -rw-r--r-- | usr.bin/make/cond.c | 9 | ||||
| -rw-r--r-- | usr.bin/make/unit-tests/cond-cmp-numeric.exp | 4 | ||||
| -rw-r--r-- | usr.bin/make/unit-tests/cond-token-plain.exp | 26 | ||||
| -rw-r--r-- | usr.bin/make/unit-tests/deptgt-makeflags.exp | 2 | ||||
| -rw-r--r-- | usr.bin/make/unit-tests/directive-export-impl.exp | 4 | ||||
| -rw-r--r-- | usr.bin/make/unit-tests/directive-include.exp | 4 | ||||
| -rw-r--r-- | usr.bin/make/unit-tests/opt-debug-cond.exp | 4 | ||||
| -rw-r--r-- | usr.bin/make/unit-tests/opt-debug-file.exp | 4 | ||||
| -rw-r--r-- | usr.bin/make/unit-tests/varmod-ifelse.exp | 8 | ||||
| -rw-r--r-- | usr.bin/make/unit-tests/varmod-loop.exp | 4 | ||||
| -rw-r--r-- | usr.bin/make/unit-tests/varmod-match-escape.exp | 4 | ||||
| -rw-r--r-- | usr.bin/make/unit-tests/varmod-match.exp | 10 | ||||
| -rw-r--r-- | usr.bin/make/unit-tests/varname-dot-shell.exp | 6 |
13 files changed, 44 insertions, 45 deletions
diff --git a/usr.bin/make/cond.c b/usr.bin/make/cond.c index 107c66d6d3b..e354140a98e 100644 --- a/usr.bin/make/cond.c +++ b/usr.bin/make/cond.c @@ -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 *value, bool quoted) 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 char *lhs, 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)); } diff --git a/usr.bin/make/unit-tests/cond-cmp-numeric.exp b/usr.bin/make/unit-tests/cond-cmp-numeric.exp index d10262aa882..d913a44ff88 100644 --- a/usr.bin/make/unit-tests/cond-cmp-numeric.exp +++ b/usr.bin/make/unit-tests/cond-cmp-numeric.exp @@ -3,11 +3,11 @@ make: "cond-cmp-numeric.mk" line 11: String comparison operator must be either = 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 diff --git a/usr.bin/make/unit-tests/cond-token-plain.exp b/usr.bin/make/unit-tests/cond-token-plain.exp index b39e952bf3d..90da7644bd9 100644 --- a/usr.bin/make/unit-tests/cond-token-plain.exp +++ b/usr.bin/make/unit-tests/cond-token-plain.exp @@ -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: The variable '\\' is not defined. 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) diff --git a/usr.bin/make/unit-tests/deptgt-makeflags.exp b/usr.bin/make/unit-tests/deptgt-makeflags.exp index 11043bc5110..66b64ad5cca 100644 --- a/usr.bin/make/unit-tests/deptgt-makeflags.exp +++ b/usr.bin/make/unit-tests/deptgt-makeflags.exp @@ -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='] diff --git a/usr.bin/make/unit-tests/directive-export-impl.exp b/usr.bin/make/unit-tests/directive-export-impl.exp index 778d825996f..fada441f5e9 100644 --- a/usr.bin/make/unit-tests/directive-export-impl.exp +++ b/usr.bin/make/unit-tests/directive-export-impl.exp @@ -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 diff --git a/usr.bin/make/unit-tests/directive-include.exp b/usr.bin/make/unit-tests/directive-include.exp index 42975d444c3..0ddf40a75d2 100644 --- a/usr.bin/make/unit-tests/directive-include.exp +++ b/usr.bin/make/unit-tests/directive-include.exp @@ -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" diff --git a/usr.bin/make/unit-tests/opt-debug-cond.exp b/usr.bin/make/unit-tests/opt-debug-cond.exp index c2bd1e168bc..01f73a4cfad 100644 --- a/usr.bin/make/unit-tests/opt-debug-cond.exp +++ b/usr.bin/make/unit-tests/opt-debug-cond.exp @@ -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 diff --git a/usr.bin/make/unit-tests/opt-debug-file.exp b/usr.bin/make/unit-tests/opt-debug-file.exp index 8ff220b3f54..712686f60b3 100644 --- a/usr.bin/make/unit-tests/opt-debug-file.exp +++ b/usr.bin/make/unit-tests/opt-debug-file.exp @@ -2,11 +2,11 @@ make: "opt-debug-file.mk" line 43: This goes to stderr only, once. 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 diff --git a/usr.bin/make/unit-tests/varmod-ifelse.exp b/usr.bin/make/unit-tests/varmod-ifelse.exp index e42e39525f1..7134c71b8d3 100644 --- a/usr.bin/make/unit-tests/varmod-ifelse.exp +++ b/usr.bin/make/unit-tests/varmod-ifelse.exp @@ -7,14 +7,14 @@ make: Bad conditional expression '1 == == 2' in '1 == == 2?yes:no' 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' diff --git a/usr.bin/make/unit-tests/varmod-loop.exp b/usr.bin/make/unit-tests/varmod-loop.exp index 11a74e571a1..bbe0037673b 100644 --- a/usr.bin/make/unit-tests/varmod-loop.exp +++ b/usr.bin/make/unit-tests/varmod-loop.exp @@ -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: :: diff --git a/usr.bin/make/unit-tests/varmod-match-escape.exp b/usr.bin/make/unit-tests/varmod-match-escape.exp index 42cdd7a87ac..25cf6c0719d 100644 --- a/usr.bin/make/unit-tests/varmod-match-escape.exp +++ b/usr.bin/make/unit-tests/varmod-match-escape.exp @@ -10,7 +10,7 @@ Evaluating modifier ${SPECIALS:M...} on value "\: : \\ * \*" 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, 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 diff --git a/usr.bin/make/unit-tests/varmod-match.exp b/usr.bin/make/unit-tests/varmod-match.exp index 080e9e0f74d..9cfd5e74ac8 100644 --- a/usr.bin/make/unit-tests/varmod-match.exp +++ b/usr.bin/make/unit-tests/varmod-match.exp @@ -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 diff --git a/usr.bin/make/unit-tests/varname-dot-shell.exp b/usr.bin/make/unit-tests/varname-dot-shell.exp index 28516ab1ea8..8f5ae61c4d5 100644 --- a/usr.bin/make/unit-tests/varname-dot-shell.exp +++ b/usr.bin/make/unit-tests/varname-dot-shell.exp @@ -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 |
