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. It doesn't use any fancy terminal manipulation: it uses a simple carriage return (\r) to bring the cursor to the front of the line. If we support ANSI escape codes, we use a vt100 escape code to clear the current line when a progress event is complete. Otherwise we just overwrite it with as many spaces as the current terminal is wide.
Here's a recording of what this looks like in practice: https://asciinema.org/a/HBMDelpb9XDKccXZ09mgfuJ8R
Why is this conditional on someone else listening for this event? We don't e.g. suppress the "Thread #N" blurb if someone is listening for eBroadcastBitThreadSelected