[Lldb-commits] [PATCH] D97739: Add a progress class that can track and report long running operations that happen in LLDB.

Greg Clayton via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Mar 1 15:49:22 PST 2021


clayborg added inline comments.


================
Comment at: lldb/include/lldb/Core/Progress.h:33
+  std::atomic<uint32_t> m_completed;
+  const uint64_t m_total;
+};
----------------
shafik wrote:
> Maybe I am misunderstanding but if we are going to have a total are we also going to variable to keep track of the expected total number of steps we have in the complete progress? 
Users currently have two options when creating a Progress object: 
- accurately specify the "uint64_t total" in the constructor, and then call Progress::Increment() as needed.
- just specify any number (UINT64_MAX is what all current code example do) and don't bother calling Progress::Increment()

Either way the Progress destructor will always report the progress with the value of "m_total" when the destructor is called. This is what all of the current code examples rely on. See my other comments as to why it is tricky to get an accurate total count for the various long running tasks.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D97739/new/

https://reviews.llvm.org/D97739



More information about the lldb-commits mailing list