[LLDB] Implement interactive command interruption
authorAdrian McCarthy <amccarth@google.com>
Thu, 21 Sep 2017 19:36:52 +0000 (19:36 +0000)
committerAdrian McCarthy <amccarth@google.com>
Thu, 21 Sep 2017 19:36:52 +0000 (19:36 +0000)
commit977996d25b1f7ca0d4f4d2c863537a95287f096e
treec55232715bdbeb5879f4dae4f3cbbbf1babbeb1c
parentbfca5f433476e54433ec7e0b05a6310b4e0d4692
[LLDB] Implement interactive command interruption

The core of this change is the new CommandInterpreter::m_command_state, which
models the state transitions for interactive commands, including an
"interrupted" state transition.

In general, command interruption requires cooperation from the code executing
the command, which needs to poll for interruption requests through
CommandInterpreter::WasInterrupted().

CommandInterpreter::PrintCommandOutput() implements an optionally
interruptible printing of the command output, which for large outputs was
likely the longest blocking part.  (ex. target modules dump symtab on a
complex binary could take 10+ minutes)

patch by lemo

Differential Revision: https://reviews.llvm.org/D37923

llvm-svn: 313904
lldb/include/lldb/API/SBCommandInterpreter.h
lldb/include/lldb/Core/IOHandler.h
lldb/include/lldb/Interpreter/CommandInterpreter.h
lldb/scripts/interface/SBCommandInterpreter.i
lldb/source/API/SBCommandInterpreter.cpp
lldb/source/Commands/CommandObjectTarget.cpp
lldb/source/Core/Debugger.cpp
lldb/source/Interpreter/CommandInterpreter.cpp