summaryrefslogtreecommitdiffstats
path: root/lldb/source/Interpreter/CommandInterpreter.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2014-07-31 19:46:19 +0000
committerGreg Clayton <gclayton@apple.com>2014-07-31 19:46:19 +0000
commit380f3d83340fbb118666c29f13b5e8f9ab701430 (patch)
treeee4748f299fdb5953b55db8265e3817010bd0406 /lldb/source/Interpreter/CommandInterpreter.cpp
parent0c54419d5d05d047778094ebf58fa91a37d24b6e (diff)
downloadbcm5719-llvm-380f3d83340fbb118666c29f13b5e8f9ab701430.tar.gz
bcm5719-llvm-380f3d83340fbb118666c29f13b5e8f9ab701430.zip
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. <rdar://problem/17872824> llvm-svn: 214428
Diffstat (limited to 'lldb/source/Interpreter/CommandInterpreter.cpp')
-rw-r--r--lldb/source/Interpreter/CommandInterpreter.cpp38
1 files changed, 16 insertions, 22 deletions
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);
OpenPOWER on IntegriCloud