head 1.8; access; symbols netbsd-11-0-RC4:1.8 netbsd-11-0-RC3:1.8 netbsd-11-0-RC2:1.8 netbsd-11-0-RC1:1.8 perseant-exfatfs-base-20250801:1.8 netbsd-11:1.8.0.2 netbsd-11-base:1.8 netbsd-10-1-RELEASE:1.4 perseant-exfatfs-base-20240630:1.6 perseant-exfatfs:1.6.0.2 perseant-exfatfs-base:1.6 netbsd-10-0-RELEASE:1.4 netbsd-10-0-RC6:1.4 netbsd-10-0-RC5:1.4 netbsd-10-0-RC4:1.4 netbsd-10-0-RC3:1.4 netbsd-10-0-RC2:1.4 netbsd-10-0-RC1:1.4 netbsd-10:1.4.0.2 netbsd-10-base:1.4 cjep_sun2x-base1:1.1 cjep_sun2x:1.1.0.4 cjep_sun2x-base:1.1 cjep_staticlib_x-base1:1.1 cjep_staticlib_x:1.1.0.2 cjep_staticlib_x-base:1.1; locks; strict; comment @# @; 1.8 date 2025.03.30.09.51.50; author rillig; state Exp; branches; next 1.7; commitid veGmSzVhPiW2G4PF; 1.7 date 2024.07.07.09.37.00; author rillig; state Exp; branches; next 1.6; commitid 6cBlyU5haQyS9TgF; 1.6 date 2024.05.31.07.13.12; author rillig; state Exp; branches 1.6.2.1; next 1.5; commitid 9LM9ymCx5IJbz7cF; 1.5 date 2023.06.01.20.56.35; author rillig; state Exp; branches; next 1.4; commitid j3tIvMRlxolKQhrE; 1.4 date 2022.01.27.21.50.50; author sjg; state Exp; branches; next 1.3; commitid wCfPteAosPNJUjqD; 1.3 date 2022.01.22.18.59.24; author rillig; state Exp; branches; next 1.2; commitid RS7jjhg9eSi36FpD; 1.2 date 2022.01.22.17.10.51; author rillig; state Exp; branches; next 1.1; commitid mp92A8sn3CJAwEpD; 1.1 date 2020.09.05.06.20.51; author rillig; state Exp; branches; next ; commitid HozN7dA72dMV7PmC; 1.6.2.1 date 2025.08.02.05.58.35; author perseant; state Exp; branches; next ; commitid 23j6GFaDws3O875G; desc @@ 1.8 log @make: use '"filename" line 123' for locations instead of 'filename:123' The format 'filename:123' is commonly used for identifying a location in a file. Text editors recognize it and allow quick navigation through it. The previous format was specific to make and would have required custom support in editors. The new format was already used in stack traces, except for the first line. Now all lines use the same format. @ text @make: opt-debug-hash.mk:13: Missing argument for ".error" make: Fatal errors encountered -- cannot continue HashTable "targets": size=16 entries=0 maxchain=0 HashTable "Global variables": size=16 entries= maxchain=4 make: stopped in unit-tests exit status 1 @ 1.7 log @make: don't track hash table chain lengths during lookup The chain lengths are only used for debugging purposes, so avoid the extra cost at each lookup. Instead, calculate the maximum chain length only when it is actually requested in -dh mode. The reported number changes slightly: Before, it was the length of the chain that was actually traversed to find an entry, up to that entry, now it is the length of the largest chain in the table, no matter if it was actually accessed or not. @ text @d1 1 a1 1 make: "opt-debug-hash.mk" line 13: Missing argument for ".error" @ 1.6 log @tests/make: replace or document .error in tests The text 'Missing argument for ".error"' in an .exp file may be a hint for an accidentally broken test, so eliminate them as far as possible. @ text @d3 2 a4 2 HashTable targets: size=16 numEntries=0 maxchain=0 HashTable Global variables: size=16 numEntries= maxchain=3 @ 1.6.2.1 log @Sync with HEAD @ text @d1 1 a1 1 make: opt-debug-hash.mk:13: Missing argument for ".error" d3 2 a4 2 HashTable "targets": size=16 entries=0 maxchain=0 HashTable "Global variables": size=16 entries= maxchain=4 @ 1.5 log @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. @ text @d1 1 a1 1 make: "opt-debug-hash.mk" line 12: Missing argument for ".error" @ 1.4 log @numEntries can vary @ text @d1 1 a1 1 make: "opt-debug-hash.mk" line 11: Missing argument for ".error" @ 1.3 log @make: add missing newline after "cannot continue" message It was wrong of Parse_File to output an unfinished line and hope for some other code to finish it. As demonstrated in the test, PrintOnError did not do that in the case of additional debug output. To keep the overall behavior as close as possible to before, the other callers of PrintOnError now have to pass the newline themselves. Passing strings that start with newlines but don't end with them looked suspicious anyway. @ text @d4 1 a4 1 HashTable Global variables: size=16 numEntries=23 maxchain=3 @ 1.2 log @tests/make: add a few more tests @ text @d1 3 a3 2 make: "opt-debug-hash.mk" line 9: Missing argument for ".error" make: Fatal errors encountered -- cannot continueHashTable targets: size=16 numEntries=0 maxchain=0 a4 1 @ 1.1 log @make(1): add tests for each debug option @ text @d1 6 a6 1 exit status 0 @