[Lldb-commits] [lldb] [LLDB-DAP] SBDebugger don't prefix title on progress updates (PR #124648)

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Fri Feb 7 13:29:40 PST 2025


================
@@ -427,14 +452,27 @@ void ProgressEventThreadFunction(DAP &dap) {
           done = true;
         }
       } else {
-        uint64_t progress_id = 0;
-        uint64_t completed = 0;
-        uint64_t total = 0;
-        bool is_debugger_specific = false;
-        const char *message = lldb::SBDebugger::GetProgressFromEvent(
-            event, progress_id, completed, total, is_debugger_specific);
-        if (message)
-          dap.SendProgressEvent(progress_id, message, completed, total);
+        lldb::SBStructuredData data =
+            lldb::SBDebugger::GetProgressDataFromEvent(event);
+
+        uint64_t progress_id = GetUintFromStructuredData(data, "progress_id");
+        uint64_t completed = GetUintFromStructuredData(data, "completed");
+        uint64_t total = GetUintFromStructuredData(data, "total");
----------------
JDevlieghere wrote:

```suggestion
        const uint64_t progress_id = GetUintFromStructuredData(data, "progress_id");
        const uint64_t completed = GetUintFromStructuredData(data, "completed");
        const uint64_t total = GetUintFromStructuredData(data, "total");
        const std::string details = GetStringFromStructuredData(data, "details");
```

Nit: I'd make these const to make it clear that we're not going to change these, as opposed to the message that we're building. I'd also move details up here so that all the message building is co-located. 

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


More information about the lldb-commits mailing list