From a8dd7094d364f6fb4921627a36b920e5098e88c3 Mon Sep 17 00:00:00 2001 From: David Spickett Date: Mon, 21 Jun 2021 15:10:46 +0000 Subject: [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 --- lldb/source/Interpreter/CommandObject.cpp | 4 ---- 1 file changed, 4 deletions(-) (limited to 'lldb/source/Interpreter/CommandObject.cpp') diff --git a/lldb/source/Interpreter/CommandObject.cpp b/lldb/source/Interpreter/CommandObject.cpp index a6fba35..51cb85f 100644 --- a/lldb/source/Interpreter/CommandObject.cpp +++ b/lldb/source/Interpreter/CommandObject.cpp @@ -219,7 +219,6 @@ bool CommandObject::CheckRequirements(CommandReturnObject &result) { // A process that is not running is considered paused. if (GetFlags().Test(eCommandProcessMustBeLaunched)) { result.AppendError("Process must exist."); - result.SetStatus(eReturnStatusFailed); return false; } } else { @@ -239,7 +238,6 @@ bool CommandObject::CheckRequirements(CommandReturnObject &result) { case eStateUnloaded: if (GetFlags().Test(eCommandProcessMustBeLaunched)) { result.AppendError("Process must be launched."); - result.SetStatus(eReturnStatusFailed); return false; } break; @@ -249,7 +247,6 @@ bool CommandObject::CheckRequirements(CommandReturnObject &result) { if (GetFlags().Test(eCommandProcessMustBePaused)) { result.AppendError("Process is running. Use 'process interrupt' to " "pause execution."); - result.SetStatus(eReturnStatusFailed); return false; } } @@ -351,7 +348,6 @@ bool CommandObject::ParseOptionsAndNotify(Args &args, Status error(group_options.NotifyOptionParsingFinished(&exe_ctx)); if (error.Fail()) { result.AppendError(error.AsCString()); - result.SetStatus(eReturnStatusFailed); return false; } return true; -- cgit v1.1