================
@@ -51,9 +56,10 @@ void Progress::Increment(uint64_t amount, std::string 
update) {
 void Progress::ReportProgress(std::string update) {
   if (!m_complete) {
     // Make sure we only send one notification that indicates the progress is
-    // complete.
-    m_complete = m_completed == m_total;
-    Debugger::ReportProgress(m_id, m_title, std::move(update), m_completed,
-                             m_total, m_debugger_id);
+    // complete, and only modify m_complete is m_total isn't null.
+    if (m_total.has_value())
+      m_complete = m_completed == m_total.value();
+    Debugger::ReportProgress(m_id, m_title, m_details, m_completed,
+                             m_total.value_or(0), m_debugger_id);
----------------
clayborg wrote:

This will actually mess up reporting of progress reports with no valid total. 
We will always sent out `completed = 0` and `total = 0` for both the start and 
end events. The easiest way to fix this would be to leave `m_total` as a 
uint64_t inside of progress, but still allow the argument to be an optional in 
the constructor. We need `completed` to not be equal to `total`, the start 
progress event will have `completed=0` and `total=<non-zero>`, and then the end 
event will need to have `completed=total` where total is non zero.

https://github.com/llvm/llvm-project/pull/77547
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to