1*b69c3b89SSimon J. Gerraty# $NetBSD: opt-debug-parse.mk,v 1.6 2022/01/08 23:52:26 rillig Exp $
2956e45f6SSimon J. Gerraty#
3956e45f6SSimon J. Gerraty# Tests for the -dp command line option, which adds debug logging about
4956e45f6SSimon J. Gerraty# makefile parsing.
5956e45f6SSimon J. Gerraty
6*b69c3b89SSimon J. Gerraty.MAKEFLAGS: -dp
7*b69c3b89SSimon J. Gerraty
8956e45f6SSimon J. Gerraty# TODO: Implementation
9956e45f6SSimon J. Gerraty
10*b69c3b89SSimon J. Gerraty# Before parse.c 1.639 from 2022-01-08, PrintStackTrace and other diagnostics
11*b69c3b89SSimon J. Gerraty# printed a wrong line number, using the last line before the loop body, while
12*b69c3b89SSimon J. Gerraty# it should rather be the line number where the .for loop starts.
13*b69c3b89SSimon J. Gerraty#
14*b69c3b89SSimon J. Gerraty# Before parse.c 1.643 from 2022-01-08, PrintStackTrace tried to be too clever
15*b69c3b89SSimon J. Gerraty# by merging stack trace entries, printing confusing line numbers as a result.
16*b69c3b89SSimon J. Gerraty.for \
17*b69c3b89SSimon J. Gerraty    var \
18*b69c3b89SSimon J. Gerraty    in \
19*b69c3b89SSimon J. Gerraty    value
20*b69c3b89SSimon J. Gerraty.info trace with multi-line .for loop head
21*b69c3b89SSimon J. Gerraty.endfor
22*b69c3b89SSimon J. Gerraty
23*b69c3b89SSimon J. Gerraty# Before parse.c 1.461 from 2022-01-08, the debug log said it returned to
24*b69c3b89SSimon J. Gerraty# the line of the '.include' instead of the line following it.
25*b69c3b89SSimon J. Gerraty.include "/dev/null"
26*b69c3b89SSimon J. Gerraty
27*b69c3b89SSimon J. Gerraty
28*b69c3b89SSimon J. Gerraty# In .for loops with multiple variables, the variable details are included in
29*b69c3b89SSimon J. Gerraty# the stack trace, just as with a single variable.
30*b69c3b89SSimon J. Gerraty.for a b c in 1 2 3 ${:U4 5 6}
31*b69c3b89SSimon J. Gerraty.info trace
32*b69c3b89SSimon J. Gerraty.endfor
33*b69c3b89SSimon J. Gerraty
34*b69c3b89SSimon J. Gerraty
35*b69c3b89SSimon J. Gerraty.MAKEFLAGS: -d0
36*b69c3b89SSimon J. Gerraty
37*b69c3b89SSimon J. Gerratyall: .PHONY
38