diff options
-rw-r--r-- | lldb/include/lldb/Core/IOHandler.h | 9 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectBreakpointCommand.cpp | 2 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectCommands.cpp | 2 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectTarget.cpp | 2 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectType.cpp | 4 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectWatchpointCommand.cpp | 2 | ||||
-rw-r--r-- | lldb/source/Interpreter/ScriptInterpreterPython.cpp | 2 |
7 files changed, 15 insertions, 8 deletions
diff --git a/lldb/include/lldb/Core/IOHandler.h b/lldb/include/lldb/Core/IOHandler.h index 3b2580b8356..23cae9d4e6d 100644 --- a/lldb/include/lldb/Core/IOHandler.h +++ b/lldb/include/lldb/Core/IOHandler.h @@ -337,9 +337,11 @@ 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_end_line((end_line && end_line[0]) ? end_line : ""), + m_remove_end_line (remove_end_line) { } @@ -375,12 +377,17 @@ namespace lldb_private { // The last line was edited, if this line is empty, then we are done // getting our multiple lines. if (lines[line_idx] == m_end_line) + { + if (m_remove_end_line) + lines.PopBack(); return LineStatus::Done; + } } return LineStatus::Success; } protected: const std::string m_end_line; + const bool m_remove_end_line; }; diff --git a/lldb/source/Commands/CommandObjectBreakpointCommand.cpp b/lldb/source/Commands/CommandObjectBreakpointCommand.cpp index 0b28cc3e2cc..93166943f5c 100644 --- a/lldb/source/Commands/CommandObjectBreakpointCommand.cpp +++ b/lldb/source/Commands/CommandObjectBreakpointCommand.cpp @@ -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", IOHandlerDelegate::Completion::LLDBCommand), + IOHandlerDelegateMultiline ("DONE", true, IOHandlerDelegate::Completion::LLDBCommand), m_options (interpreter) { SetHelpLong ( diff --git a/lldb/source/Commands/CommandObjectCommands.cpp b/lldb/source/Commands/CommandObjectCommands.cpp index e3e113aac23..fb12c9451bf 100644 --- a/lldb/source/Commands/CommandObjectCommands.cpp +++ b/lldb/source/Commands/CommandObjectCommands.cpp @@ -1567,7 +1567,7 @@ public: "command script add", "Add a scripted function as an LLDB command.", NULL), - IOHandlerDelegateMultiline ("DONE"), + IOHandlerDelegateMultiline ("DONE", true), m_options (interpreter) { CommandArgumentEntry arg1; diff --git a/lldb/source/Commands/CommandObjectTarget.cpp b/lldb/source/Commands/CommandObjectTarget.cpp index de4877257e0..9fdd51bf740 100644 --- a/lldb/source/Commands/CommandObjectTarget.cpp +++ b/lldb/source/Commands/CommandObjectTarget.cpp @@ -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", IOHandlerDelegate::Completion::LLDBCommand), + IOHandlerDelegateMultiline ("DONE", true, IOHandlerDelegate::Completion::LLDBCommand), m_options (interpreter) { } diff --git a/lldb/source/Commands/CommandObjectType.cpp b/lldb/source/Commands/CommandObjectType.cpp index 364d9effb61..b4c30cab13d 100644 --- a/lldb/source/Commands/CommandObjectType.cpp +++ b/lldb/source/Commands/CommandObjectType.cpp @@ -1718,7 +1718,7 @@ CommandObjectTypeSummaryAdd::CommandObjectTypeSummaryAdd (CommandInterpreter &in "type summary add", "Add a new summary style for a type.", NULL), - IOHandlerDelegateMultiline ("DONE"), + IOHandlerDelegateMultiline ("DONE", true), m_options (interpreter) { CommandArgumentEntry type_arg; @@ -3882,7 +3882,7 @@ CommandObjectTypeSynthAdd::CommandObjectTypeSynthAdd (CommandInterpreter &interp "type synthetic add", "Add a new synthetic provider for a type.", NULL), - IOHandlerDelegateMultiline ("DONE"), + IOHandlerDelegateMultiline ("DONE", true), m_options (interpreter) { CommandArgumentEntry type_arg; diff --git a/lldb/source/Commands/CommandObjectWatchpointCommand.cpp b/lldb/source/Commands/CommandObjectWatchpointCommand.cpp index 0083ff140e5..45291a54bdb 100644 --- a/lldb/source/Commands/CommandObjectWatchpointCommand.cpp +++ b/lldb/source/Commands/CommandObjectWatchpointCommand.cpp @@ -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", IOHandlerDelegate::Completion::LLDBCommand), + IOHandlerDelegateMultiline("DONE", true, IOHandlerDelegate::Completion::LLDBCommand), m_options (interpreter) { SetHelpLong ( diff --git a/lldb/source/Interpreter/ScriptInterpreterPython.cpp b/lldb/source/Interpreter/ScriptInterpreterPython.cpp index da84353fed4..52920eddde2 100644 --- a/lldb/source/Interpreter/ScriptInterpreterPython.cpp +++ b/lldb/source/Interpreter/ScriptInterpreterPython.cpp @@ -140,7 +140,7 @@ ScriptInterpreterPython::Locker::~Locker() ScriptInterpreterPython::ScriptInterpreterPython (CommandInterpreter &interpreter) : ScriptInterpreter (interpreter, eScriptLanguagePython), - IOHandlerDelegateMultiline("DONE"), + IOHandlerDelegateMultiline("DONE", true), m_saved_stdin (), m_saved_stdout (), m_saved_stderr (), |