diff options
author | Greg Clayton <gclayton@apple.com> | 2014-07-15 00:25:59 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2014-07-15 00:25:59 +0000 |
commit | 45a44f3c4da7969ee8534ad16ea841ff301f6b1c (patch) | |
tree | 62e6fb51666e5c7e45aa89d2c48294474e661e55 /lldb/source/Interpreter | |
parent | 5a477c5e372bde1f96c1146b5a68f02c7e93f40b (diff) | |
download | bcm5719-llvm-45a44f3c4da7969ee8534ad16ea841ff301f6b1c.tar.gz bcm5719-llvm-45a44f3c4da7969ee8534ad16ea841ff301f6b1c.zip |
Any commands that are executed through the public interface using SBCommandInterpreter::HandleCommand() are assumed to be in non-interactive mode.
Any commands that want interactivity (stdin) will need to be executed through the normal command interpreter using the debugger's in/out/err file handles, or by using "command source".
Individual commands through the API will have their STDIN disabled. The STDOUT and STDERR will be redirected into the SBCommandReturnObject argument to SBCommandInterpreter::HandleCommand() as usual.
This helps with a deadlock situation in an IDE (Xcode) where the IDE was managing the breakpoint actions by setting a breakpoint callback and doing things manually.
<rdar://problem/17386271>
llvm-svn: 213023
Diffstat (limited to 'lldb/source/Interpreter')
-rw-r--r-- | lldb/source/Interpreter/CommandReturnObject.cpp | 18 | ||||
-rw-r--r-- | lldb/source/Interpreter/ScriptInterpreterPython.cpp | 4 |
2 files changed, 19 insertions, 3 deletions
diff --git a/lldb/source/Interpreter/CommandReturnObject.cpp b/lldb/source/Interpreter/CommandReturnObject.cpp index af9196f2894..1b541873506 100644 --- a/lldb/source/Interpreter/CommandReturnObject.cpp +++ b/lldb/source/Interpreter/CommandReturnObject.cpp @@ -46,7 +46,8 @@ CommandReturnObject::CommandReturnObject () : m_out_stream (), m_err_stream (), m_status (eReturnStatusStarted), - m_did_change_process_state (false) + m_did_change_process_state (false), + m_interactive (true) { } @@ -203,6 +204,7 @@ CommandReturnObject::Clear() static_cast<StreamString *>(stream_sp.get())->Clear(); m_status = eReturnStatusStarted; m_did_change_process_state = false; + m_interactive = true; } bool @@ -217,3 +219,17 @@ CommandReturnObject::SetDidChangeProcessState (bool b) m_did_change_process_state = b; } + +bool +CommandReturnObject::GetInteractive () const +{ + return m_interactive; +} + +void +CommandReturnObject::SetInteractive (bool b) +{ + m_interactive = b; +} + + diff --git a/lldb/source/Interpreter/ScriptInterpreterPython.cpp b/lldb/source/Interpreter/ScriptInterpreterPython.cpp index 5803fe7be25..ac4b29f1040 100644 --- a/lldb/source/Interpreter/ScriptInterpreterPython.cpp +++ b/lldb/source/Interpreter/ScriptInterpreterPython.cpp @@ -2438,7 +2438,7 @@ ScriptInterpreterPython::RunScriptBasedCommand(const char* impl_function, { error.SetErrorString("invalid Debugger pointer"); return false; - } + } bool ret_val = false; @@ -2446,7 +2446,7 @@ ScriptInterpreterPython::RunScriptBasedCommand(const char* impl_function, { Locker py_lock(this, - Locker::AcquireLock | Locker::InitSession, + Locker::AcquireLock | Locker::InitSession | cmd_retobj.GetInteractive() ? 0 : Locker::NoSTDIN, Locker::FreeLock | Locker::TearDownSession); SynchronicityHandler synch_handler(debugger_sp, |