LLDB-mi have 3 threads.
- Wait for input.
- Process commands.
- Process events.
This revision merges 1 & 2. Same thread waits on input and then process the
command. This way, no synchronization is needed between first and 2nd. Also it is
easy to check when to exit.
This revision just makes the minimal changes to use one thread for reading intput
and then processnig the commands. A lot of code has become redundant now. I will
clean it up gradually.
All lldb-mi tests pass with gcc and clang as test compiler. Also did minimal testing
on command line and works ok. The "quit" and "-gdb-exit" command close the application
without needing any further return.
After this revision goes in, it will not be possible to give the name of the
executable on command line and lldb-mi accepting it. This functionality is already
stubbed out in the code by he following #ifdef so we will not lose anything.
MICONFIG_ENABLE_MI_DRIVER_MI_MODE_CMDLINE_ARG_EXECUTABLE_DEBUG_SESSION
For posix system, it is even possible to make lldb-mi a single thread app. But on
windows, it is difficult to wait on stdin with timeout like what you can do with
select. So next best thing is to use 2 threads instead of 3.
Let's do it the same way as in MICmnStreamStdinLinux.cpp: