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;
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;
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits