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

via lldb-commits lldb-commits at lists.llvm.org
Tue Jan 21 16:54:58 PST 2025


Author: Jacob Lalonde
Date: 2025-01-21T16:54:53-08:00
New Revision: b9813ceb95a81506b0bdedfae5e7b4b9f4d9c6bc

URL: https://github.com/llvm/llvm-project/commit/b9813ceb95a81506b0bdedfae5e7b4b9f4d9c6bc
DIFF: https://github.com/llvm/llvm-project/commit/b9813ceb95a81506b0bdedfae5e7b4b9f4d9c6bc.diff

LOG: [LLDB][LLDB-DAP] Wire up DAP to listen to external progress events (#123826)

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.

Added: 
    

Modified: 
    lldb/include/lldb/API/SBDebugger.h
    lldb/tools/lldb-dap/lldb-dap.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/include/lldb/API/SBDebugger.h b/lldb/include/lldb/API/SBDebugger.h
index eb371e33c4951c..e0819f1684f8b8 100644
--- a/lldb/include/lldb/API/SBDebugger.h
+++ b/lldb/include/lldb/API/SBDebugger.h
@@ -42,12 +42,16 @@ class LLDB_API SBInputReader {
 
 class LLDB_API SBDebugger {
 public:
-  FLAGS_ANONYMOUS_ENUM(){
-      eBroadcastBitProgress = lldb::DebuggerBroadcastBit::eBroadcastBitProgress,
-      eBroadcastBitWarning = lldb::DebuggerBroadcastBit::eBroadcastBitWarning,
-      eBroadcastBitError = lldb::DebuggerBroadcastBit::eBroadcastBitError,
-      eBroadcastBitProgressCategory =
-          lldb::DebuggerBroadcastBit::eBroadcastBitProgressCategory,
+  FLAGS_ANONYMOUS_ENUM() {
+    eBroadcastBitProgress = lldb::DebuggerBroadcastBit::eBroadcastBitProgress,
+    eBroadcastBitWarning = lldb::DebuggerBroadcastBit::eBroadcastBitWarning,
+    eBroadcastBitError = lldb::DebuggerBroadcastBit::eBroadcastBitError,
+    eBroadcastBitProgressCategory =
+        lldb::DebuggerBroadcastBit::eBroadcastBitProgressCategory,
+    eBroadcastBitExternalProgress =
+        lldb::DebuggerBroadcastBit::eBroadcastBitExternalProgress,
+    eBroadcastBitExternalProgressCategory =
+        lldb::DebuggerBroadcastBit::eBroadcastBitExternalProgressCategory,
   };
   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;


        


More information about the lldb-commits mailing list