Skip to content

Commit 0a3c328

Browse files
committed
Slight refinement to a change yesterday in metadata-added binaries
When ObjectFileMachO::LoadCoreFileImages load a binary into the target with a valid load address, we don't need to re-load its segments into the Target's SectionLoadList again. But we should still call ModulesDidLoad on these modules so breakpoints can be inserted etc. (cherry picked from commit 7f25c3e)
1 parent 5eb7248 commit 0a3c328

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7074,8 +7074,12 @@ bool ObjectFileMachO::LoadCoreFileImages(lldb_private::Process &process) {
70747074
&process, image.filename, image.uuid, image.load_address,
70757075
false /* value_is_offset */, image.currently_executing,
70767076
false /* notify */);
7077-
if (module_sp)
7077+
if (module_sp) {
7078+
// We've already set the load address in the Target,
7079+
// don't do any more processing on this module.
7080+
added_modules.Append(module_sp, false /* notify */);
70787081
continue;
7082+
}
70797083
}
70807084

70817085
// If we have a slide, we need to find the original binary
@@ -7086,8 +7090,12 @@ bool ObjectFileMachO::LoadCoreFileImages(lldb_private::Process &process) {
70867090
&process, image.filename, image.uuid, image.slide,
70877091
true /* value_is_offset */, image.currently_executing,
70887092
false /* notify */);
7089-
if (module_sp)
7093+
if (module_sp) {
7094+
// We've already set the load address in the Target,
7095+
// don't do any more processing on this module.
7096+
added_modules.Append(module_sp, false /* notify */);
70907097
continue;
7098+
}
70917099
}
70927100

70937101
// Try to find the binary by UUID or filename on the local

0 commit comments

Comments
 (0)