aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Commands/CommandObjectPlatform.cpp
diff options
context:
space:
mode:
authorDavid Spickett <david.spickett@linaro.org>2021-06-21 15:10:46 +0000
committerDavid Spickett <david.spickett@linaro.org>2021-06-22 15:28:28 +0000
commita8dd7094d364f6fb4921627a36b920e5098e88c3 (patch)
tree729d41dcf57c3d43d723ca8a6ac1376aff19b1fd /lldb/source/Commands/CommandObjectPlatform.cpp
parent873ff5a72864fdf60614cca8adbd0d869fc9a9a2 (diff)
downloadllvm-a8dd7094d364f6fb4921627a36b920e5098e88c3.zip
llvm-a8dd7094d364f6fb4921627a36b920e5098e88c3.tar.gz
llvm-a8dd7094d364f6fb4921627a36b920e5098e88c3.tar.bz2
[lldb] Remove more redundant SetStatus(eReturnStatusFailed)
Mostly by converting uses of GetErrorStream to AppendError, so that the call to SetStatus is implicit. Some remain where it isn't certain that you'll have a message to set, or you want the output to be on stdout. One place in CommandObjectWatchpoint previously didn't set the status to failed at all. However it's pretty obvious that it should do so. Reviewed By: teemperor Differential Revision: https://reviews.llvm.org/D104697
Diffstat (limited to 'lldb/source/Commands/CommandObjectPlatform.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectPlatform.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/lldb/source/Commands/CommandObjectPlatform.cpp b/lldb/source/Commands/CommandObjectPlatform.cpp
index 16fe05a..fab1ddc 100644
--- a/lldb/source/Commands/CommandObjectPlatform.cpp
+++ b/lldb/source/Commands/CommandObjectPlatform.cpp
@@ -820,10 +820,8 @@ public:
bool DoExecute(Args &args, CommandReturnObject &result) override {
// If the number of arguments is incorrect, issue an error message.
if (args.GetArgumentCount() != 2) {
- result.GetErrorStream().Printf("error: required arguments missing; "
- "specify both the source and destination "
- "file paths\n");
- result.SetStatus(eReturnStatusFailed);
+ result.AppendError("required arguments missing; specify both the "
+ "source and destination file paths");
return false;
}
@@ -894,10 +892,8 @@ public:
bool DoExecute(Args &args, CommandReturnObject &result) override {
// If the number of arguments is incorrect, issue an error message.
if (args.GetArgumentCount() != 1) {
- result.GetErrorStream().Printf("error: required argument missing; "
- "specify the source file path as the only "
- "argument\n");
- result.SetStatus(eReturnStatusFailed);
+ result.AppendError("required argument missing; specify the source file "
+ "path as the only argument");
return false;
}