Skip to content

Commit 65813e0

Browse files
zhytyTom Yang
and
Tom Yang
authored
Control Darwin parallel image loading with target.parallel-module-load (llvm#134437)
A requested follow-up from llvm#130912 by @JDevlieghere to control Darwin parallel image loading with the same `target.parallel-module-load` that controls the POSIX dyld parallel image loading. Darwin parallel image loading was introduced by llvm#110646. This small change: * removes `plugin.dynamic-loader.darwin.experimental.enable-parallel-image-load` and associated code. * changes setting call site in `DynamicLoaderDarwin::PreloadModulesFromImageInfos` to use the new setting. Tested by running `ninja check-lldb` and loading some targets. Co-authored-by: Tom Yang <[email protected]>
1 parent a38ad6e commit 65813e0

8 files changed

+2
-133
lines changed
Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,7 @@
1-
lldb_tablegen(DynamicLoaderDarwinProperties.inc -gen-lldb-property-defs
2-
SOURCE DynamicLoaderDarwinProperties.td
3-
TARGET LLDBPluginDynamicLoaderDarwinPropertiesGen)
4-
5-
lldb_tablegen(DynamicLoaderDarwinPropertiesEnum.inc -gen-lldb-property-enum-defs
6-
SOURCE DynamicLoaderDarwinProperties.td
7-
TARGET LLDBPluginDynamicLoaderDarwinPropertiesEnumGen)
8-
91
add_lldb_library(lldbPluginDynamicLoaderMacOSXDYLD PLUGIN
102
DynamicLoaderMacOSXDYLD.cpp
113
DynamicLoaderMacOS.cpp
124
DynamicLoaderDarwin.cpp
13-
DynamicLoaderDarwinProperties.cpp
145

156
LINK_LIBS
167
lldbBreakpoint
@@ -25,7 +16,3 @@ add_lldb_library(lldbPluginDynamicLoaderMacOSXDYLD PLUGIN
2516
Support
2617
TargetParser
2718
)
28-
29-
add_dependencies(lldbPluginDynamicLoaderMacOSXDYLD
30-
LLDBPluginDynamicLoaderDarwinPropertiesGen
31-
LLDBPluginDynamicLoaderDarwinPropertiesEnumGen)

lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
#include "DynamicLoaderDarwin.h"
1010

11-
#include "DynamicLoaderDarwinProperties.h"
1211
#include "lldb/Breakpoint/StoppointCallbackContext.h"
1312
#include "lldb/Core/Debugger.h"
1413
#include "lldb/Core/Module.h"
@@ -79,17 +78,6 @@ void DynamicLoaderDarwin::DidLaunch() {
7978
SetNotificationBreakpoint();
8079
}
8180

82-
void DynamicLoaderDarwin::CreateSettings(lldb_private::Debugger &debugger) {
83-
if (!PluginManager::GetSettingForDynamicLoaderPlugin(
84-
debugger, DynamicLoaderDarwinProperties::GetSettingName())) {
85-
const bool is_global_setting = true;
86-
PluginManager::CreateSettingForDynamicLoaderPlugin(
87-
debugger,
88-
DynamicLoaderDarwinProperties::GetGlobal().GetValueProperties(),
89-
"Properties for the DynamicLoaderDarwin plug-in.", is_global_setting);
90-
}
91-
}
92-
9381
// Clear out the state of this class.
9482
void DynamicLoaderDarwin::Clear(bool clear_process) {
9583
std::lock_guard<std::recursive_mutex> guard(m_mutex);
@@ -670,8 +658,7 @@ DynamicLoaderDarwin::PreloadModulesFromImageInfos(
670658
image_info, FindTargetModuleForImageInfo(image_info, true, nullptr));
671659
};
672660
auto it = image_infos.begin();
673-
bool is_parallel_load =
674-
DynamicLoaderDarwinProperties::GetGlobal().GetEnableParallelImageLoad();
661+
bool is_parallel_load = m_process->GetTarget().GetParallelModuleLoad();
675662
if (is_parallel_load) {
676663
llvm::ThreadPoolTaskGroup taskGroup(Debugger::GetThreadPool());
677664
for (size_t i = 0; i < size; ++i, ++it) {

lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@ class DynamicLoaderDarwin : public lldb_private::DynamicLoader {
5858

5959
std::optional<lldb_private::Address> GetStartAddress() override;
6060

61-
static void CreateSettings(lldb_private::Debugger &debugger);
62-
6361
protected:
6462
void PrivateInitialize(lldb_private::Process *process);
6563

lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwinProperties.cpp

Lines changed: 0 additions & 53 deletions
This file was deleted.

lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwinProperties.h

Lines changed: 0 additions & 34 deletions
This file was deleted.

lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwinProperties.td

Lines changed: 0 additions & 8 deletions
This file was deleted.

lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1149,8 +1149,7 @@ bool DynamicLoaderMacOSXDYLD::IsFullyInitialized() {
11491149

11501150
void DynamicLoaderMacOSXDYLD::Initialize() {
11511151
PluginManager::RegisterPlugin(GetPluginNameStatic(),
1152-
GetPluginDescriptionStatic(), CreateInstance,
1153-
DebuggerInitialize);
1152+
GetPluginDescriptionStatic(), CreateInstance);
11541153
DynamicLoaderMacOS::Initialize();
11551154
}
11561155

@@ -1159,11 +1158,6 @@ void DynamicLoaderMacOSXDYLD::Terminate() {
11591158
PluginManager::UnregisterPlugin(CreateInstance);
11601159
}
11611160

1162-
void DynamicLoaderMacOSXDYLD::DebuggerInitialize(
1163-
lldb_private::Debugger &debugger) {
1164-
CreateSettings(debugger);
1165-
}
1166-
11671161
llvm::StringRef DynamicLoaderMacOSXDYLD::GetPluginDescriptionStatic() {
11681162
return "Dynamic loader plug-in that watches for shared library loads/unloads "
11691163
"in MacOSX user processes.";

lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ class DynamicLoaderMacOSXDYLD : public lldb_private::DynamicLoaderDarwin {
5050
static lldb_private::DynamicLoader *
5151
CreateInstance(lldb_private::Process *process, bool force);
5252

53-
static void DebuggerInitialize(lldb_private::Debugger &debugger);
54-
5553
/// Called after attaching a process.
5654
///
5755
/// Allow DynamicLoader plug-ins to execute some code after

0 commit comments

Comments
 (0)