From 329098a9a0e81e67bd760f53811cce582a3ebdcd Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sat, 4 Jul 2015 12:16:39 +0200 Subject: [PATCH] cmMakefile: Set the FilePath on the frame from the cmState. To verify unit tests pass and for future bisecting. --- Source/cmMakefile.cxx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 8d02092d5..a65f6bac4 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -276,11 +276,13 @@ void cmMakefile::IssueMessage(cmake::MessageType t, cmListFileBacktrace cmMakefile::GetBacktrace() const { cmListFileBacktrace backtrace(this->StateSnapshot); + cmState::Snapshot snp = this->StateSnapshot; for(std::vector::const_reverse_iterator i = this->ContextStack.rbegin(); - i != this->ContextStack.rend(); ++i) + i != this->ContextStack.rend(); ++i, snp = snp.GetCallStackParent()) { cmListFileContext frame = *(*i); + frame.FilePath = snp.GetExecutionListFile(); backtrace.Append(frame); } return backtrace; @@ -292,11 +294,15 @@ cmMakefile::GetBacktrace(cmListFileContext const& lfc) const { cmListFileBacktrace backtrace(this->StateSnapshot); backtrace.Append(lfc); + cmState::Snapshot snp = this->StateSnapshot; + assert(snp.GetExecutionListFile() == lfc.FilePath); + snp = snp.GetCallStackParent(); for(std::vector::const_reverse_iterator i = this->ContextStack.rbegin(); - i != this->ContextStack.rend(); ++i) + i != this->ContextStack.rend(); ++i, snp = snp.GetCallStackParent()) { cmListFileContext frame = *(*i); + frame.FilePath = snp.GetExecutionListFile(); backtrace.Append(frame); } return backtrace;