[Lldb-commits] [lldb] r208336 - lldb TOT is dropping the last entry for multi-line IOHandlers that use the IOHandlerDelegateMultiline.

Greg Clayton gclayton at apple.com
Thu May 8 09:59:01 PDT 2014


Author: gclayton
Date: Thu May  8 11:59:00 2014
New Revision: 208336

URL: http://llvm.org/viewvc/llvm-project?rev=208336&view=rev
Log:
lldb TOT is dropping the last entry for multi-line IOHandlers that use the IOHandlerDelegateMultiline.

<rdar://problem/16844164>

Modified:
    lldb/trunk/include/lldb/Core/IOHandler.h
    lldb/trunk/source/Commands/CommandObjectBreakpointCommand.cpp
    lldb/trunk/source/Commands/CommandObjectCommands.cpp
    lldb/trunk/source/Commands/CommandObjectTarget.cpp
    lldb/trunk/source/Commands/CommandObjectType.cpp
    lldb/trunk/source/Commands/CommandObjectWatchpointCommand.cpp
    lldb/trunk/source/Core/IOHandler.cpp
    lldb/trunk/source/Interpreter/ScriptInterpreterPython.cpp

Modified: lldb/trunk/include/lldb/Core/IOHandler.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/IOHandler.h?rev=208336&r1=208335&r2=208336&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/IOHandler.h (original)
+++ lldb/trunk/include/lldb/Core/IOHandler.h Thu May  8 11:59:00 2014
@@ -337,11 +337,9 @@ namespace lldb_private {
     {
     public:
         IOHandlerDelegateMultiline (const char *end_line,
-                                    bool remove_end_line,
                                     Completion completion = Completion::None) :
             IOHandlerDelegate (completion),
-            m_end_line((end_line && end_line[0]) ? end_line : ""),
-            m_remove_end_line (remove_end_line)
+            m_end_line((end_line && end_line[0]) ? end_line : "")
         {
         }
         
@@ -378,8 +376,6 @@ namespace lldb_private {
                 // getting our multiple lines.
                 if (lines[line_idx] == m_end_line)
                 {
-                    if (m_remove_end_line)
-                        lines.PopBack();
                     return LineStatus::Done;
                 }
             }
@@ -387,7 +383,6 @@ namespace lldb_private {
         }
     protected:
         const std::string m_end_line;
-        const bool m_remove_end_line;
     };
     
     

Modified: lldb/trunk/source/Commands/CommandObjectBreakpointCommand.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectBreakpointCommand.cpp?rev=208336&r1=208335&r2=208336&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectBreakpointCommand.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectBreakpointCommand.cpp Thu May  8 11:59:00 2014
@@ -46,7 +46,7 @@ public:
                              "add",
                              "Add a set of commands to a breakpoint, to be executed whenever the breakpoint is hit.",
                              NULL),
-    IOHandlerDelegateMultiline ("DONE", true, IOHandlerDelegate::Completion::LLDBCommand),
+    IOHandlerDelegateMultiline ("DONE", IOHandlerDelegate::Completion::LLDBCommand),
         m_options (interpreter)
     {
         SetHelpLong (

Modified: lldb/trunk/source/Commands/CommandObjectCommands.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectCommands.cpp?rev=208336&r1=208335&r2=208336&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectCommands.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectCommands.cpp Thu May  8 11:59:00 2014
@@ -1567,7 +1567,7 @@ public:
                              "command script add",
                              "Add a scripted function as an LLDB command.",
                              NULL),
-        IOHandlerDelegateMultiline ("DONE", true),
+        IOHandlerDelegateMultiline ("DONE"),
         m_options (interpreter)
     {
         CommandArgumentEntry arg1;

Modified: lldb/trunk/source/Commands/CommandObjectTarget.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectTarget.cpp?rev=208336&r1=208335&r2=208336&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectTarget.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectTarget.cpp Thu May  8 11:59:00 2014
@@ -4908,7 +4908,7 @@ public:
                              "target stop-hook add",
                              "Add a hook to be executed when the target stops.",
                              "target stop-hook add"),
-        IOHandlerDelegateMultiline ("DONE", true, IOHandlerDelegate::Completion::LLDBCommand),
+        IOHandlerDelegateMultiline ("DONE", IOHandlerDelegate::Completion::LLDBCommand),
         m_options (interpreter)
     {
     }

Modified: lldb/trunk/source/Commands/CommandObjectType.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectType.cpp?rev=208336&r1=208335&r2=208336&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectType.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectType.cpp Thu May  8 11:59:00 2014
@@ -1718,7 +1718,7 @@ CommandObjectTypeSummaryAdd::CommandObje
                          "type summary add",
                          "Add a new summary style for a type.",
                          NULL),
-    IOHandlerDelegateMultiline ("DONE", true),
+    IOHandlerDelegateMultiline ("DONE"),
     m_options (interpreter)
 {
     CommandArgumentEntry type_arg;
@@ -3882,7 +3882,7 @@ CommandObjectTypeSynthAdd::CommandObject
                          "type synthetic add",
                          "Add a new synthetic provider for a type.",
                          NULL),
-    IOHandlerDelegateMultiline ("DONE", true),
+    IOHandlerDelegateMultiline ("DONE"),
     m_options (interpreter)
 {
     CommandArgumentEntry type_arg;

Modified: lldb/trunk/source/Commands/CommandObjectWatchpointCommand.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectWatchpointCommand.cpp?rev=208336&r1=208335&r2=208336&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectWatchpointCommand.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectWatchpointCommand.cpp Thu May  8 11:59:00 2014
@@ -46,7 +46,7 @@ public:
                              "add",
                              "Add a set of commands to a watchpoint, to be executed whenever the watchpoint is hit.",
                              NULL),
-        IOHandlerDelegateMultiline("DONE", true, IOHandlerDelegate::Completion::LLDBCommand),
+        IOHandlerDelegateMultiline("DONE", IOHandlerDelegate::Completion::LLDBCommand),
         m_options (interpreter)
     {
         SetHelpLong (

Modified: lldb/trunk/source/Core/IOHandler.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/IOHandler.cpp?rev=208336&r1=208335&r2=208336&view=diff
==============================================================================
--- lldb/trunk/source/Core/IOHandler.cpp (original)
+++ lldb/trunk/source/Core/IOHandler.cpp Thu May  8 11:59:00 2014
@@ -529,6 +529,7 @@ IOHandlerEditline::GetLines (StringList
     else
     {
         LineStatus lines_status = LineStatus::Success;
+        Error error;
 
         while (lines_status == LineStatus::Success)
         {
@@ -551,7 +552,6 @@ IOHandlerEditline::GetLines (StringList
                 else
                 {
                     lines.AppendString(line);
-                    Error error;
                     lines_status = m_delegate.IOHandlerLinesUpdated(*this, lines, lines.GetSize() - 1, error);
                 }
             }
@@ -560,6 +560,11 @@ IOHandlerEditline::GetLines (StringList
                 lines_status = LineStatus::Done;
             }
         }
+        
+        // Call the IOHandlerLinesUpdated function with UINT32_MAX as the line
+        // number to indicate all lines are complete
+        m_delegate.IOHandlerLinesUpdated(*this, lines, UINT32_MAX, error);
+
         success = lines.GetSize() > 0;
     }
     return success;

Modified: lldb/trunk/source/Interpreter/ScriptInterpreterPython.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/ScriptInterpreterPython.cpp?rev=208336&r1=208335&r2=208336&view=diff
==============================================================================
--- lldb/trunk/source/Interpreter/ScriptInterpreterPython.cpp (original)
+++ lldb/trunk/source/Interpreter/ScriptInterpreterPython.cpp Thu May  8 11:59:00 2014
@@ -140,7 +140,7 @@ ScriptInterpreterPython::Locker::~Locker
 
 ScriptInterpreterPython::ScriptInterpreterPython (CommandInterpreter &interpreter) :
     ScriptInterpreter (interpreter, eScriptLanguagePython),
-    IOHandlerDelegateMultiline("DONE", true),
+    IOHandlerDelegateMultiline("DONE"),
     m_saved_stdin (),
     m_saved_stdout (),
     m_saved_stderr (),





More information about the lldb-commits mailing list