[Lldb-commits] [PATCH] D57689: Adds property to force enabling of GDB JIT loader for MacOS

Yury Delendik via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Feb 4 07:53:30 PST 2019


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;
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D57689.185053.patch
Type: text/x-patch
Size: 1781 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190204/1ff4bc0e/attachment.bin>


More information about the lldb-commits mailing list