Skip to content

Commit 08748d1

Browse files
committed
Fix a check that was attempting to see if an object file was in memory.
Checking if an object file is in memory should use the ObjectFile::IsInMemory(), not test ObjectFile::BaseAddress(). ObjectFile::BaseAddress() is designed to be overridden by all classes and is for mach-o, ELF and COFF plug-ins. They find the header base adddress and return that as a section offset address. The default implementation of ObjectFile::BaseAddress() does try and make an Address() from the ObjectFile::m_memory_addr, but I switched it to a correct function call. Differential Revision: https://reviews.llvm.org/D86122
1 parent 0b98a59 commit 08748d1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1628,7 +1628,7 @@ void ObjectFileMachO::ProcessSegmentCommand(const load_command &load_cmd_,
16281628
} else if (unified_section_sp) {
16291629
if (is_dsym && unified_section_sp->GetFileAddress() != load_cmd.vmaddr) {
16301630
// Check to see if the module was read from memory?
1631-
if (module_sp->GetObjectFile()->GetBaseAddress().IsValid()) {
1631+
if (module_sp->GetObjectFile()->IsInMemory()) {
16321632
// We have a module that is in memory and needs to have its file
16331633
// address adjusted. We need to do this because when we load a file
16341634
// from memory, its addresses will be slid already, yet the addresses

0 commit comments

Comments
 (0)