From 380f3d83340fbb118666c29f13b5e8f9ab701430 Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Thu, 31 Jul 2014 19:46:19 +0000 Subject: Fixed an issue where the LLDB command prompt isn't interactive if you use -o -O -S -s or specify a file on the command line. This means TAB completion wasn't working and editline wasn't being used. llvm-svn: 214428 --- lldb/source/Interpreter/CommandInterpreter.cpp | 38 +++++++++++--------------- 1 file changed, 16 insertions(+), 22 deletions(-) (limited to 'lldb/source/Interpreter/CommandInterpreter.cpp') diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp index d47b708f18d..30788cf3e84 100644 --- a/lldb/source/Interpreter/CommandInterpreter.cpp +++ b/lldb/source/Interpreter/CommandInterpreter.cpp @@ -3140,28 +3140,22 @@ void CommandInterpreter::RunCommandInterpreter(bool auto_handle_events, bool spawn_thread) { - const bool multiple_lines = false; // Only get one line at a time - if (m_command_io_handler_sp) - { - // Copy the current debugger file handles in case they changed. - m_command_io_handler_sp->GetInputStreamFile() = m_debugger.GetInputFile(); - m_command_io_handler_sp->GetOutputStreamFile() = m_debugger.GetOutputFile(); - m_command_io_handler_sp->GetErrorStreamFile() = m_debugger.GetErrorFile(); - m_command_io_handler_sp->SetIsDone(false); - } - else - { - m_command_io_handler_sp.reset(new IOHandlerEditline (m_debugger, - m_debugger.GetInputFile(), - m_debugger.GetOutputFile(), - m_debugger.GetErrorFile(), - eHandleCommandFlagEchoCommand | eHandleCommandFlagPrintResult, - "lldb", - m_debugger.GetPrompt(), - multiple_lines, - 0, // Don't show line numbers - *this)); - } + // Only get one line at a time + const bool multiple_lines = false; + + // Always re-create the IOHandlerEditline in case the input + // changed. The old instance might have had a non-interactive + // input and now it does or vice versa. + m_command_io_handler_sp.reset(new IOHandlerEditline (m_debugger, + m_debugger.GetInputFile(), + m_debugger.GetOutputFile(), + m_debugger.GetErrorFile(), + eHandleCommandFlagEchoCommand | eHandleCommandFlagPrintResult, + "lldb", + m_debugger.GetPrompt(), + multiple_lines, + 0, // Don't show line numbers + *this)); m_debugger.PushIOHandler(m_command_io_handler_sp); -- cgit v1.2.3