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

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Mon Apr 6 14:39:29 PDT 2026


================
@@ -6266,6 +6266,45 @@ Process::GetInstrumentationRuntime(lldb::InstrumentationRuntimeType type) {
     return (*pos).second;
 }
 
+bool Process::SetInstrumentationRuntimeEnabled(InstrumentationRuntimeType irt,
+                                               bool enabled) {
+  assert(IsAlive());
+
+  if (auto instrumentation_runtime = GetInstrumentationRuntime(irt)) {
+    // This process already has an instance of this plugin so just
+    // enable/disable it
+    if (enabled)
+      return instrumentation_runtime->Enable();
+    return instrumentation_runtime->Disable();
+  }
+
+  // There's no instance of this plugin for this process.
+
+  if (!enabled)
+    return true; // nothing to do
----------------
JDevlieghere wrote:

```suggestion
    return true;
```

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


More information about the lldb-commits mailing list