[Lldb-commits] [lldb] [lldb][progress] Always report progress upon Progress object destruction (PR #73605)

Chelsea Cassanova via lldb-commits lldb-commits at lists.llvm.org
Tue Nov 28 08:31:59 PST 2023


https://github.com/chelcassanova updated https://github.com/llvm/llvm-project/pull/73605

>From 8c29a2034a57174ec68f8c1f1a2c5c66a7988762 Mon Sep 17 00:00:00 2001
From: Chelsea Cassanova <chelsea_cassanova at apple.com>
Date: Mon, 27 Nov 2023 15:42:13 -0800
Subject: [PATCH 1/2] [lldb][progress] Always report progress upon Progress
 object destruction

This commit allows a final progress report upon the destruction of the
`Progress` object to happen at all times as opposed to when the progress
was not completed
---
 lldb/source/Core/Progress.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lldb/source/Core/Progress.cpp b/lldb/source/Core/Progress.cpp
index 08be73f1470f349..eee4d3955154ba9 100644
--- a/lldb/source/Core/Progress.cpp
+++ b/lldb/source/Core/Progress.cpp
@@ -32,8 +32,8 @@ Progress::~Progress() {
   std::lock_guard<std::mutex> guard(m_mutex);
   if (!m_completed) {
     m_completed = m_total;
-    ReportProgress();
   }
+  ReportProgress();
 }
 
 void Progress::Increment(uint64_t amount, std::string update) {

>From 67f5039850ebca4ae8730a1f63edac8437eea32c Mon Sep 17 00:00:00 2001
From: Chelsea Cassanova <chelsea_cassanova at apple.com>
Date: Tue, 28 Nov 2023 08:27:33 -0800
Subject: [PATCH 2/2] fixup! [lldb][progress] Always report progress upon
 Progress object destruction

---
 lldb/source/Core/Progress.cpp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lldb/source/Core/Progress.cpp b/lldb/source/Core/Progress.cpp
index eee4d3955154ba9..ea3f874916a999f 100644
--- a/lldb/source/Core/Progress.cpp
+++ b/lldb/source/Core/Progress.cpp
@@ -30,9 +30,8 @@ Progress::~Progress() {
   // Make sure to always report progress completed when this object is
   // destructed so it indicates the progress dialog/activity should go away.
   std::lock_guard<std::mutex> guard(m_mutex);
-  if (!m_completed) {
+  if (!m_completed)
     m_completed = m_total;
-  }
   ReportProgress();
 }
 



More information about the lldb-commits mailing list