forked from OSchip/llvm-project
lldb TOT is dropping the last entry for multi-line IOHandlers that use the IOHandlerDelegateMultiline.
<rdar://problem/16844164> llvm-svn: 208336
This commit is contained in:
parent
61449c6b9a
commit
c3d874a584
|
@ -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;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -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 (
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -1718,7 +1718,7 @@ CommandObjectTypeSummaryAdd::CommandObjectTypeSummaryAdd (CommandInterpreter &in
|
|||
"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::CommandObjectTypeSynthAdd (CommandInterpreter &interp
|
|||
"type synthetic add",
|
||||
"Add a new synthetic provider for a type.",
|
||||
NULL),
|
||||
IOHandlerDelegateMultiline ("DONE", true),
|
||||
IOHandlerDelegateMultiline ("DONE"),
|
||||
m_options (interpreter)
|
||||
{
|
||||
CommandArgumentEntry type_arg;
|
||||
|
|
|
@ -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 (
|
||||
|
|
|
@ -529,6 +529,7 @@ IOHandlerEditline::GetLines (StringList &lines, bool &interrupted)
|
|||
else
|
||||
{
|
||||
LineStatus lines_status = LineStatus::Success;
|
||||
Error error;
|
||||
|
||||
while (lines_status == LineStatus::Success)
|
||||
{
|
||||
|
@ -551,7 +552,6 @@ IOHandlerEditline::GetLines (StringList &lines, bool &interrupted)
|
|||
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, bool &interrupted)
|
|||
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;
|
||||
|
|
|
@ -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 (),
|
||||
|
|
Loading…
Reference in New Issue