[Lldb-commits] [PATCH] D128768: [lldb/Core] Fix finite progress event reporting

Med Ismail Bennani via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Jun 29 16:04:02 PDT 2022


mib updated this revision to Diff 441195.
mib marked an inline comment as done.
mib added a comment.

Refactor logging code


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

https://reviews.llvm.org/D128768

Files:
  lldb/source/Core/Debugger.cpp


Index: lldb/source/Core/Debugger.cpp
===================================================================
--- lldb/source/Core/Debugger.cpp
+++ lldb/source/Core/Debugger.cpp
@@ -1835,10 +1835,19 @@
   // going to show the progress.
   const uint64_t id = data->GetID();
   if (m_current_event_id) {
+    Log *log = GetLog(LLDBLog::Events);
+    if (log && log->GetVerbose()) {
+      StreamString log_stream;
+      log_stream.AsRawOstream()
+          << static_cast<void *>(this) << " Debugger(" << GetID()
+          << ")::HandleProgressEvent( m_current_event_id = "
+          << *m_current_event_id << ", data = { ";
+      data->Dump(&log_stream);
+      log_stream << " } )";
+      log->PutString(log_stream.GetString());
+    }
     if (id != *m_current_event_id)
       return;
-    if (data->GetCompleted())
-      m_current_event_id.reset();
   } else {
     m_current_event_id = id;
   }
@@ -1860,8 +1869,9 @@
   // Print over previous line, if any.
   output->Printf("\r");
 
-  if (data->GetCompleted()) {
+  if (data->GetCompleted() == data->GetTotal()) {
     // Clear the current line.
+    m_current_event_id.reset();
     output->Printf("\x1B[2K");
     output->Flush();
     return;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D128768.441195.patch
Type: text/x-patch
Size: 1204 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20220629/01e46217/attachment.bin>


More information about the lldb-commits mailing list