[Lldb-commits] [lldb] r214428 - 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.

Greg Clayton gclayton at apple.com
Thu Jul 31 12:46:20 PDT 2014


Author: gclayton
Date: Thu Jul 31 14:46:19 2014
New Revision: 214428

URL: http://llvm.org/viewvc/llvm-project?rev=214428&view=rev
Log:
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> 

Modified:
    lldb/trunk/source/Interpreter/CommandInterpreter.cpp

Modified: lldb/trunk/source/Interpreter/CommandInterpreter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/CommandInterpreter.cpp?rev=214428&r1=214427&r2=214428&view=diff
==============================================================================
--- lldb/trunk/source/Interpreter/CommandInterpreter.cpp (original)
+++ lldb/trunk/source/Interpreter/CommandInterpreter.cpp Thu Jul 31 14:46:19 2014
@@ -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);
     





More information about the lldb-commits mailing list