aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Commands/CommandObjectTarget.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/CommandObjectTarget.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/CommandObjectTarget.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectTarget.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/lldb/source/Commands/CommandObjectTarget.cpp b/lldb/source/Commands/CommandObjectTarget.cpp
index e3591e7..8467070 100644
--- a/lldb/source/Commands/CommandObjectTarget.cpp
+++ b/lldb/source/Commands/CommandObjectTarget.cpp
@@ -318,7 +318,6 @@ protected:
if (!target_sp) {
result.AppendError(error.AsCString());
- result.SetStatus(eReturnStatusFailed);
return false;
}
@@ -342,7 +341,6 @@ protected:
Status err = platform_sp->PutFile(file_spec, remote_file);
if (err.Fail()) {
result.AppendError(err.AsCString());
- result.SetStatus(eReturnStatusFailed);
return false;
}
}
@@ -357,7 +355,6 @@ protected:
Status err = platform_sp->GetFile(remote_file, file_spec);
if (err.Fail()) {
result.AppendError(err.AsCString());
- result.SetStatus(eReturnStatusFailed);
return false;
}
} else {
@@ -851,9 +848,8 @@ protected:
}
if (matches == 0) {
- result.GetErrorStream().Printf(
- "error: can't find global variable '%s'\n", arg.c_str());
- result.SetStatus(eReturnStatusFailed);
+ result.AppendErrorWithFormat("can't find global variable '%s'",
+ arg.c_str());
return false;
} else {
for (uint32_t global_idx = 0; global_idx < matches; ++global_idx) {
@@ -2540,7 +2536,6 @@ protected:
else
result.AppendErrorWithFormat("unsupported module: %s",
entry.c_str());
- result.SetStatus(eReturnStatusFailed);
return false;
} else {
flush = true;