27 changes: 11 additions & 16 deletions lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5179,7 +5179,7 @@ class CommandObjectProcessGDBRemoteSpeedTest : public CommandObjectParsed {

Options *GetOptions() override { return &m_option_group; }

bool DoExecute(Args &command, CommandReturnObject &result) override {
void DoExecute(Args &command, CommandReturnObject &result) override {
const size_t argc = command.GetArgumentCount();
if (argc == 0) {
ProcessGDBRemote *process =
Expand All @@ -5201,14 +5201,13 @@ class CommandObjectProcessGDBRemoteSpeedTest : public CommandObjectParsed {
num_packets, max_send, max_recv, k_recv_amount, json,
output_stream_sp ? *output_stream_sp : result.GetOutputStream());
result.SetStatus(eReturnStatusSuccessFinishResult);
return true;
return;
}
} else {
result.AppendErrorWithFormat("'%s' takes no arguments",
m_cmd_name.c_str());
}
result.SetStatus(eReturnStatusFailed);
return false;
}

protected:
Expand All @@ -5228,16 +5227,15 @@ class CommandObjectProcessGDBRemotePacketHistory : public CommandObjectParsed {

~CommandObjectProcessGDBRemotePacketHistory() override = default;

bool DoExecute(Args &command, CommandReturnObject &result) override {
void DoExecute(Args &command, CommandReturnObject &result) override {
ProcessGDBRemote *process =
(ProcessGDBRemote *)m_interpreter.GetExecutionContext().GetProcessPtr();
if (process) {
process->DumpPluginHistory(result.GetOutputStream());
result.SetStatus(eReturnStatusSuccessFinishResult);
return true;
return;
}
result.SetStatus(eReturnStatusFailed);
return false;
}
};

Expand All @@ -5255,14 +5253,14 @@ class CommandObjectProcessGDBRemotePacketXferSize : public CommandObjectParsed {

~CommandObjectProcessGDBRemotePacketXferSize() override = default;

bool DoExecute(Args &command, CommandReturnObject &result) override {
void DoExecute(Args &command, CommandReturnObject &result) override {
const size_t argc = command.GetArgumentCount();
if (argc == 0) {
result.AppendErrorWithFormat("'%s' takes an argument to specify the max "
"amount to be transferred when "
"reading/writing",
m_cmd_name.c_str());
return false;
return;
}

ProcessGDBRemote *process =
Expand All @@ -5274,11 +5272,10 @@ class CommandObjectProcessGDBRemotePacketXferSize : public CommandObjectParsed {
if (errno == 0 && user_specified_max != 0) {
process->SetUserSpecifiedMaxMemoryTransferSize(user_specified_max);
result.SetStatus(eReturnStatusSuccessFinishResult);
return true;
return;
}
}
result.SetStatus(eReturnStatusFailed);
return false;
}
};

Expand All @@ -5299,13 +5296,13 @@ class CommandObjectProcessGDBRemotePacketSend : public CommandObjectParsed {

~CommandObjectProcessGDBRemotePacketSend() override = default;

bool DoExecute(Args &command, CommandReturnObject &result) override {
void DoExecute(Args &command, CommandReturnObject &result) override {
const size_t argc = command.GetArgumentCount();
if (argc == 0) {
result.AppendErrorWithFormat(
"'%s' takes a one or more packet content arguments",
m_cmd_name.c_str());
return false;
return;
}

ProcessGDBRemote *process =
Expand All @@ -5331,7 +5328,6 @@ class CommandObjectProcessGDBRemotePacketSend : public CommandObjectParsed {
output_strm.Printf("response: %s\n", response.GetStringRef().data());
}
}
return true;
}
};

Expand All @@ -5348,12 +5344,12 @@ class CommandObjectProcessGDBRemotePacketMonitor : public CommandObjectRaw {

~CommandObjectProcessGDBRemotePacketMonitor() override = default;

bool DoExecute(llvm::StringRef command,
void DoExecute(llvm::StringRef command,
CommandReturnObject &result) override {
if (command.empty()) {
result.AppendErrorWithFormat("'%s' takes a command string argument",
m_cmd_name.c_str());
return false;
return;
}

ProcessGDBRemote *process =
Expand All @@ -5377,7 +5373,6 @@ class CommandObjectProcessGDBRemotePacketMonitor : public CommandObjectRaw {
else
output_strm.Printf("response: %s\n", response.GetStringRef().data());
}
return true;
}
};

Expand Down
8 changes: 3 additions & 5 deletions lldb/source/Plugins/Process/minidump/ProcessMinidump.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -795,12 +795,12 @@ class CommandObjectProcessMinidumpDump : public CommandObjectParsed {

Options *GetOptions() override { return &m_option_group; }

bool DoExecute(Args &command, CommandReturnObject &result) override {
void DoExecute(Args &command, CommandReturnObject &result) override {
const size_t argc = command.GetArgumentCount();
if (argc > 0) {
result.AppendErrorWithFormat("'%s' take no arguments, only options",
m_cmd_name.c_str());
return false;
return;
}
SetDefaultOptionsIfNoneAreSet();

Expand Down Expand Up @@ -904,9 +904,7 @@ class CommandObjectProcessMinidumpDump : public CommandObjectParsed {
DumpTextStream(StreamType::FacebookThreadName,
"Facebook Thread Name");
if (DumpFacebookLogcat())
DumpTextStream(StreamType::FacebookLogcat,
"Facebook Logcat");
return true;
DumpTextStream(StreamType::FacebookLogcat, "Facebook Logcat");
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,7 @@ class EnableCommand : public CommandObjectParsed {
result.AppendWarning(stream.GetString());
}

bool DoExecute(Args &command, CommandReturnObject &result) override {
void DoExecute(Args &command, CommandReturnObject &result) override {
// First off, set the global sticky state of enable/disable based on this
// command execution.
s_is_explicitly_enabled = m_enable;
Expand All @@ -790,14 +790,14 @@ class EnableCommand : public CommandObjectParsed {
if (!process_sp) {
// No active process, so there is nothing more to do right now.
result.SetStatus(eReturnStatusSuccessFinishNoResult);
return true;
return;
}

// If the process is no longer alive, we can't do this now. We'll catch it
// the next time the process is started up.
if (!process_sp->IsAlive()) {
result.SetStatus(eReturnStatusSuccessFinishNoResult);
return true;
return;
}

// Get the plugin for the process.
Expand Down Expand Up @@ -838,7 +838,6 @@ class EnableCommand : public CommandObjectParsed {
// one this command is setup to do.
plugin.SetEnabled(m_enable);
}
return result.Succeeded();
}

Options *GetOptions() override {
Expand All @@ -861,7 +860,7 @@ class StatusCommand : public CommandObjectParsed {
"plugin structured-data darwin-log status") {}

protected:
bool DoExecute(Args &command, CommandReturnObject &result) override {
void DoExecute(Args &command, CommandReturnObject &result) override {
auto &stream = result.GetOutputStream();

// Figure out if we've got a process. If so, we can tell if DarwinLog is
Expand Down Expand Up @@ -891,7 +890,7 @@ class StatusCommand : public CommandObjectParsed {
if (!options_sp) {
// Nothing more to do.
result.SetStatus(eReturnStatusSuccessFinishResult);
return true;
return;
}

// Print filter rules
Expand Down Expand Up @@ -924,7 +923,6 @@ class StatusCommand : public CommandObjectParsed {
options_sp->GetFallthroughAccepts() ? "accept" : "reject");

result.SetStatus(eReturnStatusSuccessFinishResult);
return true;
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class CommandObjectProcessTraceStartIntelPT : public CommandObjectParsed {
Options *GetOptions() override { return &m_options; }

protected:
bool DoExecute(Args &command, CommandReturnObject &result) override;
void DoExecute(Args &command, CommandReturnObject &result) override;

TraceIntelPT &m_trace;
CommandOptions m_options;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ CommandObjectThreadTraceExportCTF::CommandOptions::GetDefinitions() {
return llvm::ArrayRef(g_thread_trace_export_ctf_options);
}

bool CommandObjectThreadTraceExportCTF::DoExecute(Args &command,
void CommandObjectThreadTraceExportCTF::DoExecute(Args &command,
CommandReturnObject &result) {
const TraceSP &trace_sp = m_exe_ctx.GetTargetSP()->GetTrace();
Process *process = m_exe_ctx.GetProcessPtr();
Expand All @@ -78,7 +78,6 @@ bool CommandObjectThreadTraceExportCTF::DoExecute(Args &command,
result.AppendErrorWithFormatv(
"Thread index {0} is out of range (valid values are 1 - {1}).\n", tid,
num_threads);
return false;
} else {
auto do_work = [&]() -> Error {
Expected<TraceCursorSP> cursor = trace_sp->CreateNewCursor(*thread);
Expand All @@ -91,9 +90,6 @@ bool CommandObjectThreadTraceExportCTF::DoExecute(Args &command,

if (llvm::Error err = do_work()) {
result.AppendErrorWithFormat("%s\n", toString(std::move(err)).c_str());
return false;
} else {
return true;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class CommandObjectThreadTraceExportCTF : public CommandObjectParsed {
Options *GetOptions() override { return &m_options; }

protected:
bool DoExecute(Args &command, CommandReturnObject &result) override;
void DoExecute(Args &command, CommandReturnObject &result) override;

CommandOptions m_options;
};
Expand Down
3 changes: 1 addition & 2 deletions lldb/unittests/Interpreter/TestCommandPaths.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,9 @@ class CommandObjectLeaf : public CommandObjectParsed {
}

protected:
bool DoExecute(Args &command, CommandReturnObject &result) override {
void DoExecute(Args &command, CommandReturnObject &result) override {
result.SetStatus(eReturnStatusSuccessFinishResult);
result.AppendMessage("I did nothing");
return true;
}
};

Expand Down