yurydelendik updated this revision to Diff 185053.
yurydelendik added a comment.
Fix GetEnableLoaderForDarwin name
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D57689/new/
https://reviews.llvm.org/D57689
Files:
lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp
Index: lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp
===================================================================
--- lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp
+++ 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 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 GetEnableLoaderForDarwin() const {
+ return m_collection_sp->GetPropertyAtIndexAsBoolean(
+ nullptr, ePropertyEnableLoaderForDarwin,
+ g_properties[ePropertyEnableLoaderForDarwin].default_uint_value != 0);
+ }
};
typedef std::shared_ptr<PluginProperties> 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()->GetEnableLoaderForDarwin())
jit_loader_sp.reset(new JITLoaderGDB(process));
return jit_loader_sp;
}
Index: lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp
===================================================================
--- lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp
+++ 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 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 GetEnableLoaderForDarwin() const {
+ return m_collection_sp->GetPropertyAtIndexAsBoolean(
+ nullptr, ePropertyEnableLoaderForDarwin,
+ g_properties[ePropertyEnableLoaderForDarwin].default_uint_value != 0);
+ }
};
typedef std::shared_ptr<PluginProperties> 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()->GetEnableLoaderForDarwin())
jit_loader_sp.reset(new JITLoaderGDB(process));
return jit_loader_sp;
}
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits