CMake/Tests/RunCMake/CommandLine/trace-json-v1-nested
Braulio Valdivielso Martinez fd46db1745 Trace: process else and elseif commands correctly
There have been two bugs reported about the `else` and `elseif`
commands in the context of the tracing functionality and the json-v1
format (#23191 #22315). In essence, the reported traces referred to
the layer of the stacktrace immediately on top of the expected ones.

This MR fixes both issues. My solution adds a new parameter to the
`PrintCommandTrace` function, `commandMissingFromStack`, that callers
can specify if the command they want to report a trace for is not a
regular part of the stack maintained in `cmMakefile`. This is only the
case for `else` and `elseif`. The other bug is fixed by having the
caller pass a `cmListFileBacktrace`, which helps in getting the right
lines, file names... for the reported command.

Fixes: #23191 #22315
2022-03-25 12:24:38 -04:00
..
CMakeLists.txt