mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-24 07:08:38 -05:00
PrintCallStack: "Fix" entry suppression
Backtraces may contain non-specific entries (n.b. FromListFilePath in cmListFileContext). Our prior expectation is that these will ALWAYS replaced by more specific entries. However, with the previous change to allow users to create arbitrary stack entries, this is no longer the case. Modify PrintCallStack to only skip printing these non-specific entries if they were in fact preceded by a more specific entry. This, and the functionality of the preceding commit, is intended to be used for CPS dependency resolution. Because said resolution may fail at a non-trivial depth, it is important to be able to provide the user with the path of packages that led to the failure. However, because this happens through parsing JSON, there is no listfile function to associate with the stack entries, nor do we attempt to keep track of line numbers from the JSON. As a result, these entries will never be more specific than the name of the CPS file whose dependencies we are trying to locate.
This commit is contained in:
committed by
Brad King
parent
a73955ae76
commit
dcaa52c6c3
@@ -138,10 +138,10 @@ public:
|
||||
|
||||
static cmListFileContext FromListFilePath(std::string const& filePath)
|
||||
{
|
||||
// We are entering a file-level scope but have not yet reached
|
||||
// any specific line or command invocation within it. This context
|
||||
// is useful to print when it is at the top but otherwise can be
|
||||
// skipped during call stack printing.
|
||||
// We are entering a file-level scope but have not yet reached any specific
|
||||
// line or command invocation within it. This context is useful to print
|
||||
// when it is at the top, but otherwise can be skipped during call stack
|
||||
// printing if preceded by a more specific entry.
|
||||
cmListFileContext lfc;
|
||||
lfc.FilePath = filePath;
|
||||
return lfc;
|
||||
|
||||
Reference in New Issue
Block a user