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: reduce verbosity of the -dv debug logging...



details:   https://anonhg.NetBSD.org/src/rev/8059dcfaea70
branches:  trunk
changeset: 961008:8059dcfaea70
user:      rillig <rillig%NetBSD.org@localhost>
date:      Tue Apr 06 01:38:39 2021 +0000

description:
make: reduce verbosity of the -dv debug logging for standard cases

The verbosity was already removed from LogBeforeApply, now it is
consistent between LogBeforeApply and LogAfterApply.

diffstat:

 usr.bin/make/unit-tests/directive-export-impl.exp  |  12 ++++++------
 usr.bin/make/unit-tests/directive-unexport-env.exp |   4 ++--
 usr.bin/make/unit-tests/vardebug.exp               |  14 +++++++-------
 usr.bin/make/unit-tests/varmod-assign.exp          |   2 +-
 usr.bin/make/unit-tests/varmod-match-escape.exp    |   8 ++++----
 usr.bin/make/var.c                                 |  13 +++++++++++--
 6 files changed, 31 insertions(+), 22 deletions(-)

diffs (184 lines):

diff -r 92e89cbc1eb8 -r 8059dcfaea70 usr.bin/make/unit-tests/directive-export-impl.exp
--- a/usr.bin/make/unit-tests/directive-export-impl.exp Tue Apr 06 01:29:37 2021 +0000
+++ b/usr.bin/make/unit-tests/directive-export-impl.exp Tue Apr 06 01:38:39 2021 +0000
@@ -8,7 +8,7 @@
 Evaluating modifier ${UT_VAR:N...} on value "<>"
 Pattern for ':N' is "*"
 ModifyWords: split "<>" into 1 words
-Result of ${UT_VAR:N*} is "" (eval-defined, regular)
+Result of ${UT_VAR:N*} is ""
 ParseDependency(: )
 CondParser_Eval: ${:!echo "\$UT_VAR"!} != "<>"
 Var_Parse: ${:!echo "\$UT_VAR"!} != "<>" (eval-defined)
@@ -16,9 +16,9 @@
 Modifier part: "echo "$UT_VAR""
 Var_Parse: ${.MAKE.EXPORTED:O:u} (eval)
 Evaluating modifier ${.MAKE.EXPORTED:O} on value "UT_VAR"
-Result of ${.MAKE.EXPORTED:O} is "UT_VAR" (eval, regular)
+Result of ${.MAKE.EXPORTED:O} is "UT_VAR"
 Evaluating modifier ${.MAKE.EXPORTED:u} on value "UT_VAR"
-Result of ${.MAKE.EXPORTED:u} is "UT_VAR" (eval, regular)
+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)
@@ -29,7 +29,7 @@
 Evaluating modifier ${UT_VAR:N...} on value "<>"
 Pattern for ':N' is "*"
 ModifyWords: split "<>" into 1 words
-Result of ${UT_VAR:N*} is "" (eval-defined, regular)
+Result of ${UT_VAR:N*} is ""
 ParseDependency(: )
 ParseReadLine (54): 'REF=              defined'
 Global: REF = defined
@@ -39,9 +39,9 @@
 Modifier part: "echo "$UT_VAR""
 Var_Parse: ${.MAKE.EXPORTED:O:u} (eval)
 Evaluating modifier ${.MAKE.EXPORTED:O} on value "UT_VAR"
-Result of ${.MAKE.EXPORTED:O} is "UT_VAR" (eval, regular)
+Result of ${.MAKE.EXPORTED:O} is "UT_VAR"
 Evaluating modifier ${.MAKE.EXPORTED:u} on value "UT_VAR"
-Result of ${.MAKE.EXPORTED:u} is "UT_VAR" (eval, regular)
+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)
diff -r 92e89cbc1eb8 -r 8059dcfaea70 usr.bin/make/unit-tests/directive-unexport-env.exp
--- a/usr.bin/make/unit-tests/directive-unexport-env.exp        Tue Apr 06 01:29:37 2021 +0000
+++ b/usr.bin/make/unit-tests/directive-unexport-env.exp        Tue Apr 06 01:38:39 2021 +0000
@@ -6,9 +6,9 @@
 make: "directive-unexport-env.mk" line 21: The directive .unexport-env does not take arguments
 Var_Parse: ${.MAKE.EXPORTED:O:u} (eval)
 Evaluating modifier ${.MAKE.EXPORTED:O} on value "UT_EXPORTED"
-Result of ${.MAKE.EXPORTED:O} is "UT_EXPORTED" (eval, regular)
+Result of ${.MAKE.EXPORTED:O} is "UT_EXPORTED"
 Evaluating modifier ${.MAKE.EXPORTED:u} on value "UT_EXPORTED"
-Result of ${.MAKE.EXPORTED:u} is "UT_EXPORTED" (eval, regular)
+Result of ${.MAKE.EXPORTED:u} is "UT_EXPORTED"
 Unexporting "UT_EXPORTED"
 Global:delete .MAKE.EXPORTED
 Global: .MAKEFLAGS =  -r -k -d v -d
diff -r 92e89cbc1eb8 -r 8059dcfaea70 usr.bin/make/unit-tests/vardebug.exp
--- a/usr.bin/make/unit-tests/vardebug.exp      Tue Apr 06 01:29:37 2021 +0000
+++ b/usr.bin/make/unit-tests/vardebug.exp      Tue Apr 06 01:38:39 2021 +0000
@@ -21,28 +21,28 @@
 Evaluating modifier ${VAR:M...} on value "1 2 3"
 Pattern for ':M' is "[2]"
 ModifyWords: split "1 2 3" into 3 words
-Result of ${VAR:M[2]} is "2" (eval-defined, regular)
+Result of ${VAR:M[2]} is "2"
 Var_Parse: ${VAR:N[2]} (eval-defined)
 Evaluating modifier ${VAR:N...} on value "1 2 3"
 Pattern for ':N' is "[2]"
 ModifyWords: split "1 2 3" into 3 words
-Result of ${VAR:N[2]} is "1 3" (eval-defined, regular)
+Result of ${VAR:N[2]} is "1 3"
 Var_Parse: ${VAR:S,2,two,} (eval-defined)
 Evaluating modifier ${VAR:S...} on value "1 2 3"
 Modifier part: "2"
 Modifier part: "two"
 ModifyWords: split "1 2 3" into 3 words
-Result of ${VAR:S,2,two,} is "1 two 3" (eval-defined, regular)
+Result of ${VAR:S,2,two,} is "1 two 3"
 Var_Parse: ${VAR:Q} (eval-defined)
 Evaluating modifier ${VAR:Q} on value "1 2 3"
-Result of ${VAR:Q} is "1\ 2\ 3" (eval-defined, regular)
+Result of ${VAR:Q} is "1\ 2\ 3"
 Var_Parse: ${VAR:tu:tl:Q} (eval-defined)
 Evaluating modifier ${VAR:t...} on value "1 2 3"
-Result of ${VAR:tu} is "1 2 3" (eval-defined, regular)
+Result of ${VAR:tu} is "1 2 3"
 Evaluating modifier ${VAR:t...} on value "1 2 3"
-Result of ${VAR:tl} is "1 2 3" (eval-defined, regular)
+Result of ${VAR:tl} is "1 2 3"
 Evaluating modifier ${VAR:Q} on value "1 2 3"
-Result of ${VAR:Q} is "1\ 2\ 3" (eval-defined, regular)
+Result of ${VAR:Q} is "1\ 2\ 3"
 Var_Parse: ${:Uvalue:${:UM*e}:Mvalu[e]} (eval-defined)
 Evaluating modifier ${:U...} on value "" (eval-defined, undefined)
 Result of ${:Uvalue} is "value" (eval-defined, defined)
diff -r 92e89cbc1eb8 -r 8059dcfaea70 usr.bin/make/unit-tests/varmod-assign.exp
--- a/usr.bin/make/unit-tests/varmod-assign.exp Tue Apr 06 01:29:37 2021 +0000
+++ b/usr.bin/make/unit-tests/varmod-assign.exp Tue Apr 06 01:38:39 2021 +0000
@@ -7,7 +7,7 @@
 Evaluating modifier ${VAR.${param}::...} on value "initial-value"
 Modifier part: "assigned-value"
 Global: VAR.${param} = assigned-value
-Result of ${VAR.${param}::=assigned-value} is "" (eval-defined, regular)
+Result of ${VAR.${param}::=assigned-value} is ""
 Var_Parse: ${${VARNAME}} != "assigned-value" (eval-defined)
 Var_Parse: ${VARNAME}} != "assigned-value" (eval-defined)
 Global: .MAKEFLAGS =  -r -k -d v -d
diff -r 92e89cbc1eb8 -r 8059dcfaea70 usr.bin/make/unit-tests/varmod-match-escape.exp
--- a/usr.bin/make/unit-tests/varmod-match-escape.exp   Tue Apr 06 01:29:37 2021 +0000
+++ b/usr.bin/make/unit-tests/varmod-match-escape.exp   Tue Apr 06 01:38:39 2021 +0000
@@ -7,7 +7,7 @@
 Result of ${:U} is "" (eval-defined, defined)
 Pattern for ':M' is "\:"
 ModifyWords: split "\: : \\ * \*" into 5 words
-Result of ${SPECIALS:M${:U}\:} is ":" (eval-defined, regular)
+Result of ${SPECIALS:M${:U}\:} is ":"
 Var_Parse: ${SPECIALS:M\:${:U}} (eval-defined)
 Evaluating modifier ${SPECIALS:M...} on value "\: : \\ * \*"
 Var_Parse: ${:U} (eval-defined)
@@ -15,7 +15,7 @@
 Result of ${:U} is "" (eval-defined, defined)
 Pattern for ':M' is ":"
 ModifyWords: split "\: : \\ * \*" into 5 words
-Result of ${SPECIALS:M\:${:U}} is ":" (eval-defined, regular)
+Result of ${SPECIALS:M\:${:U}} is ":"
 lhs = ":", rhs = ":", op = !=
 Global: VALUES = : :: :\:
 CondParser_Eval: ${VALUES:M\:${:U\:}} != ${VALUES:M${:U\:}\:}
@@ -26,7 +26,7 @@
 Result of ${:U} is "" (eval-defined, defined)
 Pattern for ':M' is ":"
 ModifyWords: split ": :: :\:" into 3 words
-Result of ${VALUES:M\:${:U\:}} is ":" (eval-defined, regular)
+Result of ${VALUES:M\:${:U\:}} is ":"
 Var_Parse: ${VALUES:M${:U\:}\:} (eval-defined)
 Evaluating modifier ${VALUES:M...} on value ": :: :\:"
 Var_Parse: ${:U\:}\: (eval-defined)
@@ -34,7 +34,7 @@
 Result of ${:U\:} is ":" (eval-defined, defined)
 Pattern for ':M' is ":\:"
 ModifyWords: split ": :: :\:" into 3 words
-Result of ${VALUES:M${:U\:}\:} is "::" (eval-defined, regular)
+Result of ${VALUES:M${:U\:}\:} is "::"
 lhs = ":", rhs = "::", op = !=
 make: "varmod-match-escape.mk" line 42: warning: XXX: Oops
 Global: .MAKEFLAGS =  -r -k -d cv -d
diff -r 92e89cbc1eb8 -r 8059dcfaea70 usr.bin/make/var.c
--- a/usr.bin/make/var.c        Tue Apr 06 01:29:37 2021 +0000
+++ b/usr.bin/make/var.c        Tue Apr 06 01:38:39 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: var.c,v 1.911 2021/04/05 13:35:41 rillig Exp $ */
+/*     $NetBSD: var.c,v 1.912 2021/04/06 01:38:39 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -140,7 +140,7 @@
 #include "metachar.h"
 
 /*     "@(#)var.c      8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.911 2021/04/05 13:35:41 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.912 2021/04/06 01:38:39 rillig Exp $");
 
 /*
  * Variables are defined using one of the VAR=value assignments.  Their
@@ -3694,6 +3694,15 @@
        const char *value = expr->value.str;
        const char *quot = value == var_Error ? "" : "\"";
 
+       if ((expr->emode == VARE_WANTRES || expr->emode == VARE_UNDEFERR) &&
+           expr->defined == DEF_REGULAR) {
+
+               debug_printf("Result of ${%s:%.*s} is %s%s%s\n",
+                   expr->name, (int)(p - mod), mod,
+                   quot, value == var_Error ? "error" : value, quot);
+               return;
+       }
+
        debug_printf("Result of ${%s:%.*s} is %s%s%s (%s, %s)\n",
            expr->name, (int)(p - mod), mod,
            quot, value == var_Error ? "error" : value, quot,



Home | Main Index | Thread Index | Old Index