diff options
author | David Spickett <david.spickett@linaro.org> | 2021-06-17 12:32:23 +0100 |
---|---|---|
committer | David Spickett <david.spickett@linaro.org> | 2021-06-17 14:39:35 +0100 |
commit | eaf60a4411f79a1addfa6c5d8ddf4b47e082881e (patch) | |
tree | 8ea76ea64b562f4386e0ce802a430a1292f5da89 /lldb/source/Commands/CommandObjectWatchpoint.cpp | |
parent | 3f596842e3d25009c4d62c75e5b24b515bde8e93 (diff) | |
download | llvm-eaf60a4411f79a1addfa6c5d8ddf4b47e082881e.zip llvm-eaf60a4411f79a1addfa6c5d8ddf4b47e082881e.tar.gz llvm-eaf60a4411f79a1addfa6c5d8ddf4b47e082881e.tar.bz2 |
[lldb] Remove redundant calls to set eReturnStatusFailed
This is part 2, covering the commands source.
Some uses remain where it's tricky to see what the
logic is or they are not used with AppendError.
Reviewed By: teemperor
Differential Revision: https://reviews.llvm.org/D104448
Diffstat (limited to 'lldb/source/Commands/CommandObjectWatchpoint.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectWatchpoint.cpp | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/lldb/source/Commands/CommandObjectWatchpoint.cpp b/lldb/source/Commands/CommandObjectWatchpoint.cpp index b8be19f..a426b38 100644 --- a/lldb/source/Commands/CommandObjectWatchpoint.cpp +++ b/lldb/source/Commands/CommandObjectWatchpoint.cpp @@ -42,7 +42,6 @@ static bool CheckTargetForWatchpointOperations(Target *target, target->GetProcessSP() && target->GetProcessSP()->IsAlive(); if (!process_is_valid) { result.AppendError("There's no process or it is not alive."); - result.SetStatus(eReturnStatusFailed); return false; } // Target passes our checks, return true. @@ -248,7 +247,6 @@ protected: if (!CommandObjectMultiwordWatchpoint::VerifyWatchpointIDs( target, command, wp_ids)) { result.AppendError("Invalid watchpoints specification."); - result.SetStatus(eReturnStatusFailed); return false; } @@ -311,7 +309,6 @@ protected: if (num_watchpoints == 0) { result.AppendError("No watchpoints exist to be enabled."); - result.SetStatus(eReturnStatusFailed); return false; } @@ -328,7 +325,6 @@ protected: if (!CommandObjectMultiwordWatchpoint::VerifyWatchpointIDs( target, command, wp_ids)) { result.AppendError("Invalid watchpoints specification."); - result.SetStatus(eReturnStatusFailed); return false; } @@ -388,7 +384,6 @@ protected: if (num_watchpoints == 0) { result.AppendError("No watchpoints exist to be disabled."); - result.SetStatus(eReturnStatusFailed); return false; } @@ -401,7 +396,6 @@ protected: result.SetStatus(eReturnStatusSuccessFinishNoResult); } else { result.AppendError("Disable all watchpoints failed\n"); - result.SetStatus(eReturnStatusFailed); } } else { // Particular watchpoints selected; disable them. @@ -409,7 +403,6 @@ protected: if (!CommandObjectMultiwordWatchpoint::VerifyWatchpointIDs( target, command, wp_ids)) { result.AppendError("Invalid watchpoints specification."); - result.SetStatus(eReturnStatusFailed); return false; } @@ -509,7 +502,6 @@ protected: if (num_watchpoints == 0) { result.AppendError("No watchpoints exist to be deleted."); - result.SetStatus(eReturnStatusFailed); return false; } @@ -534,7 +526,6 @@ protected: if (!CommandObjectMultiwordWatchpoint::VerifyWatchpointIDs(target, command, wp_ids)) { result.AppendError("Invalid watchpoints specification."); - result.SetStatus(eReturnStatusFailed); return false; } @@ -639,7 +630,6 @@ protected: if (num_watchpoints == 0) { result.AppendError("No watchpoints exist to be ignored."); - result.SetStatus(eReturnStatusFailed); return false; } @@ -655,7 +645,6 @@ protected: if (!CommandObjectMultiwordWatchpoint::VerifyWatchpointIDs( target, command, wp_ids)) { result.AppendError("Invalid watchpoints specification."); - result.SetStatus(eReturnStatusFailed); return false; } @@ -768,7 +757,6 @@ protected: if (num_watchpoints == 0) { result.AppendError("No watchpoints exist to be modified."); - result.SetStatus(eReturnStatusFailed); return false; } @@ -782,7 +770,6 @@ protected: if (!CommandObjectMultiwordWatchpoint::VerifyWatchpointIDs( target, command, wp_ids)) { result.AppendError("Invalid watchpoints specification."); - result.SetStatus(eReturnStatusFailed); return false; } @@ -889,10 +876,8 @@ protected: // If no argument is present, issue an error message. There's no way to // set a watchpoint. if (command.GetArgumentCount() <= 0) { - result.GetErrorStream().Printf("error: required argument missing; " - "specify your program variable to watch " - "for\n"); - result.SetStatus(eReturnStatusFailed); + result.AppendError("required argument missing; " + "specify your program variable to watch for"); return false; } @@ -912,9 +897,7 @@ protected: // A simple watch variable gesture allows only one argument. if (command.GetArgumentCount() != 1) { - result.GetErrorStream().Printf( - "error: specify exactly one variable to watch for\n"); - result.SetStatus(eReturnStatusFailed); + result.AppendError("specify exactly one variable to watch for"); return false; } @@ -993,7 +976,6 @@ protected: addr, (uint64_t)size, command.GetArgumentAtIndex(0)); if (error.AsCString(nullptr)) result.AppendError(error.AsCString()); - result.SetStatus(eReturnStatusFailed); } return result.Succeeded(); @@ -1161,7 +1143,6 @@ protected: addr, (uint64_t)size); if (error.AsCString(nullptr)) result.AppendError(error.AsCString()); - result.SetStatus(eReturnStatusFailed); } return result.Succeeded(); |