[Lldb-commits] [lldb] 1167152 - [lldb] Always move the cursor back after printing progress

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Tue Mar 8 18:37:12 PST 2022


Author: Jonas Devlieghere
Date: 2022-03-08T18:35:09-08:00
New Revision: 116715270d07d18d101ff8d1b4a42cfd76c5cc55

URL: https://github.com/llvm/llvm-project/commit/116715270d07d18d101ff8d1b4a42cfd76c5cc55
DIFF: https://github.com/llvm/llvm-project/commit/116715270d07d18d101ff8d1b4a42cfd76c5cc55.diff

LOG: [lldb] Always move the cursor back after printing progress

This got lost while iterating on the patch. We need to always move the
cursor to the front of the line so that if something else
(asynchronously) prints to the debugger's output it overwrites the
progress message.

Added: 
    

Modified: 
    lldb/source/Core/Debugger.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Core/Debugger.cpp b/lldb/source/Core/Debugger.cpp
index 622dd6626423c..39e83de8b0347 100644
--- a/lldb/source/Core/Debugger.cpp
+++ b/lldb/source/Core/Debugger.cpp
@@ -1813,7 +1813,7 @@ void Debugger::HandleProgressEvent(const lldb::EventSP &event_sp) {
         "%s", ansi::FormatAnsiTerminalCodes(ansi_suffix, use_color).c_str());
 
   // Clear until the end of the line.
-  output.Printf("\x1B[K");
+  output.Printf("\x1B[K\r");
 
   // Flush the output.
   output.Flush();


        


More information about the lldb-commits mailing list