[Lldb-commits] [lldb] [lldb][progress] Hook up new broadcast bit and progress manager (PR #83069)
Jonas Devlieghere via lldb-commits
lldb-commits at lists.llvm.org
Wed Feb 28 09:04:09 PST 2024
================
@@ -97,27 +98,37 @@ class Progress {
/// Used to indicate a non-deterministic progress report
static constexpr uint64_t kNonDeterministicTotal = UINT64_MAX;
+ /// Use a struct to send data from a Progress object to
+ /// the progress manager.
+ struct ProgressData {
+ /// The title of the progress activity, also used as a category to group
+ /// reports.
+ std::string title;
+ /// More specific information about the current file being displayed in the
+ /// report.
+ std::string details;
+ /// A unique integer identifier for progress reporting.
+ uint64_t progress_id;
+ /// How much work ([0...m_total]) that has been completed.
+ uint64_t completed;
+ /// Total amount of work, use a std::nullopt in the constructor for non
+ /// deterministic progress.
+ uint64_t total;
+ /// The optional debugger ID to report progress to. If this has no value
+ /// then all debuggers will receive this event.
+ std::optional<lldb::user_id_t> debugger_id;
+ };
+
private:
void ReportProgress();
static std::atomic<uint64_t> g_id;
- /// The title of the progress activity.
- std::string m_title;
- std::string m_details;
std::mutex m_mutex;
- /// A unique integer identifier for progress reporting.
- const uint64_t m_id;
- /// How much work ([0...m_total]) that has been completed.
- uint64_t m_completed;
- /// Total amount of work, use a std::nullopt in the constructor for non
- /// deterministic progress.
- uint64_t m_total;
- /// The optional debugger ID to report progress to. If this has no value then
- /// all debuggers will receive this event.
- std::optional<lldb::user_id_t> m_debugger_id;
/// Set to true when progress has been reported where m_completed == m_total
/// to ensure that we don't send progress updates after progress has
/// completed.
bool m_complete = false;
+ /// Data needed by the debugger to broadcast a progress event.
----------------
JDevlieghere wrote:
Suggestion:
```
/// Data data belonging to this Progress event. This data is used by the Debugger to broadcast the event and by the ProgressManager for bookkeeping.
```
https://github.com/llvm/llvm-project/pull/83069
More information about the lldb-commits
mailing list