Author: Jacob Lalonde Date: 2025-05-19T15:19:55-07:00 New Revision: f27cfeae6a544775803a50b3ed4c87e9193889a2
URL: https://github.com/llvm/llvm-project/commit/f27cfeae6a544775803a50b3ed4c87e9193889a2 DIFF: https://github.com/llvm/llvm-project/commit/f27cfeae6a544775803a50b3ed4c87e9193889a2.diff LOG: [LLDB][Progress-On-Dap] Have indeterminate progress actually send events. (#140162) Recently, I got a report how a user 'hung', and come to find out it's actually because DAP is checking percentage, and on non-deterministic events, we will effectively never send a progress event to DAP. Here we short circuit and don't view percentages for DAP messages and solely depend on the DAP 250ms throttle, which is probably still too aggressive, but better than no updates. Added: Modified: lldb/test/API/tools/lldb-dap/progress/TestDAP_Progress.py lldb/tools/lldb-dap/ProgressEvent.cpp Removed: ################################################################################ diff --git a/lldb/test/API/tools/lldb-dap/progress/TestDAP_Progress.py b/lldb/test/API/tools/lldb-dap/progress/TestDAP_Progress.py index 0f94b50c31fba..b47d52968f8a1 100755 --- a/lldb/test/API/tools/lldb-dap/progress/TestDAP_Progress.py +++ b/lldb/test/API/tools/lldb-dap/progress/TestDAP_Progress.py @@ -7,6 +7,7 @@ import json import os import time +import re import lldbdap_testcase @@ -16,6 +17,7 @@ def verify_progress_events( self, expected_title, expected_message=None, + expected_message_regex=None, expected_not_in_message=None, only_verify_first_update=False, ): @@ -36,6 +38,8 @@ def verify_progress_events( continue if expected_message is not None: self.assertIn(expected_message, message) + if expected_message_regex is not None: + self.assertTrue(re.match(expected_message_regex, message)) if expected_not_in_message is not None: self.assertNotIn(expected_not_in_message, message) update_found = True @@ -81,8 +85,7 @@ def test(self): self.verify_progress_events( expected_title="Progress tester: Initial Indeterminate Detail", - expected_message="Step 1", - only_verify_first_update=True, + expected_message_regex=r"Step [0-9]+", ) # Test no details indeterminate. diff --git a/lldb/tools/lldb-dap/ProgressEvent.cpp b/lldb/tools/lldb-dap/ProgressEvent.cpp index 6a4978c055e51..e53ec40180a6d 100644 --- a/lldb/tools/lldb-dap/ProgressEvent.cpp +++ b/lldb/tools/lldb-dap/ProgressEvent.cpp @@ -86,7 +86,7 @@ ProgressEvent::Create(uint64_t progress_id, std::optional<StringRef> message, bool ProgressEvent::EqualsForIDE(const ProgressEvent &other) const { return m_progress_id == other.m_progress_id && m_event_type == other.m_event_type && - m_percentage == other.m_percentage; + m_percentage == other.m_percentage && m_message == other.m_message; } ProgressEventType ProgressEvent::GetEventType() const { return m_event_type; } _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits