Make a way to set the result status for Python defined commands, and don't overwrite the status of the result if
the python command has set it. llvm-svn: 159273
This commit is contained in:
parent
a58862310c
commit
70f11f88e3
|
@ -61,6 +61,9 @@ public:
|
||||||
|
|
||||||
lldb::ReturnStatus
|
lldb::ReturnStatus
|
||||||
GetStatus();
|
GetStatus();
|
||||||
|
|
||||||
|
void
|
||||||
|
SetStatus (lldb::ReturnStatus status);
|
||||||
|
|
||||||
bool
|
bool
|
||||||
Succeeded ();
|
Succeeded ();
|
||||||
|
|
|
@ -50,6 +50,9 @@ public:
|
||||||
void
|
void
|
||||||
Clear();
|
Clear();
|
||||||
|
|
||||||
|
void
|
||||||
|
SetStatus (lldb::ReturnStatus status);
|
||||||
|
|
||||||
lldb::ReturnStatus
|
lldb::ReturnStatus
|
||||||
GetStatus();
|
GetStatus();
|
||||||
|
|
||||||
|
|
|
@ -160,6 +160,13 @@ SBCommandReturnObject::GetStatus()
|
||||||
return lldb::eReturnStatusInvalid;
|
return lldb::eReturnStatusInvalid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
SBCommandReturnObject::SetStatus(lldb::ReturnStatus status)
|
||||||
|
{
|
||||||
|
if (m_opaque_ap.get())
|
||||||
|
m_opaque_ap->SetStatus(status);
|
||||||
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
SBCommandReturnObject::Succeeded ()
|
SBCommandReturnObject::Succeeded ()
|
||||||
{
|
{
|
||||||
|
|
|
@ -1214,6 +1214,8 @@ protected:
|
||||||
|
|
||||||
Error error;
|
Error error;
|
||||||
|
|
||||||
|
result.SetStatus(eReturnStatusInvalid);
|
||||||
|
|
||||||
if (!scripter || scripter->RunScriptBasedCommand(m_function_name.c_str(),
|
if (!scripter || scripter->RunScriptBasedCommand(m_function_name.c_str(),
|
||||||
raw_command_line,
|
raw_command_line,
|
||||||
m_synchro,
|
m_synchro,
|
||||||
|
@ -1224,7 +1226,16 @@ protected:
|
||||||
result.SetStatus(eReturnStatusFailed);
|
result.SetStatus(eReturnStatusFailed);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
result.SetStatus(eReturnStatusSuccessFinishNoResult);
|
{
|
||||||
|
// Don't change the status if the command already set it...
|
||||||
|
if (result.GetStatus() == eReturnStatusInvalid)
|
||||||
|
{
|
||||||
|
if (result.GetOutputData() == NULL || result.GetOutputData()[0] == '\0')
|
||||||
|
result.SetStatus(eReturnStatusSuccessFinishNoResult);
|
||||||
|
else
|
||||||
|
result.SetStatus(eReturnStatusSuccessFinishResult);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return result.Succeeded();
|
return result.Succeeded();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue