The NetBSD Project

CVS log for src/usr.bin/make/unit-tests/vardebug.exp

[BACK] Up to [cvs.NetBSD.org] / src / usr.bin / make / unit-tests

Request diff between arbitrary revisions


Keyword substitution: kv
Default branch: MAIN


Revision 1.40: download - view: text, markup, annotated - select for diffs
Sat Jan 11 21:21:33 2025 UTC (2 weeks ago) by rillig
Branches: MAIN
CVS tags: HEAD
Diff to: previous 1.39: preferred, colored
Changes since revision 1.39: +28 -19 lines
make: replace "Malformed conditional" with "Variable is undefined"

Evaluating a conditional such as ".if ${UNDEF}" produced a "Malformed
conditional" error, even though the form of the conditional was correct,
it was the content of the variable that was wrong.

Replace this message with the more accurate "Variable is undefined",
revealing which of the possibly many variables is actually undefined.

Revision 1.39: download - view: text, markup, annotated - select for diffs
Sat Jan 11 20:54:45 2025 UTC (2 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.38: preferred, colored
Changes since revision 1.38: +2 -3 lines
make: omit redundant follow-up message "Malformed conditional"

If there is a parse error or an evaluation error during the conditional,
the conditional is already mentioned in the "while evaluating condition"
line, so there's no reason to repeat it once again.

Same for the "Bad condition" message from the '?:' modifier.

Revision 1.38: download - view: text, markup, annotated - select for diffs
Thu Aug 29 20:20:36 2024 UTC (4 months, 3 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.37: preferred, colored
Changes since revision 1.37: +2 -1 lines
make: reduce line length in error messages

The error messages for deeply nested parse errors were hard to decipher,
due to the large amount of text.  Split these messages into individual
lines, just as in the backtrace for .include files and .for loops.  This
unified backtrace makes the output more uniform.

Revision 1.37: download - view: text, markup, annotated - select for diffs
Tue Aug 6 18:00:17 2024 UTC (5 months, 2 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.36: preferred, colored
Changes since revision 1.36: +2 -2 lines
make: in error message about conditionals, use single quotes

Single quotes are used less often in the conditionals themselves, which
leads to fewer confusions.

Revision 1.36: download - view: text, markup, annotated - select for diffs
Fri Jul 5 19:47:22 2024 UTC (6 months, 3 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.35: preferred, colored
Changes since revision 1.35: +1 -1 lines
make: in error messages for anonymous variables, log the value

Revision 1.35: download - view: text, markup, annotated - select for diffs
Sat Apr 20 10:18:55 2024 UTC (9 months, 1 week ago) by rillig
Branches: MAIN
CVS tags: perseant-exfatfs-base-20240630, perseant-exfatfs-base, perseant-exfatfs
Diff to: previous 1.34: preferred, colored
Changes since revision 1.34: +1 -1 lines
make: provide more context information for parse/evaluate errors

Revision 1.34: download - view: text, markup, annotated - select for diffs
Wed Dec 20 09:46:00 2023 UTC (13 months, 1 week ago) by rillig
Branches: MAIN
Diff to: previous 1.33: preferred, colored
Changes since revision 1.33: +3 -3 lines
tests/make: add the expected output to the test for variable debugging

Revision 1.33: download - view: text, markup, annotated - select for diffs
Wed Dec 20 09:03:09 2023 UTC (13 months, 1 week ago) by rillig
Branches: MAIN
Diff to: previous 1.32: preferred, colored
Changes since revision 1.32: +4 -4 lines
make: use consistent debug messages style when ignoring variables

When a variable is not modified or not deleted, clearly say so and state
the reason.  Use the same style of debug messages everywhere, putting
the word 'ignoring' at the front.  Previously, that word sticked out to
the right, but only in some cases.

Revision 1.32: download - view: text, markup, annotated - select for diffs
Wed Dec 20 08:50:10 2023 UTC (13 months, 1 week ago) by rillig
Branches: MAIN
Diff to: previous 1.31: preferred, colored
Changes since revision 1.31: +3 -3 lines
make: fix confusing debug logging when deleting a variable

Be clear when deleting a variable is ignored and state the reason,
instead of only providing a keyword as a hint for insiders.

Revision 1.31: download - view: text, markup, annotated - select for diffs
Sun Dec 10 20:17:23 2023 UTC (13 months, 2 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.30: preferred, colored
Changes since revision 1.30: +1 -1 lines
make: explain in the debug log why a variable assignment is ignored

Revision 1.30: download - view: text, markup, annotated - select for diffs
Thu Jun 1 20:56:35 2023 UTC (19 months, 3 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.29: preferred, colored
Changes since revision 1.29: +3 -3 lines
tests/make: force line-based diagnostics to be listed in the tests

This way, contradictions between the intended output and the actual
output are closer together and have a better chance of being spotted.

Revision 1.29: download - view: text, markup, annotated - select for diffs
Sat Mar 26 14:34:07 2022 UTC (2 years, 10 months ago) by rillig
Branches: MAIN
CVS tags: netbsd-10-base, netbsd-10-1-RELEASE, netbsd-10-0-RELEASE, netbsd-10-0-RC6, netbsd-10-0-RC5, netbsd-10-0-RC4, netbsd-10-0-RC3, netbsd-10-0-RC2, netbsd-10-0-RC1, netbsd-10
Diff to: previous 1.28: preferred, colored
Changes since revision 1.28: +1 -1 lines
make: avoid trailing whitespace in debug log for variables

Since trailing whitespace is invisible, describe the variable value in
words to make it visible.

Revision 1.28: download - view: text, markup, annotated - select for diffs
Sat Mar 26 14:17:46 2022 UTC (2 years, 10 months ago) by rillig
Branches: MAIN
Diff to: previous 1.27: preferred, colored
Changes since revision 1.27: +5 -5 lines
make: add space after colon in debug logging for variables

These log messages are intended for human interpretation, so don't make
them unnecessarily hard to read.

Revision 1.27: download - view: text, markup, annotated - select for diffs
Sat Nov 20 17:51:48 2021 UTC (3 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.26: preferred, colored
Changes since revision 1.26: +2 -2 lines
make: use correct plural form in debug message

Revision 1.26: download - view: text, markup, annotated - select for diffs
Sat Apr 10 22:35:02 2021 UTC (3 years, 9 months ago) by rillig
Branches: MAIN
CVS tags: cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x
Diff to: previous 1.25: preferred, colored
Changes since revision 1.25: +2 -2 lines
make: reword debug log message for empty variable name

The function names did not match anymore, after one of the many
refactorings in the last few months.

Revision 1.25: download - view: text, markup, annotated - select for diffs
Sat Apr 10 22:09:54 2021 UTC (3 years, 9 months ago) by rillig
Branches: MAIN
Diff to: previous 1.24: preferred, colored
Changes since revision 1.24: +0 -12 lines
make: reduce debug logging and memory allocation for ${:U...}

Expressions of the form ${:U...} are often generated by .for loops.
Since these expressions are not generated knowingly by the make user, do
not fill the debug log with them since that would interrupt the normal
reading flow of the -dv log for nested expressions.

Revision 1.24: download - view: text, markup, annotated - select for diffs
Tue Apr 6 01:38:39 2021 UTC (3 years, 9 months ago) by rillig
Branches: MAIN
Diff to: previous 1.23: preferred, colored
Changes since revision 1.23: +7 -7 lines
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.

Revision 1.23: download - view: text, markup, annotated - select for diffs
Mon Apr 5 13:35:41 2021 UTC (3 years, 9 months ago) by rillig
Branches: MAIN
Diff to: previous 1.22: preferred, colored
Changes since revision 1.22: +12 -12 lines
make: in debug log, add space between scope and variable name

Without this space, the debug log looked more like line noise, even
though the only punctuation was a single innocent ':'.  From a make
user's perspective, the variable name is a word of its own and should
not be visually glued to its namespace.

Revision 1.22: download - view: text, markup, annotated - select for diffs
Mon Apr 5 13:27:30 2021 UTC (3 years, 9 months ago) by rillig
Branches: MAIN
Diff to: previous 1.21: preferred, colored
Changes since revision 1.21: +7 -7 lines
make: omit unnecessary details from -dv debug log

When an expression is based on a defined variable, it does not matter
whether the evaluation mode is "eval" or "eval-defined", therefore omit
these details to reduce confusion.

Revision 1.21: download - view: text, markup, annotated - select for diffs
Mon Apr 5 13:14:55 2021 UTC (3 years, 9 months ago) by rillig
Branches: MAIN
Diff to: previous 1.20: preferred, colored
Changes since revision 1.20: +16 -16 lines
make: be more verbose in -dv debug logging

The previous log output was too brief to be understandable.  Give more
hints by describing each part of the expression when evaluating a
modifier.  Distinguish between parse-only mode and eval mode since in
parse-only mode most of the details are irrelevant.

Revision 1.20: download - view: text, markup, annotated - select for diffs
Mon Apr 5 12:51:35 2021 UTC (3 years, 9 months ago) by rillig
Branches: MAIN
Diff to: previous 1.19: preferred, colored
Changes since revision 1.19: +4 -9 lines
make: clean up debug logging for ':M' and ':N'

Using square brackets as quotes was confusing since patterns can contain
square brackets themselves.

The debug logging for VarMatch was a bit too detailed.  Having the
"before" and "after" states is enough for all practically relevant
cases.

Revision 1.19: download - view: text, markup, annotated - select for diffs
Sat Apr 3 22:02:59 2021 UTC (3 years, 9 months ago) by rillig
Branches: MAIN
Diff to: previous 1.18: preferred, colored
Changes since revision 1.18: +32 -32 lines
make: remove VarFlags from debug logging

Before the introduction of ExprDefined, VarFlags contained whether the
expression was defined or not, which was useful to know since the final
value of the expression depends on this information.  The other VarFlags
do not influence the evaluation, so there is no point logging them.

Revision 1.18: download - view: text, markup, annotated - select for diffs
Mon Mar 15 15:39:13 2021 UTC (3 years, 10 months ago) by rillig
Branches: MAIN
Diff to: previous 1.17: preferred, colored
Changes since revision 1.17: +44 -44 lines
make: change debug log for variable evaluation flags to lowercase

This makes them easier distinguishable from variable names since the
latter are usually uppercase.

No functional change outside debug mode.

Revision 1.17: download - view: text, markup, annotated - select for diffs
Tue Feb 23 15:19:41 2021 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.16: preferred, colored
Changes since revision 1.16: +1 -1 lines
make: improve error message for unknown modifier

Back in 1995, the modifiers were all single-character, and it made sense
to print only the first character.  Nowadays, with ':S', ':@var@...@',
'::=' and several others, a little more context is useful to see where
the exact error is.  The actual modifier is still guessed, and the guess
may be wrong as soon as backslashes get involved, but it is still better
than before.

Revision 1.16: download - view: text, markup, annotated - select for diffs
Mon Feb 15 18:23:32 2021 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.15: preferred, colored
Changes since revision 1.15: +32 -32 lines
make: rename ExprDefined constants for debug logging

Revision 1.15: download - view: text, markup, annotated - select for diffs
Tue Feb 2 16:18:16 2021 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.14: preferred, colored
Changes since revision 1.14: +18 -18 lines
make: replace VarExprFlags with VarExprStatus

The combination of !VEF_UNDEF && VEF_DEF was not possible, which made it
rather strange to model this state as a bit set.

The only functional change is the renamed constants in the debug output.

Using ENUM_VALUE_RTTI_2 felt like overengineering since it's harder to
understand than a simple array of names.

Revision 1.14: download - view: text, markup, annotated - select for diffs
Sun Dec 20 19:47:34 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.13: preferred, colored
Changes since revision 1.13: +1 -1 lines
make(1): error out on unknown variable modifiers at parse time

Before, make printed an "error message" that did not include the word
error and thus was not easily identified as such.  This "error message"
also did not influence the exit status in the default mode but only in
-dL mode.  The error message also didn't include any line number
information and was thus rude.

Revision 1.13: download - view: text, markup, annotated - select for diffs
Tue Nov 17 20:27:35 2020 UTC (4 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.12: preferred, colored
Changes since revision 1.12: +1 -1 lines
make(1): make test vardebug independent from the shell

Revision 1.12: download - view: text, markup, annotated - select for diffs
Sat Oct 31 18:14:59 2020 UTC (4 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.11: preferred, colored
Changes since revision 1.11: +0 -2 lines
make(1): remove debug logging for the :Q variable modifier

The same information is already logged in LogAfterApply.

Revision 1.11: download - view: text, markup, annotated - select for diffs
Thu Oct 29 18:38:24 2020 UTC (4 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.10: preferred, colored
Changes since revision 1.10: +3 -0 lines
make(1): add test for ignoring assignment to read-only variable

Revision 1.10: download - view: text, markup, annotated - select for diffs
Thu Oct 29 18:19:41 2020 UTC (4 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.9: preferred, colored
Changes since revision 1.9: +7 -2 lines
make(1): move MAKEFLAGS handling in vardebug test to the test itself

Revision 1.9: download - view: text, markup, annotated - select for diffs
Wed Sep 30 05:58:22 2020 UTC (4 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.8: preferred, colored
Changes since revision 1.8: +2 -2 lines
make(1): fix bug in evaluation of indirect variable modifiers

Since 2020-09-22, when indirect variable modifiers were applied to a
variable expression based on an undefined variable, these modifiers did
not change the state of a variable expression from undefined to defined.
The modifiers that do this are :D, :U, :L, :P.  Minimal example:

	${VARNAME:${:UL}}

The :L modifier from the inner expression sets the value of the outer
expression to its variable name, in this case "VARNAME".  The outer
expression was not marked as being defined though, which resulted in a
"Malformed conditional" error.

In the commit from 2020-09-22, vardebug.exp had changed a lot, and I had
not inspected the change closely.  The important detail was in lines 56
and 60, where VAR_JUNK|VAR_KEEP changed into VEF_UNDEF, thereby losing
the VEF_DEF bit.

Revision 1.8: download - view: text, markup, annotated - select for diffs
Tue Sep 22 06:13:39 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.7: preferred, colored
Changes since revision 1.7: +32 -32 lines
make(1): move VAR_JUNK and VAR_KEEP away from VarFlags

These two flags have nothing to do with a variable.  They are only used
while evaluating a variable expression.

While here, rename the flags and make their documentation more precise.

Revision 1.7: download - view: text, markup, annotated - select for diffs
Sun Sep 13 16:47:24 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.6: preferred, colored
Changes since revision 1.6: +32 -32 lines
make(1): shorten debug output of ApplyModifiers

Having the words "eflags" and "vflags" in the debug output was too
repetitive.  That they are flags is made obvious by the '|' separator,
and the flags have clearly distinguishable names (VARE_* vs. VAR_*),
which lowers the chance for confusion.

Revision 1.6: download - view: text, markup, annotated - select for diffs
Sat Aug 8 18:50:12 2020 UTC (4 years, 5 months ago) by rillig
Branches: MAIN
Diff to: previous 1.5: preferred, colored
Changes since revision 1.5: +12 -0 lines
make(1): add debug logging for Var_Parse

This will hopefully help with tracking down why the "Undefined variable"
error message is not triggered.

There is some other non-obvious behavior nearby.  In Parse_DoVar, the !=
assignment operator evaluates the variable using VARE_UNDEFERR, but
there is not even a warning for the following line:

!= echo err ${UNDEFINED} 1>&2

Revision 1.5: download - view: text, markup, annotated - select for diffs
Sat Aug 8 14:28:46 2020 UTC (4 years, 5 months ago) by rillig
Branches: MAIN
Diff to: previous 1.4: preferred, colored
Changes since revision 1.4: +8 -1 lines
make(1): extend debug logging to error values

The error marker var_Error is just an empty string.  In the debug log
this empty string was not distinguishable from an otherwise empty
string.

Having this distinction helps in understanding the exact data flow.

Revision 1.4: download - view: text, markup, annotated - select for diffs
Sat Aug 8 13:50:23 2020 UTC (4 years, 5 months ago) by rillig
Branches: MAIN
Diff to: previous 1.3: preferred, colored
Changes since revision 1.3: +28 -28 lines
make(1): add more detailed debug logging for variable modifiers

Before a modifier is applied to a variable, it is not yet parsed,
therefore it is only possible to log a rough estimate of the modifier.
But after applying it, the parsing position has advanced, and the full
modifier can be logged.

In addition, to fully understand how the modifiers work, it's not enough
to just know the variable names and values, there are also some flags
that influence how the modifiers behave.  The most influential is
VARE_WANTRES.

Thanks to sjg for the extensive review and valuable feedback on the
first drafts.

Revision 1.3: download - view: text, markup, annotated - select for diffs
Sat Aug 8 12:32:26 2020 UTC (4 years, 5 months ago) by rillig
Branches: MAIN
Diff to: previous 1.2: preferred, colored
Changes since revision 1.2: +1 -1 lines
make(1): fix debug output for indirect modifiers

The trailing part after the modifier was confusing at best.  It does
make sense to log the string from p to p+rlen, but not from p+len to
p+len+len.

Consistently use double quotes for strings.

Revision 1.2: download - view: text, markup, annotated - select for diffs
Sat Aug 8 12:22:10 2020 UTC (4 years, 5 months ago) by rillig
Branches: MAIN
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +15 -0 lines
make(1): add test for debugging message for indirect modifiers

The current output format stops in the middle of the next modifier,
which was probably not intended.

Revision 1.1: download - view: text, markup, annotated - select for diffs
Sat Jul 25 21:19:29 2020 UTC (4 years, 6 months ago) by rillig
Branches: MAIN
make(1): add tests for previously uncovered code

Diff request

This form allows you to request diffs between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.

Log view options

CVSweb <webmaster@jp.NetBSD.org>