Skip to content

Commit 7602cdd

Browse files
committed
Handle a LC_NOTE main bin spec for user process corefiles
I was playing around with main bin spec LC_NOTEs and noticed a small oversight in the parsing of user process corefile notes. (cherry picked from commit 3bc65a9)
1 parent 1a79283 commit 7602cdd

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -285,14 +285,16 @@ Status ProcessMachCore::DoLoadCore() {
285285
ObjectFile::BinaryType type;
286286
if (core_objfile->GetCorefileMainBinaryInfo(objfile_binary_addr,
287287
objfile_binary_uuid, type)) {
288-
if (objfile_binary_addr != LLDB_INVALID_ADDRESS)
289-
{
288+
if (objfile_binary_addr != LLDB_INVALID_ADDRESS) {
289+
if (type == ObjectFile::eBinaryTypeUser)
290+
m_dyld_addr = objfile_binary_addr;
291+
else
290292
m_mach_kernel_addr = objfile_binary_addr;
291-
found_main_binary_definitively = true;
292-
LLDB_LOGF(log,
293-
"ProcessMachCore::DoLoadCore: using kernel address 0x%" PRIx64
294-
" from LC_NOTE 'main bin spec' load command.",
295-
m_mach_kernel_addr);
293+
found_main_binary_definitively = true;
294+
LLDB_LOGF(log,
295+
"ProcessMachCore::DoLoadCore: using kernel address 0x%" PRIx64
296+
" from LC_NOTE 'main bin spec' load command.",
297+
m_mach_kernel_addr);
296298
}
297299
}
298300

0 commit comments

Comments
 (0)