Skip to content

control Darwin parallel image loading with target.parallel-module-load #134437

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
lldb_tablegen(DynamicLoaderDarwinProperties.inc -gen-lldb-property-defs
SOURCE DynamicLoaderDarwinProperties.td
TARGET LLDBPluginDynamicLoaderDarwinPropertiesGen)

lldb_tablegen(DynamicLoaderDarwinPropertiesEnum.inc -gen-lldb-property-enum-defs
SOURCE DynamicLoaderDarwinProperties.td
TARGET LLDBPluginDynamicLoaderDarwinPropertiesEnumGen)

add_lldb_library(lldbPluginDynamicLoaderMacOSXDYLD PLUGIN
DynamicLoaderMacOSXDYLD.cpp
DynamicLoaderMacOS.cpp
DynamicLoaderDarwin.cpp
DynamicLoaderDarwinProperties.cpp

LINK_LIBS
lldbBreakpoint
Expand All @@ -25,7 +16,3 @@ add_lldb_library(lldbPluginDynamicLoaderMacOSXDYLD PLUGIN
Support
TargetParser
)

add_dependencies(lldbPluginDynamicLoaderMacOSXDYLD
LLDBPluginDynamicLoaderDarwinPropertiesGen
LLDBPluginDynamicLoaderDarwinPropertiesEnumGen)
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

#include "DynamicLoaderDarwin.h"

#include "DynamicLoaderDarwinProperties.h"
#include "lldb/Breakpoint/StoppointCallbackContext.h"
#include "lldb/Core/Debugger.h"
#include "lldb/Core/Module.h"
Expand Down Expand Up @@ -79,17 +78,6 @@ void DynamicLoaderDarwin::DidLaunch() {
SetNotificationBreakpoint();
}

void DynamicLoaderDarwin::CreateSettings(lldb_private::Debugger &debugger) {
if (!PluginManager::GetSettingForDynamicLoaderPlugin(
debugger, DynamicLoaderDarwinProperties::GetSettingName())) {
const bool is_global_setting = true;
PluginManager::CreateSettingForDynamicLoaderPlugin(
debugger,
DynamicLoaderDarwinProperties::GetGlobal().GetValueProperties(),
"Properties for the DynamicLoaderDarwin plug-in.", is_global_setting);
}
}

// Clear out the state of this class.
void DynamicLoaderDarwin::Clear(bool clear_process) {
std::lock_guard<std::recursive_mutex> guard(m_mutex);
Expand Down Expand Up @@ -670,8 +658,7 @@ DynamicLoaderDarwin::PreloadModulesFromImageInfos(
image_info, FindTargetModuleForImageInfo(image_info, true, nullptr));
};
auto it = image_infos.begin();
bool is_parallel_load =
DynamicLoaderDarwinProperties::GetGlobal().GetEnableParallelImageLoad();
bool is_parallel_load = m_process->GetTarget().GetParallelModuleLoad();
if (is_parallel_load) {
llvm::ThreadPoolTaskGroup taskGroup(Debugger::GetThreadPool());
for (size_t i = 0; i < size; ++i, ++it) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ class DynamicLoaderDarwin : public lldb_private::DynamicLoader {

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

static void CreateSettings(lldb_private::Debugger &debugger);

protected:
void PrivateInitialize(lldb_private::Process *process);

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -1149,8 +1149,7 @@ bool DynamicLoaderMacOSXDYLD::IsFullyInitialized() {

void DynamicLoaderMacOSXDYLD::Initialize() {
PluginManager::RegisterPlugin(GetPluginNameStatic(),
GetPluginDescriptionStatic(), CreateInstance,
DebuggerInitialize);
GetPluginDescriptionStatic(), CreateInstance);
DynamicLoaderMacOS::Initialize();
}

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

void DynamicLoaderMacOSXDYLD::DebuggerInitialize(
lldb_private::Debugger &debugger) {
CreateSettings(debugger);
}

llvm::StringRef DynamicLoaderMacOSXDYLD::GetPluginDescriptionStatic() {
return "Dynamic loader plug-in that watches for shared library loads/unloads "
"in MacOSX user processes.";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ class DynamicLoaderMacOSXDYLD : public lldb_private::DynamicLoaderDarwin {
static lldb_private::DynamicLoader *
CreateInstance(lldb_private::Process *process, bool force);

static void DebuggerInitialize(lldb_private::Debugger &debugger);

/// Called after attaching a process.
///
/// Allow DynamicLoader plug-ins to execute some code after
Expand Down