diff --git a/lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp b/lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp --- a/lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp +++ b/lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp @@ -59,9 +59,12 @@ static constexpr PropertyDefinition g_properties[] = { {"enable-jit-breakpoint", OptionValue::eTypeBoolean, true, true, nullptr, - {}, "Enable breakpoint on __jit_debug_register_code."}}; + {}, "Enable breakpoint on __jit_debug_register_code."}, + {"enable-loader-for-darwin", OptionValue::eTypeBoolean, true, false, nullptr, + {}, "Enable process loader monitor for macOS - disabled there for " + "performance reasons."}}; -enum { ePropertyEnableJITBreakpoint }; +enum { ePropertyEnableJITBreakpoint, ePropertyEnableLoaderForDarwin }; class PluginProperties : public Properties { public: @@ -79,6 +82,12 @@ nullptr, ePropertyEnableJITBreakpoint, g_properties[ePropertyEnableJITBreakpoint].default_uint_value != 0); } + + bool GetEnableLoaderForDwarwin() const { + return m_collection_sp->GetPropertyAtIndexAsBoolean( + nullptr, ePropertyEnableLoaderForDarwin, + g_properties[ePropertyEnableLoaderForDarwin].default_uint_value != 0); + } }; typedef std::shared_ptr JITLoaderGDBPropertiesSP; @@ -401,7 +410,8 @@ JITLoaderSP JITLoaderGDB::CreateInstance(Process *process, bool force) { JITLoaderSP jit_loader_sp; ArchSpec arch(process->GetTarget().GetArchitecture()); - if (arch.GetTriple().getVendor() != llvm::Triple::Apple) + if (arch.GetTriple().getVendor() != llvm::Triple::Apple || + GetGlobalPluginProperties()->GetEnableLoaderForDwarwin()) jit_loader_sp.reset(new JITLoaderGDB(process)); return jit_loader_sp; }