From ceded4153245322c45d28068860fb3d8d0a4884d Mon Sep 17 00:00:00 2001 From: Jason Molenda Date: Thu, 16 Sep 2021 01:36:56 -0700 Subject: [PATCH] Don't set executable file in ObjectFileMachO::LoadCoreFileImages When the corefile reader is adding binaries from the "all image infos" LC_NOTE in a Mach-O corefile, it would detect if the binary being added was an executable binary and set it as the Target's executable binary. This has the side effect of clearing the Target's image list, so if the executable was in the middle of the all image infos, the initial images would be dropped. There's no need to set the executable binary in the Target for these corefile processes, so instead of doing multiple passes over the list to find the executable, I'm dropping that. --- lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp index d96b591..99aef04 100644 --- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp +++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp @@ -7033,12 +7033,8 @@ bool ObjectFileMachO::LoadCoreFileImages(lldb_private::Process &process) { image.load_address); } } - if (module_sp.get() && module_sp->GetObjectFile()) { + if (module_sp.get()) { added_images = true; - if (module_sp->GetObjectFile()->GetType() == - ObjectFile::eTypeExecutable) { - process.GetTarget().SetExecutableModule(module_sp, eLoadDependentsNo); - } for (auto name_vmaddr_tuple : image.segment_load_addresses) { SectionList *sectlist = module_sp->GetObjectFile()->GetSectionList(); if (sectlist) { -- 2.7.4