[Lldb-commits] [lldb] 3380644 - [lldb] Remove SupportFile::Update and use the original Checksum (#95623)
via lldb-commits
lldb-commits at lists.llvm.org
Mon Jun 17 09:37:49 PDT 2024
Author: Jonas Devlieghere
Date: 2024-06-17T09:37:44-07:00
New Revision: 3380644fb070fd6648e873b1e75022bdfc432f1f
URL: https://github.com/llvm/llvm-project/commit/3380644fb070fd6648e873b1e75022bdfc432f1f
DIFF: https://github.com/llvm/llvm-project/commit/3380644fb070fd6648e873b1e75022bdfc432f1f.diff
LOG: [lldb] Remove SupportFile::Update and use the original Checksum (#95623)
When Jason was looking into the issue caused by #95606 he suggested
using the Checksum from the original file in LineEntry. I like the idea
because it makes sense semantically, but also allows us to get rid of
the Update method and ensures we make a new copy, in case someone else
is holding onto the old SupportFile.
Added:
Modified:
lldb/include/lldb/Utility/SupportFile.h
lldb/source/Symbol/LineEntry.cpp
Removed:
################################################################################
diff --git a/lldb/include/lldb/Utility/SupportFile.h b/lldb/include/lldb/Utility/SupportFile.h
index d65156cea768f..21b986dcaba28 100644
--- a/lldb/include/lldb/Utility/SupportFile.h
+++ b/lldb/include/lldb/Utility/SupportFile.h
@@ -49,9 +49,6 @@ class SupportFile {
/// Materialize the file to disk and return the path to that temporary file.
virtual const FileSpec &Materialize() { return m_file_spec; }
- /// Change the file name.
- void Update(const FileSpec &file_spec) { m_file_spec = file_spec; }
-
protected:
FileSpec m_file_spec;
Checksum m_checksum;
diff --git a/lldb/source/Symbol/LineEntry.cpp b/lldb/source/Symbol/LineEntry.cpp
index 461399e0326e9..19e9bb561375b 100644
--- a/lldb/source/Symbol/LineEntry.cpp
+++ b/lldb/source/Symbol/LineEntry.cpp
@@ -244,7 +244,9 @@ void LineEntry::ApplyFileMappings(lldb::TargetSP target_sp) {
if (target_sp) {
// Apply any file remappings to our file.
if (auto new_file_spec = target_sp->GetSourcePathMap().FindFile(
- original_file_sp->GetSpecOnly()))
- file_sp->Update(*new_file_spec);
+ original_file_sp->GetSpecOnly())) {
+ file_sp = std::make_shared<SupportFile>(*new_file_spec,
+ original_file_sp->GetChecksum());
+ }
}
}
More information about the lldb-commits
mailing list