[Lldb-commits] [lldb] [LLDB] Support enabling/disabling InstrumentationRuntime plugins during a debug session (PR #190083)

Dan Liew via lldb-commits lldb-commits at lists.llvm.org
Tue Apr 7 15:50:30 PDT 2026


================
@@ -2464,7 +2489,36 @@ PluginManager::GetInstrumentationRuntimePluginInfo() {
 }
 bool PluginManager::SetInstrumentationRuntimePluginEnabled(llvm::StringRef name,
                                                            bool enable) {
-  return GetInstrumentationRuntimeInstances().SetInstanceEnabled(name, enable);
+  if (!GetInstrumentationRuntimeInstances().SetInstanceEnabled(name, enable))
+    return false;
+
+  // Find the `InstrumentationRuntimeType` from the plugin name
+  auto type_cb = GetInstrumentationRuntimeInstances().GetTypeCallbackForName(
+      name, /*enabled_only=*/false);
+  if (!type_cb)
+    return false;
+  auto instrumentation_ty = type_cb();
+
+  // Notify all alive processes to enable/disable the plugin
+  bool success = true;
+  for (size_t di = 0; di < Debugger::GetNumDebuggers(); ++di) {
+    DebuggerSP debugger_sp = Debugger::GetDebuggerAtIndex(di);
+    if (!debugger_sp)
----------------
delcypher wrote:

@JDevlieghere I've tried to fix this using the hacky way for now because changing Debugger to `std::recursive_mutex` seems like a change that deserves its own commit. Please let me know you think we should proceed.

https://github.com/llvm/llvm-project/pull/190083


More information about the lldb-commits mailing list