summaryrefslogtreecommitdiffstats
path: root/lldb/source/Commands/CommandObjectCommands.cpp
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2012-06-27 17:25:36 +0000
committerJim Ingham <jingham@apple.com>2012-06-27 17:25:36 +0000
commit70f11f88e3e2b95e030f26a05d1f20893746b410 (patch)
treec25457878a9c530216c707905bdc5a4c8a1d1acc /lldb/source/Commands/CommandObjectCommands.cpp
parenta58862310cb510b75d77b8cf156d8bb5192b7e20 (diff)
downloadbcm5719-llvm-70f11f88e3e2b95e030f26a05d1f20893746b410.tar.gz
bcm5719-llvm-70f11f88e3e2b95e030f26a05d1f20893746b410.zip
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
Diffstat (limited to 'lldb/source/Commands/CommandObjectCommands.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectCommands.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/lldb/source/Commands/CommandObjectCommands.cpp b/lldb/source/Commands/CommandObjectCommands.cpp
index fd8efadc68f..bc26c74aa9d 100644
--- a/lldb/source/Commands/CommandObjectCommands.cpp
+++ b/lldb/source/Commands/CommandObjectCommands.cpp
@@ -1214,6 +1214,8 @@ protected:
Error error;
+ result.SetStatus(eReturnStatusInvalid);
+
if (!scripter || scripter->RunScriptBasedCommand(m_function_name.c_str(),
raw_command_line,
m_synchro,
@@ -1224,7 +1226,16 @@ protected:
result.SetStatus(eReturnStatusFailed);
}
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();
}
OpenPOWER on IntegriCloud