[Lldb-commits] [lldb] [LLDB][LLDB-DAP] Wire up DAP to listen to external progress events (PR #123826)

via lldb-commits lldb-commits at lists.llvm.org
Tue Jan 21 13:47:48 PST 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lldb

Author: Jacob Lalonde (Jlalond)

<details>
<summary>Changes</summary>

Recently I added SBProgress (#<!-- -->119052), and during that original commit I tested if the progress event was sent over LLDB-DAP, and it was. However upon the suggestion of @<!-- -->JDevlieghere and @<!-- -->labath we added an external category (#<!-- -->120171), which I did not test.

This small patch wires up DAP to listen for external events by default, and adds the external category to the SBDebugger enumeration.

---
Full diff: https://github.com/llvm/llvm-project/pull/123826.diff


2 Files Affected:

- (modified) lldb/include/lldb/API/SBDebugger.h (+2-2) 
- (modified) lldb/tools/lldb-dap/lldb-dap.cpp (+2-1) 


``````````diff
diff --git a/lldb/include/lldb/API/SBDebugger.h b/lldb/include/lldb/API/SBDebugger.h
index eb371e33c4951c..7f56bf34c37388 100644
--- a/lldb/include/lldb/API/SBDebugger.h
+++ b/lldb/include/lldb/API/SBDebugger.h
@@ -46,8 +46,8 @@ class LLDB_API SBDebugger {
       eBroadcastBitProgress = lldb::DebuggerBroadcastBit::eBroadcastBitProgress,
       eBroadcastBitWarning = lldb::DebuggerBroadcastBit::eBroadcastBitWarning,
       eBroadcastBitError = lldb::DebuggerBroadcastBit::eBroadcastBitError,
-      eBroadcastBitProgressCategory =
-          lldb::DebuggerBroadcastBit::eBroadcastBitProgressCategory,
+      eBroadcastBitExternalProgress =
+          lldb::DebuggerBroadcastBit::eBroadcastBitExternalProgress,
   };
   SBDebugger();
 
diff --git a/lldb/tools/lldb-dap/lldb-dap.cpp b/lldb/tools/lldb-dap/lldb-dap.cpp
index 7e8f7b5f6df679..6b12569d90a831 100644
--- a/lldb/tools/lldb-dap/lldb-dap.cpp
+++ b/lldb/tools/lldb-dap/lldb-dap.cpp
@@ -414,7 +414,8 @@ void SendStdOutStdErr(DAP &dap, lldb::SBProcess &process) {
 void ProgressEventThreadFunction(DAP &dap) {
   lldb::SBListener listener("lldb-dap.progress.listener");
   dap.debugger.GetBroadcaster().AddListener(
-      listener, lldb::SBDebugger::eBroadcastBitProgress);
+      listener, lldb::SBDebugger::eBroadcastBitProgress |
+                    lldb::SBDebugger::eBroadcastBitExternalProgress);
   dap.broadcaster.AddListener(listener, eBroadcastBitStopProgressThread);
   lldb::SBEvent event;
   bool done = false;

``````````

</details>


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


More information about the lldb-commits mailing list