Skip to content

Commit 3380644

Browse files
authored
[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.
1 parent 85f4593 commit 3380644

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

lldb/include/lldb/Utility/SupportFile.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,6 @@ class SupportFile {
4949
/// Materialize the file to disk and return the path to that temporary file.
5050
virtual const FileSpec &Materialize() { return m_file_spec; }
5151

52-
/// Change the file name.
53-
void Update(const FileSpec &file_spec) { m_file_spec = file_spec; }
54-
5552
protected:
5653
FileSpec m_file_spec;
5754
Checksum m_checksum;

lldb/source/Symbol/LineEntry.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,9 @@ void LineEntry::ApplyFileMappings(lldb::TargetSP target_sp) {
244244
if (target_sp) {
245245
// Apply any file remappings to our file.
246246
if (auto new_file_spec = target_sp->GetSourcePathMap().FindFile(
247-
original_file_sp->GetSpecOnly()))
248-
file_sp->Update(*new_file_spec);
247+
original_file_sp->GetSpecOnly())) {
248+
file_sp = std::make_shared<SupportFile>(*new_file_spec,
249+
original_file_sp->GetChecksum());
250+
}
249251
}
250252
}

0 commit comments

Comments
 (0)