diff --git a/lldb/source/Commands/CommandObjectApropos.cpp b/lldb/source/Commands/CommandObjectApropos.cpp --- a/lldb/source/Commands/CommandObjectApropos.cpp +++ b/lldb/source/Commands/CommandObjectApropos.cpp @@ -86,11 +86,9 @@ result.SetStatus(eReturnStatusSuccessFinishNoResult); } else { result.AppendError("'' is not a valid search word.\n"); - result.SetStatus(eReturnStatusFailed); } } else { result.AppendError("'apropos' must be called with exactly one argument.\n"); - result.SetStatus(eReturnStatusFailed); } return result.Succeeded(); diff --git a/lldb/source/Commands/CommandObjectBreakpoint.cpp b/lldb/source/Commands/CommandObjectBreakpoint.cpp --- a/lldb/source/Commands/CommandObjectBreakpoint.cpp +++ b/lldb/source/Commands/CommandObjectBreakpoint.cpp @@ -566,13 +566,11 @@ if (num_files == 0) { if (!GetDefaultFile(target, file, result)) { result.AppendError("No file supplied and no default file available."); - result.SetStatus(eReturnStatusFailed); return false; } } else if (num_files > 1) { result.AppendError("Only one file at a time is allowed for file and " "line breakpoints."); - result.SetStatus(eReturnStatusFailed); return false; } else file = m_options.m_filenames.GetFileSpecAtIndex(0); @@ -604,7 +602,6 @@ } else { result.AppendError("Only one shared library can be specified for " "address breakpoints."); - result.SetStatus(eReturnStatusFailed); return false; } break; @@ -639,7 +636,6 @@ result.AppendWarning( "Function name regex does not accept glob patterns."); } - result.SetStatus(eReturnStatusFailed); return false; } @@ -657,7 +653,6 @@ if (!GetDefaultFile(target, file, result)) { result.AppendError( "No files provided and could not find default file."); - result.SetStatus(eReturnStatusFailed); return false; } else { m_options.m_filenames.Append(file); @@ -669,7 +664,6 @@ result.AppendErrorWithFormat( "Source text regular expression could not be compiled: \"%s\"", llvm::toString(std::move(err)).c_str()); - result.SetStatus(eReturnStatusFailed); return false; } bp_sp = target.CreateSourceRegexBreakpoint( @@ -688,7 +682,6 @@ "Error setting extra exception arguments: %s", precond_error.AsCString()); target.RemoveBreakpointByID(bp_sp->GetID()); - result.SetStatus(eReturnStatusFailed); return false; } } break; @@ -703,7 +696,6 @@ result.AppendErrorWithFormat( "Error setting extra exception arguments: %s", error.AsCString()); target.RemoveBreakpointByID(bp_sp->GetID()); - result.SetStatus(eReturnStatusFailed); return false; } } break; @@ -723,7 +715,6 @@ result.AppendErrorWithFormat("Invalid breakpoint name: %s", name.c_str()); target.RemoveBreakpointByID(bp_sp->GetID()); - result.SetStatus(eReturnStatusFailed); return false; } } @@ -750,7 +741,6 @@ result.SetStatus(eReturnStatusSuccessFinishResult); } else if (!bp_sp) { result.AppendError("Breakpoint creation failed: No breakpoint created."); - result.SetStatus(eReturnStatusFailed); } return result.Succeeded(); @@ -767,12 +757,10 @@ if (cur_frame == nullptr) { result.AppendError( "No selected frame to use to find the default file."); - result.SetStatus(eReturnStatusFailed); return false; } else if (!cur_frame->HasDebugInformation()) { result.AppendError("Cannot use the selected frame to find the default " "file, it has no debug info."); - result.SetStatus(eReturnStatusFailed); return false; } else { const SymbolContext &sc = @@ -782,7 +770,6 @@ } else { result.AppendError("Can't find the file for the selected frame to " "use as the default file."); - result.SetStatus(eReturnStatusFailed); return false; } } @@ -923,7 +910,6 @@ if (num_breakpoints == 0) { result.AppendError("No breakpoints exist to be enabled."); - result.SetStatus(eReturnStatusFailed); return false; } @@ -1037,7 +1023,6 @@ if (num_breakpoints == 0) { result.AppendError("No breakpoints exist to be disabled."); - result.SetStatus(eReturnStatusFailed); return false; } @@ -1223,7 +1208,6 @@ result.SetStatus(eReturnStatusSuccessFinishNoResult); } else { result.AppendError("Invalid breakpoint ID."); - result.SetStatus(eReturnStatusFailed); } } @@ -1321,7 +1305,6 @@ // Early return if there's no breakpoint at all. if (num_breakpoints == 0) { result.AppendError("Breakpoint clear: No breakpoint cleared."); - result.SetStatus(eReturnStatusFailed); return result.Succeeded(); } @@ -1368,7 +1351,6 @@ result.SetStatus(eReturnStatusSuccessFinishNoResult); } else { result.AppendError("Breakpoint clear: No breakpoint cleared."); - result.SetStatus(eReturnStatusFailed); } return result.Succeeded(); @@ -1473,7 +1455,6 @@ if (num_breakpoints == 0) { result.AppendError("No breakpoints exist to be deleted."); - result.SetStatus(eReturnStatusFailed); return false; } @@ -1512,7 +1493,6 @@ } if (valid_bp_ids.GetSize() == 0) { result.AppendError("No disabled breakpoints."); - result.SetStatus(eReturnStatusFailed); return false; } } else { @@ -1726,7 +1706,6 @@ const size_t argc = command.GetArgumentCount(); if (argc == 0) { result.AppendError("No names provided."); - result.SetStatus(eReturnStatusFailed); return false; } @@ -1741,7 +1720,6 @@ if (!BreakpointID::StringIsBreakpointName(entry.ref(), error)) { result.AppendErrorWithFormat("Invalid breakpoint name: %s - %s", entry.c_str(), error.AsCString()); - result.SetStatus(eReturnStatusFailed); return false; } } @@ -1754,7 +1732,6 @@ if (!bp_sp) { result.AppendErrorWithFormatv("Could not find specified breakpoint {0}", bp_id); - result.SetStatus(eReturnStatusFailed); return false; } } @@ -1836,7 +1813,6 @@ size_t num_breakpoints = breakpoints.GetSize(); if (num_breakpoints == 0) { result.SetError("No breakpoints, cannot add names."); - result.SetStatus(eReturnStatusFailed); return false; } @@ -1849,7 +1825,6 @@ if (result.Succeeded()) { if (valid_bp_ids.GetSize() == 0) { result.SetError("No breakpoints specified, cannot add names."); - result.SetStatus(eReturnStatusFailed); return false; } size_t num_valid_ids = valid_bp_ids.GetSize(); @@ -1923,7 +1898,6 @@ size_t num_breakpoints = breakpoints.GetSize(); if (num_breakpoints == 0) { result.SetError("No breakpoints, cannot delete names."); - result.SetStatus(eReturnStatusFailed); return false; } @@ -1936,7 +1910,6 @@ if (result.Succeeded()) { if (valid_bp_ids.GetSize() == 0) { result.SetError("No breakpoints specified, cannot delete names."); - result.SetStatus(eReturnStatusFailed); return false; } ConstString bp_name(m_name_options.m_name.GetCurrentValue()); @@ -2212,7 +2185,6 @@ if (!error.Success()) { result.AppendError(error.AsCString()); - result.SetStatus(eReturnStatusFailed); return false; } @@ -2341,7 +2313,6 @@ if (!error.Success()) { result.AppendErrorWithFormat("error serializing breakpoints: %s.", error.AsCString()); - result.SetStatus(eReturnStatusFailed); } return result.Succeeded(); } @@ -2434,7 +2405,6 @@ } else { result.AppendError( "No breakpoint specified and no last created breakpoint."); - result.SetStatus(eReturnStatusFailed); } return; } @@ -2476,14 +2446,12 @@ result.AppendErrorWithFormat( "'%s' is not a currently valid breakpoint/location id.\n", id_str.GetData()); - result.SetStatus(eReturnStatusFailed); } } else { i = valid_ids->GetSize() + 1; result.AppendErrorWithFormat( "'%d' is not a currently valid breakpoint ID.\n", cur_bp_id.GetBreakpointID()); - result.SetStatus(eReturnStatusFailed); } } } diff --git a/lldb/source/Commands/CommandObjectBreakpointCommand.cpp b/lldb/source/Commands/CommandObjectBreakpointCommand.cpp --- a/lldb/source/Commands/CommandObjectBreakpointCommand.cpp +++ b/lldb/source/Commands/CommandObjectBreakpointCommand.cpp @@ -371,7 +371,6 @@ if (num_breakpoints == 0) { result.AppendError("No breakpoints exist to have commands added"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -545,14 +544,12 @@ if (num_breakpoints == 0) { result.AppendError("No breakpoints exist to have commands deleted"); - result.SetStatus(eReturnStatusFailed); return false; } if (command.empty()) { result.AppendError( "No breakpoint specified from which to delete the commands"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -577,7 +574,6 @@ result.AppendErrorWithFormat("Invalid breakpoint ID: %u.%u.\n", cur_bp_id.GetBreakpointID(), cur_bp_id.GetLocationID()); - result.SetStatus(eReturnStatusFailed); return false; } } else { @@ -628,14 +624,12 @@ if (num_breakpoints == 0) { result.AppendError("No breakpoints exist for which to list commands"); - result.SetStatus(eReturnStatusFailed); return false; } if (command.empty()) { result.AppendError( "No breakpoint specified for which to list the commands"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -660,7 +654,6 @@ result.AppendErrorWithFormat("Invalid breakpoint ID: %u.%u.\n", cur_bp_id.GetBreakpointID(), cur_bp_id.GetLocationID()); - result.SetStatus(eReturnStatusFailed); return false; } } @@ -695,7 +688,6 @@ } else { result.AppendErrorWithFormat("Invalid breakpoint ID: %u.\n", cur_bp_id.GetBreakpointID()); - result.SetStatus(eReturnStatusFailed); } } } diff --git a/lldb/source/Commands/CommandObjectCommands.cpp b/lldb/source/Commands/CommandObjectCommands.cpp --- a/lldb/source/Commands/CommandObjectCommands.cpp +++ b/lldb/source/Commands/CommandObjectCommands.cpp @@ -128,7 +128,6 @@ result.AppendErrorWithFormat( "'%s' takes exactly one executable filename argument.\n", GetCommandName().str().c_str()); - result.SetStatus(eReturnStatusFailed); return false; } @@ -380,7 +379,6 @@ if (args.GetArgumentCount() < 2) { result.AppendError("'command alias' requires at least two arguments"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -393,7 +391,6 @@ result.AppendWarning("if trying to pass options to 'command alias' add " "a -- at the end of the options"); } - result.SetStatus(eReturnStatusFailed); return false; } @@ -407,7 +404,6 @@ raw_command_string = raw_command_string.substr(pos); } else { result.AppendError("Error parsing command string. No alias created."); - result.SetStatus(eReturnStatusFailed); return false; } @@ -416,7 +412,6 @@ result.AppendErrorWithFormat( "'%s' is a permanent debugger command and cannot be redefined.\n", args[0].c_str()); - result.SetStatus(eReturnStatusFailed); return false; } @@ -432,7 +427,6 @@ "'%s' does not begin with a valid command." " No alias created.", original_raw_command_string.str().c_str()); - result.SetStatus(eReturnStatusFailed); return false; } else if (!cmd_obj->WantsRawCommandString()) { // Note that args was initialized with the original command, and has not @@ -472,12 +466,10 @@ result.SetStatus(eReturnStatusSuccessFinishNoResult); } else { result.AppendError("Unable to create requested alias.\n"); - result.SetStatus(eReturnStatusFailed); } } else { result.AppendError("Unable to create requested alias.\n"); - result.SetStatus(eReturnStatusFailed); } return result.Succeeded(); @@ -488,7 +480,6 @@ if (argc < 2) { result.AppendError("'command alias' requires at least two arguments"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -506,7 +497,6 @@ result.AppendErrorWithFormat( "'%s' is a permanent debugger command and cannot be redefined.\n", alias_command.c_str()); - result.SetStatus(eReturnStatusFailed); return false; } @@ -517,7 +507,6 @@ if (!command_obj_sp) { result.AppendErrorWithFormat("'%s' is not an existing command.\n", actual_command.c_str()); - result.SetStatus(eReturnStatusFailed); return false; } CommandObject *cmd_obj = command_obj_sp.get(); @@ -534,7 +523,6 @@ "'%s' is not a valid sub-command of '%s'. " "Unable to create alias.\n", args[0].c_str(), actual_command.c_str()); - result.SetStatus(eReturnStatusFailed); return false; } @@ -573,7 +561,6 @@ result.SetStatus(eReturnStatusSuccessFinishNoResult); } else { result.AppendError("Unable to create requested alias.\n"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -626,7 +613,6 @@ if (args.empty()) { result.AppendError("must call 'unalias' with a valid alias"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -637,7 +623,6 @@ "'%s' is not a known command.\nTry 'help' to see a " "current list of commands.\n", args[0].c_str()); - result.SetStatus(eReturnStatusFailed); return false; } @@ -652,7 +637,6 @@ "'%s' is a permanent debugger command and cannot be removed.\n", args[0].c_str()); } - result.SetStatus(eReturnStatusFailed); return false; } @@ -664,7 +648,6 @@ else result.AppendErrorWithFormat("'%s' is not an existing alias.\n", args[0].c_str()); - result.SetStatus(eReturnStatusFailed); return false; } @@ -720,7 +703,6 @@ result.AppendErrorWithFormat("must call '%s' with one or more valid user " "defined regular expression command names", GetCommandName().str().c_str()); - result.SetStatus(eReturnStatusFailed); return false; } @@ -733,7 +715,6 @@ &error_msg_stream, command_name, llvm::StringRef(), llvm::StringRef(), generate_upropos, generate_type_lookup); result.AppendError(error_msg_stream.GetString()); - result.SetStatus(eReturnStatusFailed); return false; } @@ -741,7 +722,6 @@ result.AppendErrorWithFormat( "'%s' is a permanent debugger command and cannot be removed.\n", args[0].c_str()); - result.SetStatus(eReturnStatusFailed); return false; } @@ -846,7 +826,6 @@ if (argc == 0) { result.AppendError("usage: 'command regex " "[s/// s/// ...]'\n"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -887,7 +866,6 @@ } if (error.Fail()) { result.AppendError(error.AsCString()); - result.SetStatus(eReturnStatusFailed); } return result.Succeeded(); @@ -1103,7 +1081,6 @@ m_function_name.c_str(), raw_command_line, m_synchro, result, error, m_exe_ctx)) { result.AppendError(error.AsCString()); - result.SetStatus(eReturnStatusFailed); } else { // Don't change the status if the command already set it... if (result.GetStatus() == eReturnStatusInvalid) { @@ -1189,7 +1166,6 @@ !scripter->RunScriptBasedCommand(m_cmd_obj_sp, raw_command_line, m_synchro, result, error, m_exe_ctx)) { result.AppendError(error.AsCString()); - result.SetStatus(eReturnStatusFailed); } else { // Don't change the status if the command already set it... if (result.GetStatus() == eReturnStatusInvalid) { @@ -1286,7 +1262,6 @@ bool DoExecute(Args &command, CommandReturnObject &result) override { if (command.empty()) { result.AppendError("command script import needs one or more arguments"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -1296,7 +1271,6 @@ if (!source_dir) { result.AppendError("command script import -c can only be specified " "from a command file"); - result.SetStatus(eReturnStatusFailed); return false; } } @@ -1320,7 +1294,6 @@ } else { result.AppendErrorWithFormat("module importing failed: %s", error.AsCString()); - result.SetStatus(eReturnStatusFailed); } } @@ -1505,13 +1478,11 @@ if (GetDebugger().GetScriptLanguage() != lldb::eScriptLanguagePython) { result.AppendError("only scripting language supported for scripted " "commands is currently Python"); - result.SetStatus(eReturnStatusFailed); return false; } if (command.GetArgumentCount() != 1) { result.AppendError("'command script add' requires one argument"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -1533,14 +1504,12 @@ result.SetStatus(eReturnStatusSuccessFinishNoResult); } else { result.AppendError("cannot add command"); - result.SetStatus(eReturnStatusFailed); } } } else { ScriptInterpreter *interpreter = GetDebugger().GetScriptInterpreter(); if (!interpreter) { result.AppendError("cannot find ScriptInterpreter"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -1548,7 +1517,6 @@ m_options.m_class_name.c_str()); if (!cmd_obj_sp) { result.AppendError("cannot create helper object"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -1558,7 +1526,6 @@ result.SetStatus(eReturnStatusSuccessFinishNoResult); } else { result.AppendError("cannot add command"); - result.SetStatus(eReturnStatusFailed); } } @@ -1584,7 +1551,6 @@ bool DoExecute(Args &command, CommandReturnObject &result) override { if (command.GetArgumentCount() != 0) { result.AppendError("'command script list' doesn't take any arguments"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -1610,7 +1576,6 @@ bool DoExecute(Args &command, CommandReturnObject &result) override { if (command.GetArgumentCount() != 0) { result.AppendError("'command script clear' doesn't take any arguments"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -1661,7 +1626,6 @@ if (command.GetArgumentCount() != 1) { result.AppendError("'command script delete' requires one argument"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -1670,7 +1634,6 @@ if (cmd_name.empty() || !m_interpreter.HasUserCommands() || !m_interpreter.UserCommandExists(cmd_name)) { result.AppendErrorWithFormat("command %s not found", command[0].c_str()); - result.SetStatus(eReturnStatusFailed); return false; } diff --git a/lldb/source/Commands/CommandObjectDisassemble.cpp b/lldb/source/Commands/CommandObjectDisassemble.cpp --- a/lldb/source/Commands/CommandObjectDisassemble.cpp +++ b/lldb/source/Commands/CommandObjectDisassemble.cpp @@ -414,7 +414,6 @@ if (!m_options.arch.IsValid()) { result.AppendError( "use the --arch option or set the target architecture to disassemble"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -434,7 +433,6 @@ result.AppendErrorWithFormat( "Unable to find Disassembler plug-in for the '%s' architecture.\n", m_options.arch.GetArchitectureName()); - result.SetStatus(eReturnStatusFailed); return false; } else if (flavor_string != nullptr && !disassembler->FlavorValidForArchSpec( m_options.arch, flavor_string)) @@ -450,7 +448,6 @@ GetCommandInterpreter().GetDebugger().GetTerminalWidth(); GetOptions()->GenerateOptionUsage(result.GetErrorStream(), this, terminal_width); - result.SetStatus(eReturnStatusFailed); return false; } @@ -475,7 +472,6 @@ GetRangesForSelectedMode(result); if (!ranges) { result.AppendError(toString(ranges.takeError())); - result.SetStatus(eReturnStatusFailed); return result.Succeeded(); } @@ -505,7 +501,6 @@ "Failed to disassemble memory at 0x%8.8" PRIx64 ".\n", cur_range.GetBaseAddress().GetLoadAddress(target)); } - result.SetStatus(eReturnStatusFailed); } if (print_sc_header) result.GetOutputStream() << "\n"; diff --git a/lldb/source/Commands/CommandObjectExpression.cpp b/lldb/source/Commands/CommandObjectExpression.cpp --- a/lldb/source/Commands/CommandObjectExpression.cpp +++ b/lldb/source/Commands/CommandObjectExpression.cpp @@ -411,7 +411,6 @@ if (m_command_options.top_level && !m_command_options.allow_jit) { result.AppendErrorWithFormat( "Can't disable JIT compilation for top-level expressions.\n"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -441,7 +440,6 @@ result.AppendErrorWithFormat( "expression cannot be used with --element-count %s\n", error.AsCString("")); - result.SetStatus(eReturnStatusFailed); return false; } } diff --git a/lldb/source/Commands/CommandObjectFrame.cpp b/lldb/source/Commands/CommandObjectFrame.cpp --- a/lldb/source/Commands/CommandObjectFrame.cpp +++ b/lldb/source/Commands/CommandObjectFrame.cpp @@ -141,7 +141,6 @@ if (m_options.reg.hasValue() || m_options.offset.hasValue()) { result.AppendError( "`frame diagnose --address` is incompatible with other arguments."); - result.SetStatus(eReturnStatusFailed); return false; } valobj_sp = frame_sp->GuessValueForAddress(m_options.address.getValue()); @@ -152,7 +151,6 @@ StopInfoSP stop_info_sp = thread->GetStopInfo(); if (!stop_info_sp) { result.AppendError("No arguments provided, and no stop info."); - result.SetStatus(eReturnStatusFailed); return false; } @@ -161,7 +159,6 @@ if (!valobj_sp) { result.AppendError("No diagnosis available."); - result.SetStatus(eReturnStatusFailed); return false; } @@ -323,7 +320,6 @@ // If you are already at the bottom of the stack, then just warn // and don't reset the frame. result.AppendError("Already at the bottom of the stack."); - result.SetStatus(eReturnStatusFailed); return false; } else frame_idx = 0; @@ -342,7 +338,6 @@ // If we are already at the top of the stack, just warn and don't // reset the frame. result.AppendError("Already at the top of the stack."); - result.SetStatus(eReturnStatusFailed); return false; } else frame_idx = num_frames - 1; @@ -363,7 +358,6 @@ if (command[0].ref().getAsInteger(0, frame_idx)) { result.AppendErrorWithFormat("invalid frame index argument '%s'.", command[0].c_str()); - result.SetStatus(eReturnStatusFailed); return false; } } else if (command.GetArgumentCount() == 0) { @@ -382,7 +376,6 @@ } else { result.AppendErrorWithFormat("Frame index (%u) out of range.\n", frame_idx); - result.SetStatus(eReturnStatusFailed); } return result.Succeeded(); @@ -850,14 +843,12 @@ if (m_options.m_class_name.empty()) { result.AppendErrorWithFormat( "%s needs a Python class name (-l argument).\n", m_cmd_name.c_str()); - result.SetStatus(eReturnStatusFailed); return false; } if (m_options.m_module.empty()) { result.AppendErrorWithFormat("%s needs a module name (-s argument).\n", m_cmd_name.c_str()); - result.SetStatus(eReturnStatusFailed); return false; } @@ -865,7 +856,6 @@ result.AppendErrorWithFormat( "%s needs at least one symbol name (-n argument).\n", m_cmd_name.c_str()); - result.SetStatus(eReturnStatusFailed); return false; } @@ -873,7 +863,6 @@ result.AppendErrorWithFormat( "%s needs only one symbol regular expression (-n argument).\n", m_cmd_name.c_str()); - result.SetStatus(eReturnStatusFailed); return false; } @@ -968,7 +957,6 @@ "About to delete all frame recognizers, do you want to do that?", true)) { result.AppendMessage("Operation cancelled..."); - result.SetStatus(eReturnStatusFailed); return false; } @@ -982,7 +970,6 @@ if (command.GetArgumentCount() != 1) { result.AppendErrorWithFormat("'%s' takes zero or one arguments.\n", m_cmd_name.c_str()); - result.SetStatus(eReturnStatusFailed); return false; } @@ -990,7 +977,6 @@ if (!llvm::to_integer(command.GetArgumentAtIndex(0), recognizer_id)) { result.AppendErrorWithFormat("'%s' is not a valid recognizer id.\n", command.GetArgumentAtIndex(0)); - result.SetStatus(eReturnStatusFailed); return false; } @@ -999,7 +985,6 @@ .RemoveRecognizerWithID(recognizer_id)) { result.AppendErrorWithFormat("'%s' is not a valid recognizer id.\n", command.GetArgumentAtIndex(0)); - result.SetStatus(eReturnStatusFailed); return false; } result.SetStatus(eReturnStatusSuccessFinishResult); @@ -1084,33 +1069,28 @@ if (!llvm::to_integer(frame_index_str, frame_index)) { result.AppendErrorWithFormat("'%s' is not a valid frame index.", frame_index_str); - result.SetStatus(eReturnStatusFailed); return false; } Process *process = m_exe_ctx.GetProcessPtr(); if (process == nullptr) { result.AppendError("no process"); - result.SetStatus(eReturnStatusFailed); return false; } Thread *thread = m_exe_ctx.GetThreadPtr(); if (thread == nullptr) { result.AppendError("no thread"); - result.SetStatus(eReturnStatusFailed); return false; } if (command.GetArgumentCount() != 1) { result.AppendErrorWithFormat( "'%s' takes exactly one frame index argument.\n", m_cmd_name.c_str()); - result.SetStatus(eReturnStatusFailed); return false; } StackFrameSP frame_sp = thread->GetStackFrameAtIndex(frame_index); if (!frame_sp) { result.AppendErrorWithFormat("no frame with index %u", frame_index); - result.SetStatus(eReturnStatusFailed); return false; } diff --git a/lldb/source/Commands/CommandObjectGUI.cpp b/lldb/source/Commands/CommandObjectGUI.cpp --- a/lldb/source/Commands/CommandObjectGUI.cpp +++ b/lldb/source/Commands/CommandObjectGUI.cpp @@ -39,11 +39,9 @@ result.SetStatus(eReturnStatusSuccessFinishResult); } else { result.AppendError("the gui command requires an interactive terminal."); - result.SetStatus(eReturnStatusFailed); } } else { result.AppendError("the gui command takes no arguments."); - result.SetStatus(eReturnStatusFailed); } return true; #else diff --git a/lldb/source/Commands/CommandObjectHelp.cpp b/lldb/source/Commands/CommandObjectHelp.cpp --- a/lldb/source/Commands/CommandObjectHelp.cpp +++ b/lldb/source/Commands/CommandObjectHelp.cpp @@ -139,7 +139,6 @@ } s.Printf("\n"); result.AppendError(s.GetString()); - result.SetStatus(eReturnStatusFailed); return false; } else if (!sub_cmd_obj) { StreamString error_msg_stream; @@ -147,7 +146,6 @@ &error_msg_stream, cmd_string.c_str(), m_interpreter.GetCommandPrefix(), sub_command.c_str()); result.AppendError(error_msg_stream.GetString()); - result.SetStatus(eReturnStatusFailed); return false; } else { GenerateAdditionalHelpAvenuesMessage( @@ -193,7 +191,6 @@ m_interpreter.GetCommandPrefix(), ""); result.AppendError(error_msg_stream.GetString()); - result.SetStatus(eReturnStatusFailed); } } } diff --git a/lldb/source/Commands/CommandObjectLog.cpp b/lldb/source/Commands/CommandObjectLog.cpp --- a/lldb/source/Commands/CommandObjectLog.cpp +++ b/lldb/source/Commands/CommandObjectLog.cpp @@ -151,7 +151,6 @@ result.AppendErrorWithFormat( "%s takes a log channel and one or more log types.\n", m_cmd_name.c_str()); - result.SetStatus(eReturnStatusFailed); return false; } @@ -225,7 +224,6 @@ result.AppendErrorWithFormat( "%s takes a log channel and one or more log types.\n", m_cmd_name.c_str()); - result.SetStatus(eReturnStatusFailed); return false; } diff --git a/lldb/source/Commands/CommandObjectMemory.cpp b/lldb/source/Commands/CommandObjectMemory.cpp --- a/lldb/source/Commands/CommandObjectMemory.cpp +++ b/lldb/source/Commands/CommandObjectMemory.cpp @@ -358,7 +358,6 @@ m_cmd_name.c_str()); result.AppendWarning("Expressions should be quoted if they contain " "spaces or other special characters."); - result.SetStatus(eReturnStatusFailed); return false; } @@ -439,7 +438,6 @@ } else { result.AppendErrorWithFormat("invalid type string: '%s'\n", view_as_type_cstr); - result.SetStatus(eReturnStatusFailed); return false; } break; @@ -489,7 +487,6 @@ "Mutiple types found matching raw type '%s', please disambiguate " "by specifying the language with -x", lookup_type_name.GetCString()); - result.SetStatus(eReturnStatusFailed); return false; } @@ -504,7 +501,6 @@ "the raw type '%s' for full type '%s'\n", lookup_type_name.GetCString(), view_as_type_cstr); - result.SetStatus(eReturnStatusFailed); return false; } else { TypeSP type_sp(type_list.GetTypeAtIndex(0)); @@ -518,7 +514,6 @@ compiler_type = pointer_type; else { result.AppendError("unable make a pointer type\n"); - result.SetStatus(eReturnStatusFailed); return false; } --pointer_count; @@ -529,7 +524,6 @@ result.AppendErrorWithFormat( "unable to get the byte size of the type '%s'\n", view_as_type_cstr); - result.SetStatus(eReturnStatusFailed); return false; } m_format_options.GetByteSizeValue() = *size; @@ -543,7 +537,6 @@ // Look for invalid combinations of settings if (error.Fail()) { result.AppendError(error.AsCString()); - result.SetStatus(eReturnStatusFailed); return false; } @@ -593,7 +586,6 @@ if (addr == LLDB_INVALID_ADDRESS) { result.AppendError("invalid start address expression."); result.AppendError(error.AsCString()); - result.SetStatus(eReturnStatusFailed); return false; } @@ -603,21 +595,18 @@ if (end_addr == LLDB_INVALID_ADDRESS) { result.AppendError("invalid end address expression."); result.AppendError(error.AsCString()); - result.SetStatus(eReturnStatusFailed); return false; } else if (end_addr <= addr) { result.AppendErrorWithFormat( "end address (0x%" PRIx64 ") must be greater than the start address (0x%" PRIx64 ").\n", end_addr, addr); - result.SetStatus(eReturnStatusFailed); return false; } else if (m_format_options.GetCountValue().OptionWasSet()) { result.AppendErrorWithFormat( "specify either the end address (0x%" PRIx64 ") or the count (--count %" PRIu64 "), not both.\n", end_addr, (uint64_t)item_count); - result.SetStatus(eReturnStatusFailed); return false; } @@ -664,7 +653,6 @@ "can't allocate 0x%" PRIx32 " bytes for the memory read buffer, specify a smaller size to read", (uint32_t)total_byte_size); - result.SetStatus(eReturnStatusFailed); return false; } @@ -679,7 +667,6 @@ result.AppendErrorWithFormat( "failed to read memory from 0x%" PRIx64 ".\n", addr); } - result.SetStatus(eReturnStatusFailed); return false; } @@ -706,7 +693,6 @@ "can't allocate 0x%" PRIx64 " bytes for the memory read buffer, specify a smaller size to read", (uint64_t)((item_byte_size + 1) * item_count)); - result.SetStatus(eReturnStatusFailed); return false; } uint8_t *data_ptr = data_sp->GetBytes(); @@ -723,7 +709,6 @@ if (error.Fail()) { result.AppendErrorWithFormat( "failed to read memory from 0x%" PRIx64 ".\n", addr); - result.SetStatus(eReturnStatusFailed); return false; } @@ -790,7 +775,6 @@ result.AppendErrorWithFormat("Failed to write %" PRIu64 " bytes to '%s'.\n", (uint64_t)bytes_read, path.c_str()); - result.SetStatus(eReturnStatusFailed); return false; } } else { @@ -804,7 +788,6 @@ path.c_str(), append ? "append" : "write"); result.AppendError(llvm::toString(outfile.takeError())); - result.SetStatus(eReturnStatusFailed); return false; } } else { @@ -833,7 +816,6 @@ result.AppendErrorWithFormat( "failed to create a value object for: (%s) %s\n", view_as_type_cstr, name_strm.GetData()); - result.SetStatus(eReturnStatusFailed); return false; } } @@ -863,7 +845,6 @@ result.AppendErrorWithFormat( "reading memory as characters of size %" PRIu64 " is not supported", (uint64_t)item_byte_size); - result.SetStatus(eReturnStatusFailed); return false; } } @@ -1294,14 +1275,12 @@ result.AppendErrorWithFormat( "%s takes a destination address when writing file contents.\n", m_cmd_name.c_str()); - result.SetStatus(eReturnStatusFailed); return false; } } else if (argc < 2) { result.AppendErrorWithFormat( "%s takes a destination address and at least one value.\n", m_cmd_name.c_str()); - result.SetStatus(eReturnStatusFailed); return false; } @@ -1320,7 +1299,6 @@ if (addr == LLDB_INVALID_ADDRESS) { result.AppendError("invalid address expression\n"); result.AppendError(error.AsCString()); - result.SetStatus(eReturnStatusFailed); return false; } @@ -1355,12 +1333,10 @@ result.AppendErrorWithFormat("Memory write to 0x%" PRIx64 " failed: %s.\n", addr, error.AsCString()); - result.SetStatus(eReturnStatusFailed); } } } else { result.AppendErrorWithFormat("Unable to read contents of file.\n"); - result.SetStatus(eReturnStatusFailed); } return result.Succeeded(); } else if (item_byte_size == 0) { @@ -1405,7 +1381,6 @@ case eFormatInstruction: case eFormatVoid: result.AppendError("unsupported format for writing memory"); - result.SetStatus(eReturnStatusFailed); return false; case eFormatDefault: @@ -1424,14 +1399,12 @@ if (!success) { result.AppendErrorWithFormat( "'%s' is not a valid hex string value.\n", entry.c_str()); - result.SetStatus(eReturnStatusFailed); return false; } else if (!llvm::isUIntN(item_byte_size * 8, uval64)) { result.AppendErrorWithFormat("Value 0x%" PRIx64 " is too large to fit in a %" PRIu64 " byte unsigned integer value.\n", uval64, (uint64_t)item_byte_size); - result.SetStatus(eReturnStatusFailed); return false; } buffer.PutMaxHex64(uval64, item_byte_size); @@ -1442,7 +1415,6 @@ if (!success) { result.AppendErrorWithFormat( "'%s' is not a valid boolean string value.\n", entry.c_str()); - result.SetStatus(eReturnStatusFailed); return false; } buffer.PutMaxHex64(uval64, item_byte_size); @@ -1452,14 +1424,12 @@ if (entry.ref().getAsInteger(2, uval64)) { result.AppendErrorWithFormat( "'%s' is not a valid binary string value.\n", entry.c_str()); - result.SetStatus(eReturnStatusFailed); return false; } else if (!llvm::isUIntN(item_byte_size * 8, uval64)) { result.AppendErrorWithFormat("Value 0x%" PRIx64 " is too large to fit in a %" PRIu64 " byte unsigned integer value.\n", uval64, (uint64_t)item_byte_size); - result.SetStatus(eReturnStatusFailed); return false; } buffer.PutMaxHex64(uval64, item_byte_size); @@ -1482,7 +1452,6 @@ result.AppendErrorWithFormat("Memory write to 0x%" PRIx64 " failed: %s.\n", addr, error.AsCString()); - result.SetStatus(eReturnStatusFailed); return false; } break; @@ -1491,14 +1460,12 @@ if (entry.ref().getAsInteger(0, sval64)) { result.AppendErrorWithFormat( "'%s' is not a valid signed decimal value.\n", entry.c_str()); - result.SetStatus(eReturnStatusFailed); return false; } else if (!llvm::isIntN(item_byte_size * 8, sval64)) { result.AppendErrorWithFormat( "Value %" PRIi64 " is too large or small to fit in a %" PRIu64 " byte signed integer value.\n", sval64, (uint64_t)item_byte_size); - result.SetStatus(eReturnStatusFailed); return false; } buffer.PutMaxHex64(sval64, item_byte_size); @@ -1510,14 +1477,12 @@ result.AppendErrorWithFormat( "'%s' is not a valid unsigned decimal string value.\n", entry.c_str()); - result.SetStatus(eReturnStatusFailed); return false; } else if (!llvm::isUIntN(item_byte_size * 8, uval64)) { result.AppendErrorWithFormat("Value %" PRIu64 " is too large to fit in a %" PRIu64 " byte unsigned integer value.\n", uval64, (uint64_t)item_byte_size); - result.SetStatus(eReturnStatusFailed); return false; } buffer.PutMaxHex64(uval64, item_byte_size); @@ -1527,14 +1492,12 @@ if (entry.ref().getAsInteger(8, uval64)) { result.AppendErrorWithFormat( "'%s' is not a valid octal string value.\n", entry.c_str()); - result.SetStatus(eReturnStatusFailed); return false; } else if (!llvm::isUIntN(item_byte_size * 8, uval64)) { result.AppendErrorWithFormat("Value %" PRIo64 " is too large to fit in a %" PRIu64 " byte unsigned integer value.\n", uval64, (uint64_t)item_byte_size); - result.SetStatus(eReturnStatusFailed); return false; } buffer.PutMaxHex64(uval64, item_byte_size); @@ -1552,7 +1515,6 @@ result.AppendErrorWithFormat("Memory write to 0x%" PRIx64 " failed: %s.\n", addr, error.AsCString()); - result.SetStatus(eReturnStatusFailed); return false; } } @@ -1605,7 +1567,6 @@ if (argc == 0 || argc > 1) { result.AppendErrorWithFormat("%s takes an address expression", m_cmd_name.c_str()); - result.SetStatus(eReturnStatusFailed); return false; } @@ -1616,7 +1577,6 @@ if (addr == LLDB_INVALID_ADDRESS) { result.AppendError("invalid address expression"); result.AppendError(error.AsCString()); - result.SetStatus(eReturnStatusFailed); return false; } @@ -1628,7 +1588,6 @@ if (!memory_history) { result.AppendError("no available memory history provider"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -1667,7 +1626,6 @@ if (!process_sp) { m_prev_end_addr = LLDB_INVALID_ADDRESS; result.AppendError("invalid process"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -1679,7 +1637,6 @@ if (argc > 1 || (argc == 0 && load_addr == LLDB_INVALID_ADDRESS)) { result.AppendErrorWithFormat("'%s' takes one argument:\nUsage: %s\n", m_cmd_name.c_str(), m_cmd_syntax.c_str()); - result.SetStatus(eReturnStatusFailed); return false; } @@ -1690,7 +1647,6 @@ if (error.Fail() || load_addr == LLDB_INVALID_ADDRESS) { result.AppendErrorWithFormat("invalid address argument \"%s\": %s\n", command[0].c_str(), error.AsCString()); - result.SetStatus(eReturnStatusFailed); return false; } } @@ -1727,7 +1683,6 @@ return true; } - result.SetStatus(eReturnStatusFailed); result.AppendErrorWithFormat("%s\n", error.AsCString()); return false; } diff --git a/lldb/source/Commands/CommandObjectMultiword.cpp b/lldb/source/Commands/CommandObjectMultiword.cpp --- a/lldb/source/Commands/CommandObjectMultiword.cpp +++ b/lldb/source/Commands/CommandObjectMultiword.cpp @@ -106,7 +106,6 @@ if (m_subcommand_dict.empty()) { result.AppendErrorWithFormat("'%s' does not have any subcommands.\n", GetCommandName().str().c_str()); - result.SetStatus(eReturnStatusFailed); return false; } @@ -144,7 +143,6 @@ } error_msg.append("\n"); result.AppendRawError(error_msg.c_str()); - result.SetStatus(eReturnStatusFailed); return false; } diff --git a/lldb/source/Commands/CommandObjectPlatform.cpp b/lldb/source/Commands/CommandObjectPlatform.cpp --- a/lldb/source/Commands/CommandObjectPlatform.cpp +++ b/lldb/source/Commands/CommandObjectPlatform.cpp @@ -180,16 +180,13 @@ result.SetStatus(eReturnStatusSuccessFinishResult); } else { result.AppendError(error.AsCString()); - result.SetStatus(eReturnStatusFailed); } } else { result.AppendError("invalid platform name"); - result.SetStatus(eReturnStatusFailed); } } else { result.AppendError( "platform create takes a platform name as an argument\n"); - result.SetStatus(eReturnStatusFailed); } return result.Succeeded(); } @@ -232,7 +229,6 @@ if (idx == 0) { result.AppendError("no platforms are available\n"); - result.SetStatus(eReturnStatusFailed); } else result.SetStatus(eReturnStatusSuccessFinishResult); return result.Succeeded(); @@ -266,7 +262,6 @@ result.SetStatus(eReturnStatusSuccessFinishResult); } else { result.AppendError("no platform is currently selected\n"); - result.SetStatus(eReturnStatusFailed); } return result.Succeeded(); } @@ -298,15 +293,12 @@ platform_sp->ConnectToWaitingProcesses(GetDebugger(), error); if (error.Fail()) { result.AppendError(error.AsCString()); - result.SetStatus(eReturnStatusFailed); } } else { result.AppendErrorWithFormat("%s\n", error.AsCString()); - result.SetStatus(eReturnStatusFailed); } } else { result.AppendError("no platform is currently selected\n"); - result.SetStatus(eReturnStatusFailed); } return result.Succeeded(); } @@ -361,24 +353,20 @@ result.SetStatus(eReturnStatusSuccessFinishResult); } else { result.AppendErrorWithFormat("%s", error.AsCString()); - result.SetStatus(eReturnStatusFailed); } } else { // Not connected... result.AppendErrorWithFormat( "not connected to '%s'", platform_sp->GetPluginName().GetCString()); - result.SetStatus(eReturnStatusFailed); } } else { // Bad args result.AppendError( "\"platform disconnect\" doesn't take any arguments"); - result.SetStatus(eReturnStatusFailed); } } else { result.AppendError("no platform is currently selected"); - result.SetStatus(eReturnStatusFailed); } return result.Succeeded(); } @@ -412,7 +400,6 @@ m_option_working_dir.GetOptionValue().GetCurrentValue()); } else { result.AppendError("no platform is currently selected"); - result.SetStatus(eReturnStatusFailed); } return result.Succeeded(); } @@ -457,11 +444,9 @@ result.SetStatus(eReturnStatusSuccessFinishResult); } else { result.AppendError(error.AsCString()); - result.SetStatus(eReturnStatusFailed); } } else { result.AppendError("no platform currently selected\n"); - result.SetStatus(eReturnStatusFailed); } return result.Succeeded(); } @@ -521,11 +506,9 @@ result.SetStatus(eReturnStatusSuccessFinishResult); } else { result.AppendError(error.AsCString()); - result.SetStatus(eReturnStatusFailed); } } else { result.AppendError("no platform currently selected\n"); - result.SetStatus(eReturnStatusFailed); } return result.Succeeded(); } @@ -560,7 +543,6 @@ if (!llvm::to_integer(cmd_line, fd)) { result.AppendErrorWithFormatv("'{0}' is not a valid file descriptor.\n", cmd_line); - result.SetStatus(eReturnStatusFailed); return result.Succeeded(); } Status error; @@ -570,11 +552,9 @@ result.SetStatus(eReturnStatusSuccessFinishResult); } else { result.AppendError(error.AsCString()); - result.SetStatus(eReturnStatusFailed); } } else { result.AppendError("no platform currently selected\n"); - result.SetStatus(eReturnStatusFailed); } return result.Succeeded(); } @@ -605,7 +585,6 @@ if (!llvm::to_integer(cmd_line, fd)) { result.AppendErrorWithFormatv("'{0}' is not a valid file descriptor.\n", cmd_line); - result.SetStatus(eReturnStatusFailed); return result.Succeeded(); } std::string buffer(m_options.m_count, 0); @@ -617,7 +596,6 @@ result.SetStatus(eReturnStatusSuccessFinishResult); } else { result.AppendError("no platform currently selected\n"); - result.SetStatus(eReturnStatusFailed); } return result.Succeeded(); } @@ -698,7 +676,6 @@ if (!llvm::to_integer(cmd_line, fd)) { result.AppendErrorWithFormatv("'{0}' is not a valid file descriptor.", cmd_line); - result.SetStatus(eReturnStatusFailed); return result.Succeeded(); } uint32_t retcode = @@ -708,7 +685,6 @@ result.SetStatus(eReturnStatusSuccessFinishResult); } else { result.AppendError("no platform currently selected\n"); - result.SetStatus(eReturnStatusFailed); } return result.Succeeded(); } @@ -866,11 +842,9 @@ } else { result.AppendMessageWithFormat("get-file failed: %s\n", error.AsCString()); - result.SetStatus(eReturnStatusFailed); } } else { result.AppendError("no platform currently selected\n"); - result.SetStatus(eReturnStatusFailed); } return result.Succeeded(); } @@ -941,11 +915,9 @@ result.AppendMessageWithFormat( "Error getting file size of %s (remote)\n", remote_file_path.c_str()); - result.SetStatus(eReturnStatusFailed); } } else { result.AppendError("no platform currently selected\n"); - result.SetStatus(eReturnStatusFailed); } return result.Succeeded(); } @@ -991,11 +963,9 @@ result.SetStatus(eReturnStatusSuccessFinishNoResult); } else { result.AppendError(error.AsCString()); - result.SetStatus(eReturnStatusFailed); } } else { result.AppendError("no platform currently selected\n"); - result.SetStatus(eReturnStatusFailed); } return result.Succeeded(); } @@ -1073,12 +1043,10 @@ result.AppendError("process launch failed"); else result.AppendError(error.AsCString()); - result.SetStatus(eReturnStatusFailed); } else { result.AppendError("'platform process launch' uses the current target " "file and arguments, or the executable and its " "arguments can be specified in this command"); - result.SetStatus(eReturnStatusFailed); return false; } } else { @@ -1140,7 +1108,6 @@ } else { result.AppendErrorWithFormat( "no process found with pid = %" PRIu64 "\n", pid); - result.SetStatus(eReturnStatusFailed); } } else { ProcessInstanceInfoList proc_infos; @@ -1182,7 +1149,6 @@ result.AppendErrorWithFormat( "no processes were found on the \"%s\" platform\n", platform_sp->GetPluginName().GetCString()); - result.SetStatus(eReturnStatusFailed); } else { result.AppendMessageWithFormat( "%u matching process%s found on \"%s\"", matches, @@ -1204,11 +1170,9 @@ } } else { result.AppendError("invalid args: process list takes only options\n"); - result.SetStatus(eReturnStatusFailed); } } else { result.AppendError("no platform is selected\n"); - result.SetStatus(eReturnStatusFailed); } return result.Succeeded(); } @@ -1413,7 +1377,6 @@ if (entry.ref().getAsInteger(0, pid)) { result.AppendErrorWithFormat("invalid process ID argument '%s'", entry.ref().str().c_str()); - result.SetStatus(eReturnStatusFailed); break; } else { ProcessInstanceInfo proc_info; @@ -1434,16 +1397,13 @@ result.AppendErrorWithFormat( "not connected to '%s'", platform_sp->GetPluginName().GetCString()); - result.SetStatus(eReturnStatusFailed); } } else { // No args result.AppendError("one or more process id(s) must be specified"); - result.SetStatus(eReturnStatusFailed); } } else { result.AppendError("no platform is currently selected"); - result.SetStatus(eReturnStatusFailed); } return result.Succeeded(); } @@ -1532,15 +1492,12 @@ m_options.attach_info, GetDebugger(), nullptr, err); if (err.Fail()) { result.AppendError(err.AsCString()); - result.SetStatus(eReturnStatusFailed); } else if (!remote_process_sp) { result.AppendError("could not attach: unknown reason"); - result.SetStatus(eReturnStatusFailed); } else result.SetStatus(eReturnStatusSuccessFinishResult); } else { result.AppendError("no platform is currently selected"); - result.SetStatus(eReturnStatusFailed); } return result.Succeeded(); } @@ -1718,7 +1675,6 @@ if (error.Fail()) { result.AppendError(error.AsCString()); - result.SetStatus(eReturnStatusFailed); } else { result.SetStatus(eReturnStatusSuccessFinishResult); } @@ -1752,7 +1708,6 @@ bool DoExecute(Args &args, CommandReturnObject &result) override { if (args.GetArgumentCount() != 2) { result.AppendError("platform target-install takes two arguments"); - result.SetStatus(eReturnStatusFailed); return false; } // TODO: move the bulk of this code over to the platform itself @@ -1761,14 +1716,12 @@ FileSpec dst(args.GetArgumentAtIndex(1)); if (!FileSystem::Instance().Exists(src)) { result.AppendError("source location does not exist or is not accessible"); - result.SetStatus(eReturnStatusFailed); return false; } PlatformSP platform_sp( GetDebugger().GetPlatformList().GetSelectedPlatform()); if (!platform_sp) { result.AppendError("no platform currently selected"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -1777,7 +1730,6 @@ result.SetStatus(eReturnStatusSuccessFinishNoResult); } else { result.AppendErrorWithFormat("install failed: %s", error.AsCString()); - result.SetStatus(eReturnStatusFailed); } return result.Succeeded(); } diff --git a/lldb/source/Commands/CommandObjectPlugin.cpp b/lldb/source/Commands/CommandObjectPlugin.cpp --- a/lldb/source/Commands/CommandObjectPlugin.cpp +++ b/lldb/source/Commands/CommandObjectPlugin.cpp @@ -50,7 +50,6 @@ if (argc != 1) { result.AppendError("'plugin load' requires one argument"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -63,7 +62,6 @@ result.SetStatus(eReturnStatusSuccessFinishResult); else { result.AppendError(error.AsCString()); - result.SetStatus(eReturnStatusFailed); } return result.Succeeded(); diff --git a/lldb/source/Commands/CommandObjectProcess.cpp b/lldb/source/Commands/CommandObjectProcess.cpp --- a/lldb/source/Commands/CommandObjectProcess.cpp +++ b/lldb/source/Commands/CommandObjectProcess.cpp @@ -79,7 +79,6 @@ result.AppendErrorWithFormat( "Failed to detach from process: %s\n", detach_error.AsCString()); - result.SetStatus(eReturnStatusFailed); } } else { Status destroy_error(process->Destroy(false)); @@ -89,7 +88,6 @@ } else { result.AppendErrorWithFormat("Failed to kill process: %s\n", destroy_error.AsCString()); - result.SetStatus(eReturnStatusFailed); } } } @@ -162,7 +160,6 @@ if (exe_module_sp == nullptr) { result.AppendError("no file in target, create a debug target using the " "'target create' command"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -261,11 +258,9 @@ } else { result.AppendError( "no error returned from Target::Launch, and target has no process"); - result.SetStatus(eReturnStatusFailed); } } else { result.AppendError(error.AsCString()); - result.SetStatus(eReturnStatusFailed); } return result.Succeeded(); } @@ -397,7 +392,6 @@ if (command.GetArgumentCount()) { result.AppendErrorWithFormat("Invalid arguments for '%s'.\nUsage: %s\n", m_cmd_name.c_str(), m_cmd_syntax.c_str()); - result.SetStatus(eReturnStatusFailed); return false; } @@ -412,11 +406,9 @@ } else { result.AppendError( "no error returned from Target::Attach, and target has no process"); - result.SetStatus(eReturnStatusFailed); } } else { result.AppendErrorWithFormat("attach failed: %s\n", error.AsCString()); - result.SetStatus(eReturnStatusFailed); } if (!result.Succeeded()) @@ -536,7 +528,6 @@ result.AppendErrorWithFormat( "The '%s' command does not take any arguments.\n", m_cmd_name.c_str()); - result.SetStatus(eReturnStatusFailed); return false; } @@ -608,13 +599,11 @@ } else { result.AppendErrorWithFormat("Failed to resume process: %s.\n", error.AsCString()); - result.SetStatus(eReturnStatusFailed); } } else { result.AppendErrorWithFormat( "Process cannot be continued from its current state (%s).\n", StateAsCString(state)); - result.SetStatus(eReturnStatusFailed); } return result.Succeeded(); } @@ -706,7 +695,6 @@ result.SetStatus(eReturnStatusSuccessFinishResult); } else { result.AppendErrorWithFormat("Detach failed: %s\n", error.AsCString()); - result.SetStatus(eReturnStatusFailed); return false; } return result.Succeeded(); @@ -778,7 +766,6 @@ result.AppendErrorWithFormat( "'%s' takes exactly one argument:\nUsage: %s\n", m_cmd_name.c_str(), m_cmd_syntax.c_str()); - result.SetStatus(eReturnStatusFailed); return false; } @@ -788,7 +775,6 @@ "Process %" PRIu64 " is currently being debugged, kill the process before connecting.\n", process->GetID()); - result.SetStatus(eReturnStatusFailed); return false; } @@ -810,7 +796,6 @@ error); if (error.Fail() || process_sp == nullptr) { result.AppendError(error.AsCString("Error connecting to the process")); - result.SetStatus(eReturnStatusFailed); return false; } return true; @@ -950,7 +935,6 @@ result.AppendErrorWithFormat("failed to load '%s': %s", image_path.str().c_str(), error.AsCString()); - result.SetStatus(eReturnStatusFailed); } } return result.Succeeded(); @@ -1002,7 +986,6 @@ if (entry.ref().getAsInteger(0, image_token)) { result.AppendErrorWithFormat("invalid image index argument '%s'", entry.ref().str().c_str()); - result.SetStatus(eReturnStatusFailed); break; } else { Status error(process->GetTarget().GetPlatform()->UnloadImage( @@ -1014,7 +997,6 @@ } else { result.AppendErrorWithFormat("failed to unload image: %s", error.AsCString()); - result.SetStatus(eReturnStatusFailed); break; } } @@ -1081,7 +1063,6 @@ if (signo == LLDB_INVALID_SIGNAL_NUMBER) { result.AppendErrorWithFormat("Invalid signal argument '%s'.\n", command.GetArgumentAtIndex(0)); - result.SetStatus(eReturnStatusFailed); } else { Status error(process->Signal(signo)); if (error.Success()) { @@ -1089,14 +1070,12 @@ } else { result.AppendErrorWithFormat("Failed to send signal %i: %s\n", signo, error.AsCString()); - result.SetStatus(eReturnStatusFailed); } } } else { result.AppendErrorWithFormat( "'%s' takes exactly one signal number argument:\nUsage: %s\n", m_cmd_name.c_str(), m_cmd_syntax.c_str()); - result.SetStatus(eReturnStatusFailed); } return result.Succeeded(); } @@ -1121,7 +1100,6 @@ Process *process = m_exe_ctx.GetProcessPtr(); if (process == nullptr) { result.AppendError("no process to halt"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -1133,12 +1111,10 @@ } else { result.AppendErrorWithFormat("Failed to halt process: %s\n", error.AsCString()); - result.SetStatus(eReturnStatusFailed); } } else { result.AppendErrorWithFormat("'%s' takes no arguments:\nUsage: %s\n", m_cmd_name.c_str(), m_cmd_syntax.c_str()); - result.SetStatus(eReturnStatusFailed); } return result.Succeeded(); } @@ -1163,7 +1139,6 @@ Process *process = m_exe_ctx.GetProcessPtr(); if (process == nullptr) { result.AppendError("no process to kill"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -1174,12 +1149,10 @@ } else { result.AppendErrorWithFormat("Failed to kill process: %s\n", error.AsCString()); - result.SetStatus(eReturnStatusFailed); } } else { result.AppendErrorWithFormat("'%s' takes no arguments:\nUsage: %s\n", m_cmd_name.c_str(), m_cmd_syntax.c_str()); - result.SetStatus(eReturnStatusFailed); } return result.Succeeded(); } @@ -1212,16 +1185,13 @@ } else { result.AppendErrorWithFormat( "Failed to save core file for process: %s\n", error.AsCString()); - result.SetStatus(eReturnStatusFailed); } } else { result.AppendErrorWithFormat("'%s' takes one arguments:\nUsage: %s\n", m_cmd_name.c_str(), m_cmd_syntax.c_str()); - result.SetStatus(eReturnStatusFailed); } } else { result.AppendError("invalid process"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -1288,7 +1258,6 @@ if (command.GetArgumentCount()) { result.AppendError("'process status' takes no arguments"); - result.SetStatus(eReturnStatusFailed); return result.Succeeded(); } @@ -1308,7 +1277,6 @@ PlatformSP platform_sp = process->GetTarget().GetPlatform(); if (!platform_sp) { result.AppendError("Couldn'retrieve the target's platform"); - result.SetStatus(eReturnStatusFailed); return result.Succeeded(); } @@ -1317,7 +1285,6 @@ if (!expected_crash_info) { result.AppendError(llvm::toString(expected_crash_info.takeError())); - result.SetStatus(eReturnStatusFailed); return result.Succeeded(); } @@ -1486,7 +1453,6 @@ if (!process_sp) { result.AppendError("No current process; cannot handle signals until you " "have a valid process.\n"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -1498,7 +1464,6 @@ !VerifyCommandOptionValue(m_options.stop, stop_action)) { result.AppendError("Invalid argument for command option --stop; must be " "true or false.\n"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -1506,7 +1471,6 @@ !VerifyCommandOptionValue(m_options.notify, notify_action)) { result.AppendError("Invalid argument for command option --notify; must " "be true or false.\n"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -1514,7 +1478,6 @@ !VerifyCommandOptionValue(m_options.pass, pass_action)) { result.AppendError("Invalid argument for command option --pass; must be " "true or false.\n"); - result.SetStatus(eReturnStatusFailed); return false; } diff --git a/lldb/source/Commands/CommandObjectQuit.cpp b/lldb/source/Commands/CommandObjectQuit.cpp --- a/lldb/source/Commands/CommandObjectQuit.cpp +++ b/lldb/source/Commands/CommandObjectQuit.cpp @@ -75,7 +75,6 @@ if (command.GetArgumentCount() > 1) { result.AppendError("Too many arguments for 'quit'. Only an optional exit " "code is allowed"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -88,13 +87,11 @@ std::string arg_str = arg.str(); s.Printf("Couldn't parse '%s' as integer for exit code.", arg_str.data()); result.AppendError(s.GetString()); - result.SetStatus(eReturnStatusFailed); return false; } if (!m_interpreter.SetQuitExitCode(exit_code)) { result.AppendError("The current driver doesn't allow custom exit codes" " for the quit command."); - result.SetStatus(eReturnStatusFailed); return false; } } diff --git a/lldb/source/Commands/CommandObjectRegister.cpp b/lldb/source/Commands/CommandObjectRegister.cpp --- a/lldb/source/Commands/CommandObjectRegister.cpp +++ b/lldb/source/Commands/CommandObjectRegister.cpp @@ -178,13 +178,11 @@ llvm::sys::StrError()); else result.AppendError("unknown error while reading registers.\n"); - result.SetStatus(eReturnStatusFailed); break; } } else { result.AppendErrorWithFormat( "invalid register set index: %" PRIu64 "\n", (uint64_t)set_idx); - result.SetStatus(eReturnStatusFailed); break; } } @@ -203,11 +201,9 @@ if (m_command_options.dump_all_sets) { result.AppendError("the --all option can't be used when registers " "names are supplied as arguments\n"); - result.SetStatus(eReturnStatusFailed); } else if (m_command_options.set_indexes.GetSize() > 0) { result.AppendError("the --set option can't be used when " "registers names are supplied as arguments\n"); - result.SetStatus(eReturnStatusFailed); } else { for (auto &entry : command) { // in most LLDB commands we accept $rbx as the name for register RBX @@ -353,7 +349,6 @@ if (command.GetArgumentCount() != 2) { result.AppendError( "register write takes exactly 2 arguments: "); - result.SetStatus(eReturnStatusFailed); } else { auto reg_name = command[0].ref(); auto value_str = command[1].ref(); @@ -390,11 +385,9 @@ "Failed to write register '%s' with value '%s'", reg_name.str().c_str(), value_str.str().c_str()); } - result.SetStatus(eReturnStatusFailed); } else { result.AppendErrorWithFormat("Register not found for '%s'.\n", reg_name.str().c_str()); - result.SetStatus(eReturnStatusFailed); } } return result.Succeeded(); diff --git a/lldb/source/Commands/CommandObjectReproducer.cpp b/lldb/source/Commands/CommandObjectReproducer.cpp --- a/lldb/source/Commands/CommandObjectReproducer.cpp +++ b/lldb/source/Commands/CommandObjectReproducer.cpp @@ -202,7 +202,6 @@ return result.Succeeded(); } else { result.AppendErrorWithFormat("Unable to get the reproducer generator"); - result.SetStatus(eReturnStatusFailed); return false; } diff --git a/lldb/source/Commands/CommandObjectScript.cpp b/lldb/source/Commands/CommandObjectScript.cpp --- a/lldb/source/Commands/CommandObjectScript.cpp +++ b/lldb/source/Commands/CommandObjectScript.cpp @@ -105,7 +105,6 @@ if (language == lldb::eScriptLanguageNone) { result.AppendError( "the script-lang setting is set to none - scripting not available"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -114,7 +113,6 @@ if (script_interpreter == nullptr) { result.AppendError("no script interpreter"); - result.SetStatus(eReturnStatusFailed); return false; } diff --git a/lldb/source/Commands/CommandObjectSettings.cpp b/lldb/source/Commands/CommandObjectSettings.cpp --- a/lldb/source/Commands/CommandObjectSettings.cpp +++ b/lldb/source/Commands/CommandObjectSettings.cpp @@ -177,7 +177,6 @@ if ((argc < min_argc) && (!m_options.m_global)) { result.AppendError("'settings set' takes more arguments"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -185,7 +184,6 @@ if ((var_name == nullptr) || (var_name[0] == '\0')) { result.AppendError( "'settings set' command requires a valid variable name"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -196,7 +194,6 @@ &m_exe_ctx, eVarSetOperationClear, var_name, llvm::StringRef())); if (error.Fail()) { result.AppendError(error.AsCString()); - result.SetStatus(eReturnStatusFailed); return false; } return result.Succeeded(); @@ -225,7 +222,6 @@ if (error.Fail()) { result.AppendError(error.AsCString()); - result.SetStatus(eReturnStatusFailed); return false; } else { result.SetStatus(eReturnStatusSuccessFinishResult); @@ -285,7 +281,6 @@ result.GetOutputStream().EOL(); } else { result.AppendError(error.AsCString()); - result.SetStatus(eReturnStatusFailed); } } } else { @@ -385,7 +380,6 @@ if (!out_file.GetFile().IsValid()) { result.AppendErrorWithFormat("%s: unable to write to file", path.c_str()); - result.SetStatus(eReturnStatusFailed); return false; } @@ -403,7 +397,6 @@ &clean_ctx, out_file, arg.ref(), OptionValue::eDumpGroupExport)); if (!error.Success()) { result.AppendError(error.AsCString()); - result.SetStatus(eReturnStatusFailed); } } @@ -543,7 +536,6 @@ } else { result.AppendErrorWithFormat("invalid property path '%s'", property_path); - result.SetStatus(eReturnStatusFailed); } } } else { @@ -624,7 +616,6 @@ "or an array followed by one or more indexes, or a " "dictionary followed by one or more key names to " "remove"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -632,7 +623,6 @@ if ((var_name == nullptr) || (var_name[0] == '\0')) { result.AppendError( "'settings remove' command requires a valid variable name"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -644,7 +634,6 @@ &m_exe_ctx, eVarSetOperationRemove, var_name, var_value)); if (error.Fail()) { result.AppendError(error.AsCString()); - result.SetStatus(eReturnStatusFailed); return false; } @@ -728,7 +717,6 @@ if ((var_name == nullptr) || (var_name[0] == '\0')) { result.AppendError("'settings replace' command requires a valid variable " "name; No value supplied"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -740,7 +728,6 @@ &m_exe_ctx, eVarSetOperationReplace, var_name, var_value)); if (error.Fail()) { result.AppendError(error.AsCString()); - result.SetStatus(eReturnStatusFailed); return false; } else { result.SetStatus(eReturnStatusSuccessFinishNoResult); @@ -822,7 +809,6 @@ if (argc < 3) { result.AppendError("'settings insert-before' takes more arguments"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -830,7 +816,6 @@ if ((var_name == nullptr) || (var_name[0] == '\0')) { result.AppendError("'settings insert-before' command requires a valid " "variable name; No value supplied"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -842,7 +827,6 @@ &m_exe_ctx, eVarSetOperationInsertBefore, var_name, var_value)); if (error.Fail()) { result.AppendError(error.AsCString()); - result.SetStatus(eReturnStatusFailed); return false; } @@ -921,7 +905,6 @@ if (argc < 3) { result.AppendError("'settings insert-after' takes more arguments"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -929,7 +912,6 @@ if ((var_name == nullptr) || (var_name[0] == '\0')) { result.AppendError("'settings insert-after' command requires a valid " "variable name; No value supplied"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -941,7 +923,6 @@ &m_exe_ctx, eVarSetOperationInsertAfter, var_name, var_value)); if (error.Fail()) { result.AppendError(error.AsCString()); - result.SetStatus(eReturnStatusFailed); return false; } @@ -1008,7 +989,6 @@ if (argc < 2) { result.AppendError("'settings append' takes more arguments"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -1016,7 +996,6 @@ if ((var_name == nullptr) || (var_name[0] == '\0')) { result.AppendError("'settings append' command requires a valid variable " "name; No value supplied"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -1031,7 +1010,6 @@ &m_exe_ctx, eVarSetOperationAppend, var_name, var_value)); if (error.Fail()) { result.AppendError(error.AsCString()); - result.SetStatus(eReturnStatusFailed); return false; } @@ -1117,7 +1095,6 @@ if (m_options.m_clear_all) { if (argc != 0) { result.AppendError("'settings clear --all' doesn't take any arguments"); - result.SetStatus(eReturnStatusFailed); return false; } GetDebugger().GetValueProperties()->Clear(); @@ -1126,7 +1103,6 @@ if (argc != 1) { result.AppendError("'settings clear' takes exactly one argument"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -1134,7 +1110,6 @@ if ((var_name == nullptr) || (var_name[0] == '\0')) { result.AppendError("'settings clear' command requires a valid variable " "name; No value supplied"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -1142,7 +1117,6 @@ &m_exe_ctx, eVarSetOperationClear, var_name, llvm::StringRef())); if (error.Fail()) { result.AppendError(error.AsCString()); - result.SetStatus(eReturnStatusFailed); return false; } diff --git a/lldb/source/Commands/CommandObjectSource.cpp b/lldb/source/Commands/CommandObjectSource.cpp --- a/lldb/source/Commands/CommandObjectSource.cpp +++ b/lldb/source/Commands/CommandObjectSource.cpp @@ -541,7 +541,6 @@ if (argc != 0) { result.AppendErrorWithFormat("'%s' takes no arguments, only flags.\n", GetCommandName().str().c_str()); - result.SetStatus(eReturnStatusFailed); return false; } @@ -551,7 +550,6 @@ if (target == nullptr) { result.AppendError("invalid target, create a debug target using the " "'target create' command."); - result.SetStatus(eReturnStatusFailed); return false; } } @@ -575,12 +573,10 @@ } if (!m_module_list.GetSize()) { result.AppendError("No modules match the input."); - result.SetStatus(eReturnStatusFailed); return false; } } else if (target->GetImages().GetSize() == 0) { result.AppendError("The target has no associated executable images."); - result.SetStatus(eReturnStatusFailed); return false; } @@ -811,7 +807,6 @@ result.AppendErrorWithFormat("Could not find line information for " "start of function: \"%s\".\n", source_info.function.GetCString()); - result.SetStatus(eReturnStatusFailed); return 0; } sc.function->GetEndLineSourceInfo(end_file, end_line); @@ -933,7 +928,6 @@ if (argc != 0) { result.AppendErrorWithFormat("'%s' takes no arguments, only flags.\n", GetCommandName().str().c_str()); - result.SetStatus(eReturnStatusFailed); return false; } @@ -971,7 +965,6 @@ if (num_matches == 0) { result.AppendErrorWithFormat("Could not find function named: \"%s\".\n", m_options.symbol_name.c_str()); - result.SetStatus(eReturnStatusFailed); return false; } @@ -1038,7 +1031,6 @@ "no modules have source information for file address 0x%" PRIx64 ".\n", m_options.address); - result.SetStatus(eReturnStatusFailed); return false; } } else { @@ -1061,7 +1053,6 @@ "is no line table information " "available for this address.\n", error_strm.GetData()); - result.SetStatus(eReturnStatusFailed); return false; } } @@ -1071,7 +1062,6 @@ result.AppendErrorWithFormat( "no modules contain load address 0x%" PRIx64 ".\n", m_options.address); - result.SetStatus(eReturnStatusFailed); return false; } } @@ -1191,7 +1181,6 @@ if (num_matches == 0) { result.AppendErrorWithFormat("Could not find source file \"%s\".\n", m_options.file_name.c_str()); - result.SetStatus(eReturnStatusFailed); return false; } @@ -1215,7 +1204,6 @@ result.AppendErrorWithFormat( "Multiple source files found matching: \"%s.\"\n", m_options.file_name.c_str()); - result.SetStatus(eReturnStatusFailed); return false; } } @@ -1245,7 +1233,6 @@ } else { result.AppendErrorWithFormat("No comp unit found for: \"%s.\"\n", m_options.file_name.c_str()); - result.SetStatus(eReturnStatusFailed); return false; } } diff --git a/lldb/source/Commands/CommandObjectStats.cpp b/lldb/source/Commands/CommandObjectStats.cpp --- a/lldb/source/Commands/CommandObjectStats.cpp +++ b/lldb/source/Commands/CommandObjectStats.cpp @@ -28,7 +28,6 @@ if (target.GetCollectingStats()) { result.AppendError("statistics already enabled"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -53,7 +52,6 @@ if (!target.GetCollectingStats()) { result.AppendError("need to enable statistics before disabling them"); - result.SetStatus(eReturnStatusFailed); return false; } diff --git a/lldb/source/Commands/CommandObjectTarget.cpp b/lldb/source/Commands/CommandObjectTarget.cpp --- a/lldb/source/Commands/CommandObjectTarget.cpp +++ b/lldb/source/Commands/CommandObjectTarget.cpp @@ -278,7 +278,6 @@ result.AppendErrorWithFormatv("Cannot open '{0}': {1}.", core_file.GetPath(), llvm::toString(file.takeError())); - result.SetStatus(eReturnStatusFailed); return false; } } @@ -293,7 +292,6 @@ result.AppendErrorWithFormatv("Cannot open '{0}': {1}.", symfile.GetPath(), llvm::toString(file.takeError())); - result.SetStatus(eReturnStatusFailed); return false; } } @@ -366,13 +364,11 @@ // make up a local file result.AppendError("remote --> local transfer without local " "path is not implemented yet"); - result.SetStatus(eReturnStatusFailed); return false; } } } else { result.AppendError("no platform found for target"); - result.SetStatus(eReturnStatusFailed); return false; } } @@ -414,7 +410,6 @@ if (error.Fail()) { result.AppendError( error.AsCString("can't find plug-in for core file")); - result.SetStatus(eReturnStatusFailed); return false; } else { result.AppendMessageWithFormatv( @@ -427,7 +422,6 @@ result.AppendErrorWithFormatv( "Unable to find process plug-in for core file '{0}'\n", core_file.GetPath()); - result.SetStatus(eReturnStatusFailed); } } else { result.AppendMessageWithFormat( @@ -441,7 +435,6 @@ result.AppendErrorWithFormat("'%s' takes exactly one executable path " "argument, or use the --core option.\n", m_cmd_name.c_str()); - result.SetStatus(eReturnStatusFailed); } return result.Succeeded(); @@ -482,7 +475,6 @@ result.SetStatus(eReturnStatusSuccessFinishResult); } else { result.AppendError("the 'target list' command takes no arguments\n"); - result.SetStatus(eReturnStatusFailed); } return result.Succeeded(); } @@ -524,17 +516,14 @@ "index %u is out of range since there are no active targets\n", target_idx); } - result.SetStatus(eReturnStatusFailed); } } else { result.AppendErrorWithFormat("invalid index string value '%s'\n", target_idx_arg); - result.SetStatus(eReturnStatusFailed); } } else { result.AppendError( "'target select' takes a single argument: a target index\n"); - result.SetStatus(eReturnStatusFailed); } return result.Succeeded(); } @@ -584,7 +573,6 @@ // Bail out if don't have any targets. if (num_targets == 0) { result.AppendError("no targets to delete"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -593,7 +581,6 @@ if (entry.ref().getAsInteger(0, target_idx)) { result.AppendErrorWithFormat("invalid target index '%s'\n", entry.c_str()); - result.SetStatus(eReturnStatusFailed); return false; } if (target_idx < num_targets) { @@ -612,14 +599,12 @@ "target index %u is out of range, the only valid index is 0\n", target_idx); - result.SetStatus(eReturnStatusFailed); return false; } } else { target_sp = target_list.GetSelectedTarget(); if (!target_sp) { result.AppendErrorWithFormat("no target is currently selected\n"); - result.SetStatus(eReturnStatusFailed); return false; } delete_target_list.push_back(target_sp); @@ -852,7 +837,6 @@ if (!regex.IsValid()) { result.GetErrorStream().Printf( "error: invalid regular expression: '%s'\n", arg.c_str()); - result.SetStatus(eReturnStatusFailed); return false; } use_var_name = true; @@ -930,7 +914,6 @@ } else result.AppendError("'target variable' takes one or more global " "variable names as arguments\n"); - result.SetStatus(eReturnStatusFailed); } } else { SymbolContextList sc_list; @@ -1053,7 +1036,6 @@ const size_t argc = command.GetArgumentCount(); if (argc & 1) { result.AppendError("add requires an even number of arguments\n"); - result.SetStatus(eReturnStatusFailed); } else { for (size_t i = 0; i < argc; i += 2) { const char *from = command.GetArgumentAtIndex(i); @@ -1077,7 +1059,6 @@ result.AppendError(" can't be empty\n"); else result.AppendError(" can't be empty\n"); - result.SetStatus(eReturnStatusFailed); } } } @@ -1185,7 +1166,6 @@ result.AppendErrorWithFormat( " parameter is not an integer: '%s'.\n", command.GetArgumentAtIndex(0)); - result.SetStatus(eReturnStatusFailed); return result.Succeeded(); } @@ -1207,13 +1187,11 @@ result.AppendError(" can't be empty\n"); else result.AppendError(" can't be empty\n"); - result.SetStatus(eReturnStatusFailed); return false; } } } else { result.AppendError("insert requires at least three arguments\n"); - result.SetStatus(eReturnStatusFailed); return result.Succeeded(); } return result.Succeeded(); @@ -1238,7 +1216,6 @@ Target *target = &GetSelectedTarget(); if (command.GetArgumentCount() != 0) { result.AppendError("list takes no arguments\n"); - result.SetStatus(eReturnStatusFailed); return result.Succeeded(); } @@ -1279,7 +1256,6 @@ Target *target = &GetSelectedTarget(); if (command.GetArgumentCount() != 1) { result.AppendError("query requires one argument\n"); - result.SetStatus(eReturnStatusFailed); return result.Succeeded(); } @@ -1899,7 +1875,6 @@ target->GetImages()); if (num_dumped == 0) { result.AppendError("the target has no associated executable images"); - result.SetStatus(eReturnStatusFailed); } } else { // Find the modules that match the basename or full path. @@ -1924,7 +1899,6 @@ result.SetStatus(eReturnStatusSuccessFinishResult); } else { result.AppendError("no matching executable images found"); - result.SetStatus(eReturnStatusFailed); } return result.Succeeded(); } @@ -2043,7 +2017,6 @@ } } else { result.AppendError("the target has no associated executable images"); - result.SetStatus(eReturnStatusFailed); return false; } } else { @@ -2080,7 +2053,6 @@ result.SetStatus(eReturnStatusSuccessFinishResult); else { result.AppendError("no matching executable images found"); - result.SetStatus(eReturnStatusFailed); } return result.Succeeded(); } @@ -2118,7 +2090,6 @@ const size_t num_modules = target->GetImages().GetSize(); if (num_modules == 0) { result.AppendError("the target has no associated executable images"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -2167,7 +2138,6 @@ result.SetStatus(eReturnStatusSuccessFinishResult); else { result.AppendError("no matching executable images found"); - result.SetStatus(eReturnStatusFailed); } return result.Succeeded(); } @@ -2197,7 +2167,6 @@ const size_t num_modules = module_list.GetSize(); if (num_modules == 0) { result.AppendError("the target has no associated executable images"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -2275,7 +2244,6 @@ const size_t num_modules = target_modules.GetSize(); if (num_modules == 0) { result.AppendError("the target has no associated executable images"); - result.SetStatus(eReturnStatusFailed); return false; } result.GetOutputStream().Format( @@ -2315,7 +2283,6 @@ result.SetStatus(eReturnStatusSuccessFinishResult); else { result.AppendError("no matching executable images found"); - result.SetStatus(eReturnStatusFailed); } return result.Succeeded(); } @@ -2351,7 +2318,6 @@ if (command.GetArgumentCount() == 0) { result.AppendError("file option must be specified."); - result.SetStatus(eReturnStatusFailed); return result.Succeeded(); } else { // Dump specified images (by basename or fullpath) @@ -2388,7 +2354,6 @@ result.SetStatus(eReturnStatusSuccessFinishResult); else { result.AppendError("no source filenames matched any command arguments"); - result.SetStatus(eReturnStatusFailed); } return result.Succeeded(); } @@ -2534,7 +2499,6 @@ "or symbol file with UUID %s", strm.GetData()); } - result.SetStatus(eReturnStatusFailed); return false; } } else { @@ -2543,13 +2507,11 @@ result.AppendErrorWithFormat( "Unable to locate the executable or symbol file with UUID %s", strm.GetData()); - result.SetStatus(eReturnStatusFailed); return false; } } else { result.AppendError( "one or more executable image paths must be specified"); - result.SetStatus(eReturnStatusFailed); return false; } } else { @@ -2586,7 +2548,6 @@ result.SetStatus(eReturnStatusSuccessFinishResult); } else { std::string resolved_path = file_spec.GetPath(); - result.SetStatus(eReturnStatusFailed); if (resolved_path != entry.ref()) { result.AppendErrorWithFormat( "invalid module path '%s' with resolved path '%s'\n", @@ -2684,12 +2645,10 @@ search_using_module_spec = false; result.AppendErrorWithFormat( "more than 1 module matched by name '%s'\n", arg_cstr); - result.SetStatus(eReturnStatusFailed); } else { search_using_module_spec = false; result.AppendErrorWithFormat("no object file for module '%s'\n", arg_cstr); - result.SetStatus(eReturnStatusFailed); } } @@ -2723,7 +2682,6 @@ } else { result.AppendError("one or more section name + load " "address pair must be specified"); - result.SetStatus(eReturnStatusFailed); return false; } } else { @@ -2731,7 +2689,6 @@ result.AppendError("The \"--slide \" option can't " "be used in conjunction with setting " "section load addresses.\n"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -2750,7 +2707,6 @@ "thread specific sections are not yet " "supported (section '%s')\n", sect_name); - result.SetStatus(eReturnStatusFailed); break; } else { if (target->GetSectionLoadList() @@ -2765,13 +2721,11 @@ "matches the section " "name '%s'\n", sect_name); - result.SetStatus(eReturnStatusFailed); break; } } else { result.AppendErrorWithFormat( "invalid load address string '%s'\n", load_addr_cstr); - result.SetStatus(eReturnStatusFailed); break; } } else { @@ -2781,7 +2735,6 @@ else result.AppendError("one or more section name + load " "address pair must be specified.\n"); - result.SetStatus(eReturnStatusFailed); break; } } @@ -2824,7 +2777,6 @@ result.AppendErrorWithFormat("failed to set PC value to " "0x%" PRIx64 "\n", file_entry_addr); - result.SetStatus(eReturnStatusFailed); } } } @@ -2832,13 +2784,11 @@ module->GetFileSpec().GetPath(path, sizeof(path)); result.AppendErrorWithFormat("no sections in object file '%s'\n", path); - result.SetStatus(eReturnStatusFailed); } } else { module->GetFileSpec().GetPath(path, sizeof(path)); result.AppendErrorWithFormat("no object file for module '%s'\n", path); - result.SetStatus(eReturnStatusFailed); } } else { FileSpec *module_spec_file = module_spec.GetFileSpecPtr(); @@ -2847,7 +2797,6 @@ result.AppendErrorWithFormat("invalid module '%s'.\n", path); } else result.AppendError("no module spec"); - result.SetStatus(eReturnStatusFailed); } } else { std::string uuid_str; @@ -2875,12 +2824,10 @@ path[0] ? " file=" : "", path, !uuid_str.empty() ? " uuid=" : "", uuid_str.c_str()); } - result.SetStatus(eReturnStatusFailed); } } else { result.AppendError("either the \"--file \" or the \"--uuid " "\" option must be specified.\n"); - result.SetStatus(eReturnStatusFailed); return false; } return result.Succeeded(); @@ -2963,7 +2910,6 @@ if (target == nullptr && !use_global_module_list) { result.AppendError("invalid target, create a debug target using the " "'target create' command"); - result.SetStatus(eReturnStatusFailed); return false; } else { if (target) { @@ -2987,18 +2933,15 @@ result.AppendErrorWithFormat( "Couldn't find module matching address: 0x%" PRIx64 ".", m_options.m_module_addr); - result.SetStatus(eReturnStatusFailed); } } else { result.AppendErrorWithFormat( "Couldn't find module containing address: 0x%" PRIx64 ".", m_options.m_module_addr); - result.SetStatus(eReturnStatusFailed); } } else { result.AppendError( "Can only look up modules by address with a valid target."); - result.SetStatus(eReturnStatusFailed); } return result.Succeeded(); } @@ -3030,7 +2973,6 @@ if (argc == 1) { result.AppendErrorWithFormat("no modules found that match '%s'", arg.c_str()); - result.SetStatus(eReturnStatusFailed); return false; } } @@ -3077,7 +3019,6 @@ result.AppendError( "the target has no associated executable images"); } - result.SetStatus(eReturnStatusFailed); return false; } } @@ -3326,21 +3267,18 @@ if (process == nullptr) { result.AppendError( "You must have a process running to use this command."); - result.SetStatus(eReturnStatusFailed); return false; } ThreadList threads(process->GetThreadList()); if (threads.GetSize() == 0) { result.AppendError("The process must be paused to use this command."); - result.SetStatus(eReturnStatusFailed); return false; } ThreadSP thread(threads.GetThreadAtIndex(0)); if (!thread) { result.AppendError("The process must be paused to use this command."); - result.SetStatus(eReturnStatusFailed); return false; } @@ -3365,7 +3303,6 @@ } else { result.AppendError( "address-expression or function name option must be specified."); - result.SetStatus(eReturnStatusFailed); return false; } @@ -3373,7 +3310,6 @@ if (num_matches == 0) { result.AppendErrorWithFormat("no unwind data found that matches '%s'.", m_options.m_str.c_str()); - result.SetStatus(eReturnStatusFailed); return false; } @@ -3890,7 +3826,6 @@ std::lock_guard guard(target_modules.GetMutex()); if (target_modules.GetSize() == 0) { result.AppendError("the target has no associated executable images"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -4060,7 +3995,6 @@ if (!symbol_fspec) { result.AppendError( "one or more executable image paths must be specified"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -4142,7 +4076,6 @@ "use the --uuid option to resolve the " "ambiguity.\n", symfile_path); - result.SetStatus(eReturnStatusFailed); return false; } @@ -4209,7 +4142,6 @@ !llvm::sys::fs::is_regular_file(symbol_fspec.GetPath()) ? "\n please specify the full path to the symbol file" : ""); - result.SetStatus(eReturnStatusFailed); return false; } @@ -4773,7 +4705,6 @@ // FIXME: Set the stop hook ID counter back. result.AppendErrorWithFormat("Couldn't add stop hook: %s", error.AsCString()); - result.SetStatus(eReturnStatusFailed); target.UndoCreateStopHook(new_hook_sp->GetID()); return false; } @@ -4834,13 +4765,11 @@ if (!llvm::to_integer(command.GetArgumentAtIndex(i), user_id)) { result.AppendErrorWithFormat("invalid stop hook id: \"%s\".\n", command.GetArgumentAtIndex(i)); - result.SetStatus(eReturnStatusFailed); return false; } if (!target.RemoveStopHookByID(user_id)) { result.AppendErrorWithFormat("unknown stop hook id: \"%s\".\n", command.GetArgumentAtIndex(i)); - result.SetStatus(eReturnStatusFailed); return false; } } @@ -4889,14 +4818,12 @@ if (!llvm::to_integer(command.GetArgumentAtIndex(i), user_id)) { result.AppendErrorWithFormat("invalid stop hook id: \"%s\".\n", command.GetArgumentAtIndex(i)); - result.SetStatus(eReturnStatusFailed); return false; } success = target.SetStopHookActiveStateByID(user_id, m_enable); if (!success) { result.AppendErrorWithFormat("unknown stop hook id: \"%s\".\n", command.GetArgumentAtIndex(i)); - result.SetStatus(eReturnStatusFailed); return false; } } diff --git a/lldb/source/Commands/CommandObjectThread.cpp b/lldb/source/Commands/CommandObjectThread.cpp --- a/lldb/source/Commands/CommandObjectThread.cpp +++ b/lldb/source/Commands/CommandObjectThread.cpp @@ -154,7 +154,6 @@ result.AppendErrorWithFormat( "thread disappeared while computing backtraces: 0x%" PRIx64 "\n", tid); - result.SetStatus(eReturnStatusFailed); return false; } @@ -173,7 +172,6 @@ result.AppendErrorWithFormat( "error displaying backtrace for thread: \"0x%4.4x\"\n", thread->GetIndexID()); - result.SetStatus(eReturnStatusFailed); return false; } if (m_options.m_extended_backtrace) { @@ -385,7 +383,6 @@ if (thread == nullptr) { result.AppendError("no selected thread in process"); - result.SetStatus(eReturnStatusFailed); return false; } } else { @@ -395,7 +392,6 @@ if (!llvm::to_integer(thread_idx_cstr, step_thread_idx)) { result.AppendErrorWithFormat("invalid thread index '%s'.\n", thread_idx_cstr); - result.SetStatus(eReturnStatusFailed); return false; } thread = @@ -404,7 +400,6 @@ result.AppendErrorWithFormat( "Thread index %u is out of range (valid values are 0 - %u).\n", step_thread_idx, num_threads); - result.SetStatus(eReturnStatusFailed); return false; } } @@ -412,14 +407,12 @@ if (m_step_type == eStepTypeScripted) { if (m_class_options.GetName().empty()) { result.AppendErrorWithFormat("empty class name for scripted step."); - result.SetStatus(eReturnStatusFailed); return false; } else if (!GetDebugger().GetScriptInterpreter()->CheckObjectExists( m_class_options.GetName().c_str())) { result.AppendErrorWithFormat( "class for scripted step: \"%s\" does not exist.", m_class_options.GetName().c_str()); - result.SetStatus(eReturnStatusFailed); return false; } } @@ -428,7 +421,6 @@ m_step_type != eStepTypeInto) { result.AppendErrorWithFormat( "end line option is only valid for step into"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -461,7 +453,6 @@ error)) { result.AppendErrorWithFormat("invalid end-line option: %s.", error.AsCString()); - result.SetStatus(eReturnStatusFailed); return false; } } else if (m_options.m_end_line_is_block_end) { @@ -469,7 +460,6 @@ Block *block = frame->GetSymbolContext(eSymbolContextBlock).block; if (!block) { result.AppendErrorWithFormat("Could not find the current block."); - result.SetStatus(eReturnStatusFailed); return false; } @@ -479,7 +469,6 @@ if (!block_range.GetBaseAddress().IsValid()) { result.AppendErrorWithFormat( "Could not find the current block address."); - result.SetStatus(eReturnStatusFailed); return false; } lldb::addr_t pc_offset_in_block = @@ -538,7 +527,6 @@ new_plan_status); } else { result.AppendError("step type is not supported"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -570,7 +558,6 @@ if (!error.Success()) { result.AppendMessage(error.AsCString()); - result.SetStatus(eReturnStatusFailed); return false; } @@ -594,7 +581,6 @@ } } else { result.SetError(new_plan_status); - result.SetStatus(eReturnStatusFailed); } return result.Succeeded(); } @@ -650,7 +636,6 @@ Process *process = m_exe_ctx.GetProcessPtr(); if (process == nullptr) { result.AppendError("no process exists. Cannot continue"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -671,7 +656,6 @@ if (entry.ref().getAsInteger(0, thread_idx)) { result.AppendErrorWithFormat( "invalid thread index argument: \"%s\".\n", entry.c_str()); - result.SetStatus(eReturnStatusFailed); return false; } Thread *thread = @@ -682,14 +666,12 @@ } else { result.AppendErrorWithFormat("invalid thread index %u.\n", thread_idx); - result.SetStatus(eReturnStatusFailed); return false; } } if (resume_threads.empty()) { result.AppendError("no valid thread indexes were specified"); - result.SetStatus(eReturnStatusFailed); return false; } else { if (resume_threads.size() == 1) @@ -729,7 +711,6 @@ Thread *current_thread = GetDefaultThread(); if (current_thread == nullptr) { result.AppendError("the process doesn't have a current thread"); - result.SetStatus(eReturnStatusFailed); return false; } // Set the actions that the threads should each take when resuming @@ -772,13 +753,11 @@ } else { result.AppendErrorWithFormat("Failed to resume process: %s\n", error.AsCString()); - result.SetStatus(eReturnStatusFailed); } } else { result.AppendErrorWithFormat( "Process cannot be continued from its current state (%s).\n", StateAsCString(state)); - result.SetStatus(eReturnStatusFailed); } return result.Succeeded(); @@ -916,7 +895,6 @@ Process *process = m_exe_ctx.GetProcessPtr(); if (process == nullptr) { result.AppendError("need a valid process to step"); - result.SetStatus(eReturnStatusFailed); } else { Thread *thread = nullptr; std::vector line_numbers; @@ -928,7 +906,6 @@ if (!llvm::to_integer(command.GetArgumentAtIndex(i), line_number)) { result.AppendErrorWithFormat("invalid line number: '%s'.\n", command.GetArgumentAtIndex(i)); - result.SetStatus(eReturnStatusFailed); return false; } else line_numbers.push_back(line_number); @@ -936,7 +913,6 @@ } else if (m_options.m_until_addrs.empty()) { result.AppendErrorWithFormat("No line number or address provided:\n%s", GetSyntax().str().c_str()); - result.SetStatus(eReturnStatusFailed); return false; } @@ -953,7 +929,6 @@ result.AppendErrorWithFormat( "Thread index %u is out of range (valid values are 0 - %u).\n", m_options.m_thread_idx, num_threads); - result.SetStatus(eReturnStatusFailed); return false; } @@ -965,7 +940,6 @@ result.AppendErrorWithFormat( "Frame index %u is out of range for thread %u.\n", m_options.m_frame_idx, m_options.m_thread_idx); - result.SetStatus(eReturnStatusFailed); return false; } @@ -985,7 +959,6 @@ "frame %u of thread index %u.\n", m_options.m_frame_idx, m_options.m_thread_idx); - result.SetStatus(eReturnStatusFailed); return false; } @@ -1045,7 +1018,6 @@ result.AppendErrorWithFormat( "Until target outside of the current function.\n"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -1061,14 +1033,12 @@ new_plan_sp->SetOkayToDiscard(false); } else { result.SetError(new_plan_status); - result.SetStatus(eReturnStatusFailed); return false; } } else { result.AppendErrorWithFormat( "Frame index %u of thread %u has no debug information.\n", m_options.m_frame_idx, m_options.m_thread_idx); - result.SetStatus(eReturnStatusFailed); return false; } @@ -1098,7 +1068,6 @@ } else { result.AppendErrorWithFormat("Failed to resume process: %s.\n", error.AsCString()); - result.SetStatus(eReturnStatusFailed); } } return result.Succeeded(); @@ -1150,13 +1119,11 @@ Process *process = m_exe_ctx.GetProcessPtr(); if (process == nullptr) { result.AppendError("no process"); - result.SetStatus(eReturnStatusFailed); return false; } else if (command.GetArgumentCount() != 1) { result.AppendErrorWithFormat( "'%s' takes exactly one thread index argument:\nUsage: %s\n", m_cmd_name.c_str(), m_cmd_syntax.c_str()); - result.SetStatus(eReturnStatusFailed); return false; } @@ -1164,7 +1131,6 @@ if (!llvm::to_integer(command.GetArgumentAtIndex(0), index_id)) { result.AppendErrorWithFormat("Invalid thread index '%s'", command.GetArgumentAtIndex(0)); - result.SetStatus(eReturnStatusFailed); return false; } @@ -1173,7 +1139,6 @@ if (new_thread == nullptr) { result.AppendErrorWithFormat("invalid thread #%s.\n", command.GetArgumentAtIndex(0)); - result.SetStatus(eReturnStatusFailed); return false; } @@ -1292,7 +1257,6 @@ if (!thread_sp) { result.AppendErrorWithFormat("thread no longer exists: 0x%" PRIx64 "\n", tid); - result.SetStatus(eReturnStatusFailed); return false; } @@ -1304,7 +1268,6 @@ m_options.m_json_stopinfo)) { result.AppendErrorWithFormat("error displaying info for thread: \"%d\"\n", thread->GetIndexID()); - result.SetStatus(eReturnStatusFailed); return false; } return true; @@ -1342,7 +1305,6 @@ if (!thread_sp) { result.AppendErrorWithFormat("thread no longer exists: 0x%" PRIx64 "\n", tid); - result.SetStatus(eReturnStatusFailed); return false; } @@ -1465,7 +1427,6 @@ if (!error.Success()) { result.AppendErrorWithFormat("Unwinding expression failed - %s.", error.AsCString()); - result.SetStatus(eReturnStatusFailed); } else { bool success = thread->SetSelectedFrameByIndexNoisily(0, result.GetOutputStream()); @@ -1475,7 +1436,6 @@ } else { result.AppendErrorWithFormat( "Could not select 0th frame after unwinding expression."); - result.SetStatus(eReturnStatusFailed); } } return result.Succeeded(); @@ -1488,7 +1448,6 @@ if (frame_sp->IsInlined()) { result.AppendError("Don't know how to return from inlined frames."); - result.SetStatus(eReturnStatusFailed); return false; } @@ -1510,7 +1469,6 @@ else result.AppendErrorWithFormat( "Unknown error evaluating result expression."); - result.SetStatus(eReturnStatusFailed); return false; } } @@ -1523,7 +1481,6 @@ result.AppendErrorWithFormat( "Error returning from frame %d of thread %d: %s.", frame_idx, thread_sp->GetIndexID(), error.AsCString()); - result.SetStatus(eReturnStatusFailed); return false; } @@ -1625,14 +1582,12 @@ lldb::addr_t callAddr = dest.GetCallableLoadAddress(target); if (callAddr == LLDB_INVALID_ADDRESS) { result.AppendErrorWithFormat("Invalid destination address."); - result.SetStatus(eReturnStatusFailed); return false; } if (!reg_ctx->SetPC(callAddr)) { result.AppendErrorWithFormat("Error changing PC value for thread %d.", thread->GetIndexID()); - result.SetStatus(eReturnStatusFailed); return false; } } else { @@ -1649,7 +1604,6 @@ if (!file) { result.AppendErrorWithFormat( "No source file available for the current location."); - result.SetStatus(eReturnStatusFailed); return false; } @@ -1776,7 +1730,6 @@ if (!success) { result.SetError("Error dumping plans:"); result.AppendError(tmp_strm.GetString()); - result.SetStatus(eReturnStatusFailed); return false; } // Otherwise, add our data to the output: @@ -1853,7 +1806,6 @@ result.AppendErrorWithFormat("Too many arguments, expected one - the " "thread plan index - but got %zu.", args.GetArgumentCount()); - result.SetStatus(eReturnStatusFailed); return false; } @@ -1862,14 +1814,12 @@ result.AppendErrorWithFormat( "Invalid thread index: \"%s\" - should be unsigned int.", args.GetArgumentAtIndex(0)); - result.SetStatus(eReturnStatusFailed); return false; } if (thread_plan_idx == 0) { result.AppendErrorWithFormat( "You wouldn't really want me to discard the base thread plan."); - result.SetStatus(eReturnStatusFailed); return false; } @@ -1880,7 +1830,6 @@ result.AppendErrorWithFormat( "Could not find User thread plan with index %s.", args.GetArgumentAtIndex(0)); - result.SetStatus(eReturnStatusFailed); return false; } } @@ -1936,13 +1885,11 @@ if (!llvm::to_integer(args.GetArgumentAtIndex(i), tid)) { result.AppendErrorWithFormat("invalid thread specification: \"%s\"\n", args.GetArgumentAtIndex(i)); - result.SetStatus(eReturnStatusFailed); return false; } if (!process->PruneThreadPlansForTID(tid)) { result.AppendErrorWithFormat("Could not find unreported tid: \"%s\"\n", args.GetArgumentAtIndex(i)); - result.SetStatus(eReturnStatusFailed); return false; } } diff --git a/lldb/source/Commands/CommandObjectThreadUtil.cpp b/lldb/source/Commands/CommandObjectThreadUtil.cpp --- a/lldb/source/Commands/CommandObjectThreadUtil.cpp +++ b/lldb/source/Commands/CommandObjectThreadUtil.cpp @@ -58,7 +58,6 @@ if (!llvm::to_integer(command.GetArgumentAtIndex(i), thread_idx)) { result.AppendErrorWithFormat("invalid thread specification: \"%s\"\n", command.GetArgumentAtIndex(i)); - result.SetStatus(eReturnStatusFailed); return false; } @@ -68,7 +67,6 @@ if (!thread) { result.AppendErrorWithFormat("no thread with index: \"%s\"\n", command.GetArgumentAtIndex(i)); - result.SetStatus(eReturnStatusFailed); return false; } @@ -129,7 +127,6 @@ Thread *thread = process->GetThreadList().FindThreadByID(tid).get(); if (thread == nullptr) { result.AppendErrorWithFormatv("Failed to process thread #{0}.\n", tid); - result.SetStatus(eReturnStatusFailed); return false; } @@ -181,7 +178,6 @@ if (!llvm::to_integer(command.GetArgumentAtIndex(i), thread_idx)) { result.AppendErrorWithFormat("invalid thread specification: \"%s\"\n", command.GetArgumentAtIndex(i)); - result.SetStatus(eReturnStatusFailed); return false; } @@ -190,7 +186,6 @@ if (!thread) { result.AppendErrorWithFormat("no thread with index: \"%s\"\n", command.GetArgumentAtIndex(i)); - result.SetStatus(eReturnStatusFailed); return false; } diff --git a/lldb/source/Commands/CommandObjectTrace.cpp b/lldb/source/Commands/CommandObjectTrace.cpp --- a/lldb/source/Commands/CommandObjectTrace.cpp +++ b/lldb/source/Commands/CommandObjectTrace.cpp @@ -87,14 +87,12 @@ result.AppendError( "a single path to a JSON file containing a trace session" "is required"); - result.SetStatus(eReturnStatusFailed); return false; } auto end_with_failure = [&result](llvm::Error err) -> bool { result.AppendErrorWithFormat("%s\n", llvm::toString(std::move(err)).c_str()); - result.SetStatus(eReturnStatusFailed); return false; }; @@ -190,7 +188,6 @@ result.SetStatus(eReturnStatusSuccessFinishResult); } else { result.AppendErrorWithFormat("%s\n", error.AsCString()); - result.SetStatus(eReturnStatusFailed); } return result.Succeeded(); } @@ -281,7 +278,6 @@ result.SetStatus(eReturnStatusSuccessFinishResult); } else { result.AppendErrorWithFormat("%s\n", error.AsCString()); - result.SetStatus(eReturnStatusFailed); } return result.Succeeded(); } diff --git a/lldb/source/Commands/CommandObjectType.cpp b/lldb/source/Commands/CommandObjectType.cpp --- a/lldb/source/Commands/CommandObjectType.cpp +++ b/lldb/source/Commands/CommandObjectType.cpp @@ -377,7 +377,6 @@ result.AppendError("must either provide a children list, a Python class " "name, or use -P and type a Python class " "line-by-line"); - result.SetStatus(eReturnStatusFailed); return false; } } @@ -639,7 +638,6 @@ if (argc < 1) { result.AppendErrorWithFormat("%s takes one or more args.\n", m_cmd_name.c_str()); - result.SetStatus(eReturnStatusFailed); return false; } @@ -648,7 +646,6 @@ m_command_options.m_custom_type_name.empty()) { result.AppendErrorWithFormat("%s needs a valid format.\n", m_cmd_name.c_str()); - result.SetStatus(eReturnStatusFailed); return false; } @@ -681,7 +678,6 @@ for (auto &arg_entry : command.entries()) { if (arg_entry.ref().empty()) { result.AppendError("empty typenames not allowed"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -691,7 +687,6 @@ if (!typeRX.IsValid()) { result.AppendError( "regex format error (maybe this is not really a regex?)"); - result.SetStatus(eReturnStatusFailed); return false; } category_sp->GetRegexTypeSummariesContainer()->Delete(typeCS); @@ -821,7 +816,6 @@ if (argc != 1) { result.AppendErrorWithFormat("%s takes 1 arg.\n", m_cmd_name.c_str()); - result.SetStatus(eReturnStatusFailed); return false; } @@ -830,7 +824,6 @@ if (!typeCS) { result.AppendError("empty typenames not allowed"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -868,7 +861,6 @@ return result.Succeeded(); } else { result.AppendErrorWithFormat("no custom formatter for %s.\n", typeA); - result.SetStatus(eReturnStatusFailed); return false; } } @@ -1073,7 +1065,6 @@ result.AppendErrorWithFormat( "syntax error in category regular expression '%s'", m_options.m_category_regex.GetCurrentValueAsRef().str().c_str()); - result.SetStatus(eReturnStatusFailed); return false; } } @@ -1084,7 +1075,6 @@ if (!formatter_regex->IsValid()) { result.AppendErrorWithFormat("syntax error in regular expression '%s'", arg); - result.SetStatus(eReturnStatusFailed); return false; } } @@ -1293,7 +1283,6 @@ if (argc < 1 && !m_options.m_name) { result.AppendErrorWithFormat("%s takes one or more args.\n", m_cmd_name.c_str()); - result.SetStatus(eReturnStatusFailed); return false; } @@ -1305,7 +1294,6 @@ const char *funct_name = m_options.m_python_function.c_str(); if (!funct_name || !funct_name[0]) { result.AppendError("function name empty.\n"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -1329,7 +1317,6 @@ if (!interpreter) { result.AppendError("script interpreter missing - unable to generate " "function wrapper.\n"); - result.SetStatus(eReturnStatusFailed); return false; } StringList funct_sl; @@ -1337,13 +1324,11 @@ std::string funct_name_str; if (!interpreter->GenerateTypeScriptFunction(funct_sl, funct_name_str)) { result.AppendError("unable to generate function wrapper.\n"); - result.SetStatus(eReturnStatusFailed); return false; } if (funct_name_str.empty()) { result.AppendError( "script interpreter failed to generate a valid function name.\n"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -1360,7 +1345,6 @@ for (auto &entry : command.entries()) { if (entry.ref().empty()) { result.AppendError("empty typenames not allowed"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -1389,7 +1373,6 @@ m_options.m_category, &error); if (error.Fail()) { result.AppendError(error.AsCString()); - result.SetStatus(eReturnStatusFailed); return false; } } @@ -1400,7 +1383,6 @@ if (error.Fail()) { result.AppendError(error.AsCString()); result.AppendError("added to types, but not given a name"); - result.SetStatus(eReturnStatusFailed); return false; } } @@ -1417,14 +1399,12 @@ if (argc < 1 && !m_options.m_name) { result.AppendErrorWithFormat("%s takes one or more args.\n", m_cmd_name.c_str()); - result.SetStatus(eReturnStatusFailed); return false; } if (!m_options.m_flags.GetShowMembersOneLiner() && m_options.m_format_string.empty()) { result.AppendError("empty summary strings not allowed"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -1435,7 +1415,6 @@ // ${var%S} is an endless recursion, prevent it if (strcmp(format_cstr, "${var%S}") == 0) { result.AppendError("recursive summary not allowed"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -1443,13 +1422,11 @@ new StringSummaryFormat(m_options.m_flags, format_cstr)); if (!string_format) { result.AppendError("summary creation failed"); - result.SetStatus(eReturnStatusFailed); return false; } if (string_format->m_error.Fail()) { result.AppendErrorWithFormat("syntax error: %s", string_format->m_error.AsCString("")); - result.SetStatus(eReturnStatusFailed); return false; } lldb::TypeSummaryImplSP entry(string_format.release()); @@ -1459,7 +1436,6 @@ for (auto &arg_entry : command.entries()) { if (arg_entry.ref().empty()) { result.AppendError("empty typenames not allowed"); - result.SetStatus(eReturnStatusFailed); return false; } ConstString typeCS(arg_entry.ref()); @@ -1470,7 +1446,6 @@ if (error.Fail()) { result.AppendError(error.AsCString()); - result.SetStatus(eReturnStatusFailed); return false; } } @@ -1481,7 +1456,6 @@ if (error.Fail()) { result.AppendError(error.AsCString()); result.AppendError("added to types, but not given a name"); - result.SetStatus(eReturnStatusFailed); return false; } } @@ -1610,7 +1584,6 @@ return Execute_ScriptSummary(command, result); #else result.AppendError("python is disabled"); - result.SetStatus(eReturnStatusFailed); return false; #endif } @@ -1817,7 +1790,6 @@ if (argc < 1) { result.AppendErrorWithFormat("%s takes 1 or more args.\n", m_cmd_name.c_str()); - result.SetStatus(eReturnStatusFailed); return false; } @@ -1921,7 +1893,6 @@ if (argc < 1 && m_options.m_language == lldb::eLanguageTypeUnknown) { result.AppendErrorWithFormat("%s takes arguments and/or a language", m_cmd_name.c_str()); - result.SetStatus(eReturnStatusFailed); return false; } @@ -1934,7 +1905,6 @@ if (!typeCS) { result.AppendError("empty category name not allowed"); - result.SetStatus(eReturnStatusFailed); return false; } DataVisualization::Categories::Enable(typeCS); @@ -1991,7 +1961,6 @@ if (argc < 1) { result.AppendErrorWithFormat("%s takes 1 or more arg.\n", m_cmd_name.c_str()); - result.SetStatus(eReturnStatusFailed); return false; } @@ -2004,7 +1973,6 @@ if (!typeCS) { result.AppendError("empty category name not allowed"); - result.SetStatus(eReturnStatusFailed); return false; } if (!DataVisualization::Categories::Delete(typeCS)) @@ -2015,7 +1983,6 @@ return result.Succeeded(); } else { result.AppendError("cannot delete one or more categories\n"); - result.SetStatus(eReturnStatusFailed); return false; } } @@ -2104,7 +2071,6 @@ if (argc < 1 && m_options.m_language == lldb::eLanguageTypeUnknown) { result.AppendErrorWithFormat("%s takes arguments and/or a language", m_cmd_name.c_str()); - result.SetStatus(eReturnStatusFailed); return false; } @@ -2118,7 +2084,6 @@ if (!typeCS) { result.AppendError("empty category name not allowed"); - result.SetStatus(eReturnStatusFailed); return false; } DataVisualization::Categories::Disable(typeCS); @@ -2176,13 +2141,11 @@ if (!regex->IsValid()) { result.AppendErrorWithFormat( "syntax error in category regular expression '%s'", arg); - result.SetStatus(eReturnStatusFailed); return false; } } else if (argc != 0) { result.AppendErrorWithFormat("%s takes 0 or one arg.\n", m_cmd_name.c_str()); - result.SetStatus(eReturnStatusFailed); return false; } @@ -2300,7 +2263,6 @@ for (auto &entry : command.entries()) { if (entry.ref().empty()) { result.AppendError("empty typenames not allowed"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -2323,7 +2285,6 @@ if (argc < 1) { result.AppendErrorWithFormat("%s takes one or more args.\n", m_cmd_name.c_str()); - result.SetStatus(eReturnStatusFailed); return false; } @@ -2331,7 +2292,6 @@ result.AppendErrorWithFormat("%s needs either a Python class name or -P to " "directly input Python code.\n", m_cmd_name.c_str()); - result.SetStatus(eReturnStatusFailed); return false; } @@ -2364,7 +2324,6 @@ for (auto &arg_entry : command.entries()) { if (arg_entry.ref().empty()) { result.AppendError("empty typenames not allowed"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -2373,7 +2332,6 @@ m_options.m_regex ? eRegexSynth : eRegularSynth, m_options.m_category, &error)) { result.AppendError(error.AsCString()); - result.SetStatus(eReturnStatusFailed); return false; } } @@ -2628,14 +2586,12 @@ if (argc < 1) { result.AppendErrorWithFormat("%s takes one or more args.\n", m_cmd_name.c_str()); - result.SetStatus(eReturnStatusFailed); return false; } if (m_options.m_expr_paths.empty()) { result.AppendErrorWithFormat("%s needs one or more children.\n", m_cmd_name.c_str()); - result.SetStatus(eReturnStatusFailed); return false; } @@ -2665,7 +2621,6 @@ for (auto &arg_entry : command.entries()) { if (arg_entry.ref().empty()) { result.AppendError("empty typenames not allowed"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -2674,7 +2629,6 @@ m_options.m_regex ? eRegexFilter : eRegularFilter, m_options.m_category, &error)) { result.AppendError(error.AsCString()); - result.SetStatus(eReturnStatusFailed); return false; } } @@ -2921,7 +2875,6 @@ Thread *thread = GetDefaultThread(); if (!thread) { result.AppendError("no default thread"); - result.SetStatus(lldb::eReturnStatusFailed); return false; } @@ -2954,7 +2907,6 @@ return true; } else { result.AppendError("failed to evaluate expression"); - result.SetStatus(lldb::eReturnStatusFailed); return false; } } diff --git a/lldb/source/Commands/CommandObjectWatchpoint.cpp b/lldb/source/Commands/CommandObjectWatchpoint.cpp --- a/lldb/source/Commands/CommandObjectWatchpoint.cpp +++ b/lldb/source/Commands/CommandObjectWatchpoint.cpp @@ -42,7 +42,6 @@ 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 @@ if (!CommandObjectMultiwordWatchpoint::VerifyWatchpointIDs( target, command, wp_ids)) { result.AppendError("Invalid watchpoints specification."); - result.SetStatus(eReturnStatusFailed); return false; } @@ -311,7 +309,6 @@ if (num_watchpoints == 0) { result.AppendError("No watchpoints exist to be enabled."); - result.SetStatus(eReturnStatusFailed); return false; } @@ -328,7 +325,6 @@ if (!CommandObjectMultiwordWatchpoint::VerifyWatchpointIDs( target, command, wp_ids)) { result.AppendError("Invalid watchpoints specification."); - result.SetStatus(eReturnStatusFailed); return false; } @@ -388,7 +384,6 @@ if (num_watchpoints == 0) { result.AppendError("No watchpoints exist to be disabled."); - result.SetStatus(eReturnStatusFailed); return false; } @@ -401,7 +396,6 @@ result.SetStatus(eReturnStatusSuccessFinishNoResult); } else { result.AppendError("Disable all watchpoints failed\n"); - result.SetStatus(eReturnStatusFailed); } } else { // Particular watchpoints selected; disable them. @@ -409,7 +403,6 @@ if (!CommandObjectMultiwordWatchpoint::VerifyWatchpointIDs( target, command, wp_ids)) { result.AppendError("Invalid watchpoints specification."); - result.SetStatus(eReturnStatusFailed); return false; } @@ -509,7 +502,6 @@ if (num_watchpoints == 0) { result.AppendError("No watchpoints exist to be deleted."); - result.SetStatus(eReturnStatusFailed); return false; } @@ -534,7 +526,6 @@ if (!CommandObjectMultiwordWatchpoint::VerifyWatchpointIDs(target, command, wp_ids)) { result.AppendError("Invalid watchpoints specification."); - result.SetStatus(eReturnStatusFailed); return false; } @@ -639,7 +630,6 @@ if (num_watchpoints == 0) { result.AppendError("No watchpoints exist to be ignored."); - result.SetStatus(eReturnStatusFailed); return false; } @@ -655,7 +645,6 @@ if (!CommandObjectMultiwordWatchpoint::VerifyWatchpointIDs( target, command, wp_ids)) { result.AppendError("Invalid watchpoints specification."); - result.SetStatus(eReturnStatusFailed); return false; } @@ -768,7 +757,6 @@ if (num_watchpoints == 0) { result.AppendError("No watchpoints exist to be modified."); - result.SetStatus(eReturnStatusFailed); return false; } @@ -782,7 +770,6 @@ if (!CommandObjectMultiwordWatchpoint::VerifyWatchpointIDs( target, command, wp_ids)) { result.AppendError("Invalid watchpoints specification."); - result.SetStatus(eReturnStatusFailed); return false; } @@ -889,10 +876,8 @@ // 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 @@ // 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 @@ 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 @@ addr, (uint64_t)size); if (error.AsCString(nullptr)) result.AppendError(error.AsCString()); - result.SetStatus(eReturnStatusFailed); } return result.Succeeded(); diff --git a/lldb/source/Commands/CommandObjectWatchpointCommand.cpp b/lldb/source/Commands/CommandObjectWatchpointCommand.cpp --- a/lldb/source/Commands/CommandObjectWatchpointCommand.cpp +++ b/lldb/source/Commands/CommandObjectWatchpointCommand.cpp @@ -404,7 +404,6 @@ if (num_watchpoints == 0) { result.AppendError("No watchpoints exist to have commands added"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -419,7 +418,6 @@ if (!CommandObjectMultiwordWatchpoint::VerifyWatchpointIDs(target, command, valid_wp_ids)) { result.AppendError("Invalid watchpoints specification."); - result.SetStatus(eReturnStatusFailed); return false; } @@ -514,14 +512,12 @@ if (num_watchpoints == 0) { result.AppendError("No watchpoints exist to have commands deleted"); - result.SetStatus(eReturnStatusFailed); return false; } if (command.GetArgumentCount() == 0) { result.AppendError( "No watchpoint specified from which to delete the commands"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -529,7 +525,6 @@ if (!CommandObjectMultiwordWatchpoint::VerifyWatchpointIDs(target, command, valid_wp_ids)) { result.AppendError("Invalid watchpoints specification."); - result.SetStatus(eReturnStatusFailed); return false; } @@ -543,7 +538,6 @@ wp->ClearCallback(); } else { result.AppendErrorWithFormat("Invalid watchpoint ID: %u.\n", cur_wp_id); - result.SetStatus(eReturnStatusFailed); return false; } } @@ -586,14 +580,12 @@ if (num_watchpoints == 0) { result.AppendError("No watchpoints exist for which to list commands"); - result.SetStatus(eReturnStatusFailed); return false; } if (command.GetArgumentCount() == 0) { result.AppendError( "No watchpoint specified for which to list the commands"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -601,7 +593,6 @@ if (!CommandObjectMultiwordWatchpoint::VerifyWatchpointIDs(target, command, valid_wp_ids)) { result.AppendError("Invalid watchpoints specification."); - result.SetStatus(eReturnStatusFailed); return false; } @@ -633,7 +624,6 @@ } else { result.AppendErrorWithFormat("Invalid watchpoint ID: %u.\n", cur_wp_id); - result.SetStatus(eReturnStatusFailed); } } }