Skip to content

Commit ceded41

Browse files
committed
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.
1 parent 9c4a168 commit ceded41

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7033,12 +7033,8 @@ bool ObjectFileMachO::LoadCoreFileImages(lldb_private::Process &process) {
70337033
image.load_address);
70347034
}
70357035
}
7036-
if (module_sp.get() && module_sp->GetObjectFile()) {
7036+
if (module_sp.get()) {
70377037
added_images = true;
7038-
if (module_sp->GetObjectFile()->GetType() ==
7039-
ObjectFile::eTypeExecutable) {
7040-
process.GetTarget().SetExecutableModule(module_sp, eLoadDependentsNo);
7041-
}
70427038
for (auto name_vmaddr_tuple : image.segment_load_addresses) {
70437039
SectionList *sectlist = module_sp->GetObjectFile()->GetSectionList();
70447040
if (sectlist) {

0 commit comments

Comments
 (0)