[lldb] Show progress events in the command line driver
authorJonas Devlieghere <jonas@devlieghere.com>
Sat, 5 Mar 2022 23:45:52 +0000 (15:45 -0800)
committerJonas Devlieghere <jonas@devlieghere.com>
Wed, 9 Mar 2022 02:24:26 +0000 (18:24 -0800)
commit5a27b99825a5ba3a7a2eec3d35aea381a3ba9a31
treec6c47951412fd05f3a33b207a870ab508487fe75
parentbfab18d86b2784364227631f51735fe17ee82b40
[lldb] Show progress events in the command line driver

This patch adds support for showing progress events when using lldb on
the command line. It spawns a separate thread that listens for progress
events and prints them to the debugger's output stream.

It's nothing fancy (yet), for now it just prints the progress message.
If we know the total number of items being processed, we prefix the
message with something like [1/100], similar to ninja's output.

This patch doesn't use any fancy terminal manipulation: it uses a simple
carriage return (\r) to bring the cursor to the front of the line and
vt100 escape codes to clear the (rest) of the line.

Differential revision: https://reviews.llvm.org/D120972
lldb/include/lldb/Core/Debugger.h
lldb/source/Core/CoreProperties.td
lldb/source/Core/Debugger.cpp
lldb/source/Symbol/LocateSymbolFile.cpp