diff --git a/lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp b/lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp --- a/lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp +++ b/lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp @@ -327,9 +327,11 @@ // corefile core_objfile->LoadCoreFileImages(*this); - // LoadCoreFileImges may have set the dynamic loader; if we now have - // a dynamic loader, save its name so we don't un-set it later. - if (GetDynamicLoader()) + // LoadCoreFileImges may have set the dynamic loader, e.g. in + // PlatformDarwinKernel::LoadPlatformBinaryAndSetup(). + // If we now have a dynamic loader, save its name so we don't + // un-set it later. + if (m_dyld_up.get()) m_dyld_plugin_name = GetDynamicLoader()->GetPluginName(); }