diff --git a/lldb/source/API/SBCommandInterpreter.cpp b/lldb/source/API/SBCommandInterpreter.cpp --- a/lldb/source/API/SBCommandInterpreter.cpp +++ b/lldb/source/API/SBCommandInterpreter.cpp @@ -185,7 +185,6 @@ } else { result->AppendError( "SBCommandInterpreter or the command line is not valid"); - result->SetStatus(eReturnStatusFailed); } return result.GetStatus(); @@ -203,7 +202,6 @@ if (!IsValid()) { result->AppendError("SBCommandInterpreter is not valid."); - result->SetStatus(eReturnStatusFailed); return; } @@ -211,7 +209,6 @@ SBStream s; file.GetDescription(s); result->AppendErrorWithFormat("File is not valid: %s.", s.GetData()); - result->SetStatus(eReturnStatusFailed); } FileSpec tmp_spec = file.ref(); @@ -439,7 +436,6 @@ } else { result->AppendError( "SBCommandInterpreter or the command line is not valid"); - result->SetStatus(eReturnStatusFailed); } } @@ -469,7 +465,6 @@ m_opaque_ptr->SourceInitFileHome(result.ref()); } else { result->AppendError("SBCommandInterpreter is not valid"); - result->SetStatus(eReturnStatusFailed); } } @@ -487,7 +482,6 @@ m_opaque_ptr->SourceInitFileHome(result.ref(), is_repl); } else { result->AppendError("SBCommandInterpreter is not valid"); - result->SetStatus(eReturnStatusFailed); } } @@ -506,7 +500,6 @@ m_opaque_ptr->SourceInitFileCwd(result.ref()); } else { result->AppendError("SBCommandInterpreter is not valid"); - result->SetStatus(eReturnStatusFailed); } } diff --git a/lldb/source/Breakpoint/BreakpointIDList.cpp b/lldb/source/Breakpoint/BreakpointIDList.cpp --- a/lldb/source/Breakpoint/BreakpointIDList.cpp +++ b/lldb/source/Breakpoint/BreakpointIDList.cpp @@ -141,7 +141,6 @@ if (!error.Success()) { new_args.Clear(); result.AppendError(error.AsCString()); - result.SetStatus(eReturnStatusFailed); return; } else names_found.insert(std::string(current_arg)); @@ -170,7 +169,6 @@ new_args.Clear(); result.AppendErrorWithFormat("'%d' is not a valid breakpoint ID.\n", bp_id->GetBreakpointID()); - result.SetStatus(eReturnStatusFailed); return; } const size_t num_locations = breakpoint_sp->GetNumLocations(); @@ -199,7 +197,6 @@ new_args.Clear(); result.AppendErrorWithFormat("'%s' is not a valid breakpoint ID.\n", range_from.str().c_str()); - result.SetStatus(eReturnStatusFailed); return; } @@ -208,7 +205,6 @@ new_args.Clear(); result.AppendErrorWithFormat("'%s' is not a valid breakpoint ID.\n", range_to.str().c_str()); - result.SetStatus(eReturnStatusFailed); return; } break_id_t start_bp_id = start_bp->GetBreakpointID(); @@ -224,7 +220,6 @@ "both ends of range must specify" " a breakpoint location, or neither can " "specify a breakpoint location."); - result.SetStatus(eReturnStatusFailed); return; } @@ -247,7 +242,6 @@ " must be within the same major breakpoint; you specified two" " different major breakpoints, %d and %d.\n", start_bp_id, end_bp_id); - result.SetStatus(eReturnStatusFailed); return; } } diff --git a/lldb/source/Interpreter/CommandAlias.cpp b/lldb/source/Interpreter/CommandAlias.cpp --- a/lldb/source/Interpreter/CommandAlias.cpp +++ b/lldb/source/Interpreter/CommandAlias.cpp @@ -47,7 +47,6 @@ if (!args_or) { result.AppendError(toString(args_or.takeError())); result.AppendError("Unable to create requested alias.\n"); - result.SetStatus(eReturnStatusFailed); return false; } args = std::move(*args_or); diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp --- a/lldb/source/Interpreter/CommandInterpreter.cpp +++ b/lldb/source/Interpreter/CommandInterpreter.cpp @@ -1465,7 +1465,6 @@ "need at least %d arguments to use " "this alias.\n", index); - result.SetStatus(eReturnStatusFailed); return nullptr; } else { size_t strpos = raw_input_string.find(cmd_args.GetArgumentAtIndex(index)); @@ -1658,7 +1657,6 @@ if (WasInterrupted()) { result.AppendError("interrupted"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -1694,7 +1692,6 @@ } else { result.AppendErrorWithFormat("Could not find entry: %s in history", command_string.c_str()); - result.SetStatus(eReturnStatusFailed); return false; } } @@ -1708,7 +1705,6 @@ if (m_command_history.IsEmpty()) { result.AppendError("empty command"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -1717,7 +1713,6 @@ original_command_string = command_line; if (m_repeat_command.empty()) { result.AppendError("No auto repeat."); - result.SetStatus(eReturnStatusFailed); return false; } @@ -1731,7 +1726,6 @@ if (error.Fail()) { result.AppendError(error.AsCString()); - result.SetStatus(eReturnStatusFailed); return false; } @@ -1999,7 +1993,6 @@ "need at least %d arguments to use " "this alias.\n", index); - result.SetStatus(eReturnStatusFailed); return; } else { // Find and remove cmd_args.GetArgumentAtIndex(i) from raw_input_string @@ -2169,7 +2162,6 @@ result.SetStatus(eReturnStatusSuccessFinishNoResult); } else { result.AppendError(InitFileWarning); - result.SetStatus(eReturnStatusFailed); } } } @@ -2331,7 +2323,6 @@ "Aborting reading of commands after command #%" PRIu64 ": '%s' failed with %s", (uint64_t)idx, cmd, error_msg.str().c_str()); - result.SetStatus(eReturnStatusFailed); m_debugger.SetAsyncExecution(old_async_execution); return; } else if (options.GetPrintResults()) { @@ -2427,7 +2418,6 @@ result.AppendErrorWithFormat( "Error reading commands from file %s - file not found.\n", cmd_file.GetFilename().AsCString("")); - result.SetStatus(eReturnStatusFailed); return; } @@ -2439,7 +2429,6 @@ result.AppendErrorWithFormatv( "error: an error occurred read file '{0}': {1}\n", cmd_file_path, llvm::fmt_consume(input_file_up.takeError())); - result.SetStatus(eReturnStatusFailed); return; } FileSP input_file_sp = FileSP(std::move(input_file_up.get())); @@ -3184,7 +3173,6 @@ result.AppendErrorWithFormat("'%s' is not a valid command.\n", next_word.c_str()); } - result.SetStatus(eReturnStatusFailed); return nullptr; } @@ -3196,7 +3184,6 @@ cmd_obj->GetCommandName().str().c_str(), next_word.empty() ? "" : next_word.c_str(), next_word.empty() ? " -- " : " ", suffix.c_str()); - result.SetStatus(eReturnStatusFailed); return nullptr; } } else { @@ -3232,7 +3219,6 @@ result.AppendErrorWithFormat( "the '%s' command doesn't support the --gdb-format option\n", cmd_obj->GetCommandName().str().c_str()); - result.SetStatus(eReturnStatusFailed); return nullptr; } } @@ -3241,7 +3227,6 @@ default: result.AppendErrorWithFormat( "unknown command shorthand suffix: '%s'\n", suffix.c_str()); - result.SetStatus(eReturnStatusFailed); return nullptr; } } diff --git a/lldb/source/Interpreter/Options.cpp b/lldb/source/Interpreter/Options.cpp --- a/lldb/source/Interpreter/Options.cpp +++ b/lldb/source/Interpreter/Options.cpp @@ -137,7 +137,6 @@ result.SetStatus(eReturnStatusSuccessFinishNoResult); } else { result.AppendError("invalid combination of options for the given command"); - result.SetStatus(eReturnStatusFailed); } return options_are_valid; diff --git a/lldb/source/Interpreter/ScriptInterpreter.cpp b/lldb/source/Interpreter/ScriptInterpreter.cpp --- a/lldb/source/Interpreter/ScriptInterpreter.cpp +++ b/lldb/source/Interpreter/ScriptInterpreter.cpp @@ -36,14 +36,12 @@ void ScriptInterpreter::CollectDataForBreakpointCommandCallback( std::vector> &bp_options_vec, CommandReturnObject &result) { - result.SetStatus(eReturnStatusFailed); result.AppendError( "This script interpreter does not support breakpoint callbacks."); } void ScriptInterpreter::CollectDataForWatchpointCommandCallback( WatchpointOptions *bp_options, CommandReturnObject &result) { - result.SetStatus(eReturnStatusFailed); result.AppendError( "This script interpreter does not support watchpoint callbacks."); } diff --git a/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp b/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp --- a/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp +++ b/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp @@ -4187,7 +4187,6 @@ result.AppendErrorWithFormat("'%s' takes 1 argument of reduction name, " "and an optional kernel type list", m_cmd_name.c_str()); - result.SetStatus(eReturnStatusFailed); return false; } @@ -4201,7 +4200,6 @@ auto coord = m_options.m_have_coord ? &m_options.m_coord : nullptr; if (!runtime->PlaceBreakpointOnReduction(target, outstream, name, coord, m_options.m_kernel_types)) { - result.SetStatus(eReturnStatusFailed); result.AppendError("Error: unable to place breakpoint on reduction"); return false; } @@ -4289,7 +4287,6 @@ result.AppendErrorWithFormat( "'%s' takes 1 argument of kernel name, and an optional coordinate.", m_cmd_name.c_str()); - result.SetStatus(eReturnStatusFailed); return false; } @@ -4302,7 +4299,6 @@ auto name = command.GetArgumentAtIndex(0); auto coord = m_options.m_have_coord ? &m_options.m_coord : nullptr; if (!runtime->PlaceBreakpointOnKernel(target, outstream, name, coord)) { - result.SetStatus(eReturnStatusFailed); result.AppendErrorWithFormat( "Error: unable to set breakpoint on kernel '%s'", name); return false; @@ -4340,7 +4336,6 @@ if (argc != 1) { result.AppendErrorWithFormat( "'%s' takes 1 argument of 'enable' or 'disable'", m_cmd_name.c_str()); - result.SetStatus(eReturnStatusFailed); return false; } @@ -4359,7 +4354,6 @@ } else { result.AppendErrorWithFormat( "Argument must be either 'enable' or 'disable'"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -4566,7 +4560,6 @@ result.AppendErrorWithFormat("'%s' takes 1 argument, an allocation ID. " "As well as an optional -f argument", m_cmd_name.c_str()); - result.SetStatus(eReturnStatusFailed); return false; } @@ -4581,7 +4574,6 @@ if (!success) { result.AppendErrorWithFormat("invalid allocation id argument '%s'", id_cstr); - result.SetStatus(eReturnStatusFailed); return false; } @@ -4606,7 +4598,6 @@ std::string error = llvm::toString(file.takeError()); result.AppendErrorWithFormat("Couldn't open file '%s': %s", path.c_str(), error.c_str()); - result.SetStatus(eReturnStatusFailed); return false; } } else @@ -4715,7 +4706,6 @@ result.AppendErrorWithFormat( "'%s' takes 2 arguments, an allocation ID and filename to read from.", m_cmd_name.c_str()); - result.SetStatus(eReturnStatusFailed); return false; } @@ -4730,7 +4720,6 @@ if (!success) { result.AppendErrorWithFormat("invalid allocation id argument '%s'", id_cstr); - result.SetStatus(eReturnStatusFailed); return false; } @@ -4766,7 +4755,6 @@ result.AppendErrorWithFormat( "'%s' takes 2 arguments, an allocation ID and filename to read from.", m_cmd_name.c_str()); - result.SetStatus(eReturnStatusFailed); return false; } @@ -4781,7 +4769,6 @@ if (!success) { result.AppendErrorWithFormat("invalid allocation id argument '%s'", id_cstr); - result.SetStatus(eReturnStatusFailed); return false; } diff --git a/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp b/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp --- a/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp +++ b/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp @@ -910,7 +910,6 @@ if (!m_command_byte.GetOptionValue().OptionWasSet()) { result.AppendError( "the --command option must be set to a valid command byte"); - result.SetStatus(eReturnStatusFailed); } else { const uint64_t command_byte = m_command_byte.GetOptionValue().GetUInt64Value(0); @@ -933,7 +932,6 @@ "even number of ASCII hex " "characters: '%s'", ascii_hex_bytes_cstr); - result.SetStatus(eReturnStatusFailed); return false; } payload_bytes.resize(ascii_hex_bytes_cstr_len / 2); @@ -943,7 +941,6 @@ "ASCII hex characters (no " "spaces or hex prefixes): '%s'", ascii_hex_bytes_cstr); - result.SetStatus(eReturnStatusFailed); return false; } } @@ -970,30 +967,25 @@ else result.AppendErrorWithFormat("unknown error 0x%8.8x", error.GetError()); - result.SetStatus(eReturnStatusFailed); return false; } } else { result.AppendErrorWithFormat("process must be stopped in order " "to send KDP packets, state is %s", StateAsCString(state)); - result.SetStatus(eReturnStatusFailed); } } else { result.AppendError("invalid process"); - result.SetStatus(eReturnStatusFailed); } } else { result.AppendErrorWithFormat("invalid command byte 0x%" PRIx64 ", valid values are 1 - 255", command_byte); - result.SetStatus(eReturnStatusFailed); } } } else { result.AppendErrorWithFormat("'%s' takes no arguments, only options.", m_cmd_name.c_str()); - result.SetStatus(eReturnStatusFailed); } return false; } diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp --- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp @@ -5246,7 +5246,6 @@ "amount to be transferred when " "reading/writing", m_cmd_name.c_str()); - result.SetStatus(eReturnStatusFailed); return false; } @@ -5287,7 +5286,6 @@ result.AppendErrorWithFormat( "'%s' takes a one or more packet content arguments", m_cmd_name.c_str()); - result.SetStatus(eReturnStatusFailed); return false; } @@ -5337,7 +5335,6 @@ if (command.empty()) { result.AppendErrorWithFormat("'%s' takes a command string argument", m_cmd_name.c_str()); - result.SetStatus(eReturnStatusFailed); return false; } diff --git a/lldb/source/Plugins/Process/minidump/ProcessMinidump.cpp b/lldb/source/Plugins/Process/minidump/ProcessMinidump.cpp --- a/lldb/source/Plugins/Process/minidump/ProcessMinidump.cpp +++ b/lldb/source/Plugins/Process/minidump/ProcessMinidump.cpp @@ -880,7 +880,6 @@ if (argc > 0) { result.AppendErrorWithFormat("'%s' take no arguments, only options", m_cmd_name.c_str()); - result.SetStatus(eReturnStatusFailed); return false; } SetDefaultOptionsIfNoneAreSet(); diff --git a/lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp b/lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp --- a/lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp +++ b/lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp @@ -809,7 +809,6 @@ StructuredDataDarwinLog::GetStaticPluginName())) { result.AppendError("failed to get StructuredDataPlugin for " "the process"); - result.SetStatus(eReturnStatusFailed); } StructuredDataDarwinLog &plugin = *static_cast(plugin_sp.get()); @@ -833,7 +832,6 @@ // Report results. if (!error.Success()) { result.AppendError(error.AsCString()); - result.SetStatus(eReturnStatusFailed); // Our configuration failed, so we're definitely disabled. plugin.SetEnabled(false); } else {