Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/make make: make debug logging for comparisons less t...



details:   https://anonhg.NetBSD.org/src/rev/b171f77897cb
branches:  trunk
changeset: 362590:b171f77897cb
user:      rillig <rillig%NetBSD.org@localhost>
date:      Thu Mar 03 19:36:35 2022 +0000

description:
make: make debug logging for comparisons less technical

diffstat:

 usr.bin/make/cond.c                               |   9 +++----
 usr.bin/make/unit-tests/cond-cmp-numeric.exp      |   4 +-
 usr.bin/make/unit-tests/cond-token-plain.exp      |  26 +++++++++++-----------
 usr.bin/make/unit-tests/deptgt-makeflags.exp      |   2 +-
 usr.bin/make/unit-tests/directive-export-impl.exp |   4 +-
 usr.bin/make/unit-tests/directive-include.exp     |   4 +-
 usr.bin/make/unit-tests/opt-debug-cond.exp        |   4 +-
 usr.bin/make/unit-tests/opt-debug-file.exp        |   4 +-
 usr.bin/make/unit-tests/varmod-ifelse.exp         |   8 +++---
 usr.bin/make/unit-tests/varmod-loop.exp           |   4 +-
 usr.bin/make/unit-tests/varmod-match-escape.exp   |   4 +-
 usr.bin/make/unit-tests/varmod-match.exp          |  10 ++++----
 usr.bin/make/unit-tests/varname-dot-shell.exp     |   6 ++--
 13 files changed, 44 insertions(+), 45 deletions(-)

diffs (293 lines):

diff -r 3d8669299780 -r b171f77897cb usr.bin/make/cond.c
--- a/usr.bin/make/cond.c       Thu Mar 03 07:31:24 2022 +0000
+++ b/usr.bin/make/cond.c       Thu Mar 03 19:36:35 2022 +0000
@@ -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 @@
 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 @@
                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 -r 3d8669299780 -r b171f77897cb usr.bin/make/unit-tests/cond-cmp-numeric.exp
--- a/usr.bin/make/unit-tests/cond-cmp-numeric.exp      Thu Mar 03 07:31:24 2022 +0000
+++ b/usr.bin/make/unit-tests/cond-cmp-numeric.exp      Thu Mar 03 19:36:35 2022 +0000
@@ -3,11 +3,11 @@
 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 -r 3d8669299780 -r b171f77897cb usr.bin/make/unit-tests/cond-token-plain.exp
--- a/usr.bin/make/unit-tests/cond-token-plain.exp      Thu Mar 03 07:31:24 2022 +0000
+++ b/usr.bin/make/unit-tests/cond-token-plain.exp      Thu Mar 03 19:36:35 2022 +0000
@@ -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 @@
 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 -r 3d8669299780 -r b171f77897cb usr.bin/make/unit-tests/deptgt-makeflags.exp
--- a/usr.bin/make/unit-tests/deptgt-makeflags.exp      Thu Mar 03 07:31:24 2022 +0000
+++ b/usr.bin/make/unit-tests/deptgt-makeflags.exp      Thu Mar 03 19:36:35 2022 +0000
@@ -3,7 +3,7 @@
 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 -r 3d8669299780 -r b171f77897cb usr.bin/make/unit-tests/directive-export-impl.exp
--- a/usr.bin/make/unit-tests/directive-export-impl.exp Thu Mar 03 07:31:24 2022 +0000
+++ b/usr.bin/make/unit-tests/directive-export-impl.exp Thu Mar 03 19:36:35 2022 +0000
@@ -23,7 +23,7 @@
 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 @@
 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 -r 3d8669299780 -r b171f77897cb usr.bin/make/unit-tests/directive-include.exp
--- a/usr.bin/make/unit-tests/directive-include.exp     Thu Mar 03 07:31:24 2022 +0000
+++ b/usr.bin/make/unit-tests/directive-include.exp     Thu Mar 03 19:36:35 2022 +0000
@@ -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 -r 3d8669299780 -r b171f77897cb usr.bin/make/unit-tests/opt-debug-cond.exp
--- a/usr.bin/make/unit-tests/opt-debug-cond.exp        Thu Mar 03 07:31:24 2022 +0000
+++ b/usr.bin/make/unit-tests/opt-debug-cond.exp        Thu Mar 03 19:36:35 2022 +0000
@@ -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 -r 3d8669299780 -r b171f77897cb usr.bin/make/unit-tests/opt-debug-file.exp
--- a/usr.bin/make/unit-tests/opt-debug-file.exp        Thu Mar 03 07:31:24 2022 +0000
+++ b/usr.bin/make/unit-tests/opt-debug-file.exp        Thu Mar 03 19:36:35 2022 +0000
@@ -2,11 +2,11 @@
 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 -r 3d8669299780 -r b171f77897cb usr.bin/make/unit-tests/varmod-ifelse.exp
--- a/usr.bin/make/unit-tests/varmod-ifelse.exp Thu Mar 03 07:31:24 2022 +0000
+++ b/usr.bin/make/unit-tests/varmod-ifelse.exp Thu Mar 03 19:36:35 2022 +0000
@@ -7,14 +7,14 @@
 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 -r 3d8669299780 -r b171f77897cb usr.bin/make/unit-tests/varmod-loop.exp
--- a/usr.bin/make/unit-tests/varmod-loop.exp   Thu Mar 03 07:31:24 2022 +0000
+++ b/usr.bin/make/unit-tests/varmod-loop.exp   Thu Mar 03 19:36:35 2022 +0000
@@ -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 -r 3d8669299780 -r b171f77897cb usr.bin/make/unit-tests/varmod-match-escape.exp
--- a/usr.bin/make/unit-tests/varmod-match-escape.exp   Thu Mar 03 07:31:24 2022 +0000
+++ b/usr.bin/make/unit-tests/varmod-match-escape.exp   Thu Mar 03 19:36:35 2022 +0000
@@ -10,7 +10,7 @@
 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 @@
 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 -r 3d8669299780 -r b171f77897cb usr.bin/make/unit-tests/varmod-match.exp
--- a/usr.bin/make/unit-tests/varmod-match.exp  Thu Mar 03 07:31:24 2022 +0000
+++ b/usr.bin/make/unit-tests/varmod-match.exp  Thu Mar 03 19:36:35 2022 +0000
@@ -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 -r 3d8669299780 -r b171f77897cb usr.bin/make/unit-tests/varname-dot-shell.exp
--- a/usr.bin/make/unit-tests/varname-dot-shell.exp     Thu Mar 03 07:31:24 2022 +0000
+++ b/usr.bin/make/unit-tests/varname-dot-shell.exp     Thu Mar 03 19:36:35 2022 +0000
@@ -9,14 +9,14 @@
 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 @@
 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



Home | Main Index | Thread Index | Old Index