aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Commands/CommandObjectFrame.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2023-12-09 13:28:42 +0000
committerDimitry Andric <dim@FreeBSD.org>2023-12-09 13:28:42 +0000
commitb1c73532ee8997fe5dfbeb7d223027bdf99758a0 (patch)
tree7d6e51c294ab6719475d660217aa0c0ad0526292 /lldb/source/Commands/CommandObjectFrame.cpp
parent7fa27ce4a07f19b07799a767fc29416f3b625afb (diff)
Diffstat (limited to 'lldb/source/Commands/CommandObjectFrame.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectFrame.cpp78
1 files changed, 34 insertions, 44 deletions
diff --git a/lldb/source/Commands/CommandObjectFrame.cpp b/lldb/source/Commands/CommandObjectFrame.cpp
index 1390fd8748df..e7cb861c2b01 100644
--- a/lldb/source/Commands/CommandObjectFrame.cpp
+++ b/lldb/source/Commands/CommandObjectFrame.cpp
@@ -133,7 +133,7 @@ public:
Options *GetOptions() override { return &m_options; }
protected:
- bool DoExecute(Args &command, CommandReturnObject &result) override {
+ void DoExecute(Args &command, CommandReturnObject &result) override {
Thread *thread = m_exe_ctx.GetThreadPtr();
StackFrameSP frame_sp = thread->GetSelectedFrame(SelectMostRelevantFrame);
@@ -143,7 +143,7 @@ protected:
if (m_options.reg || m_options.offset) {
result.AppendError(
"`frame diagnose --address` is incompatible with other arguments.");
- return false;
+ return;
}
valobj_sp = frame_sp->GuessValueForAddress(*m_options.address);
} else if (m_options.reg) {
@@ -153,7 +153,7 @@ protected:
StopInfoSP stop_info_sp = thread->GetStopInfo();
if (!stop_info_sp) {
result.AppendError("No arguments provided, and no stop info.");
- return false;
+ return;
}
valobj_sp = StopInfo::GetCrashingDereference(stop_info_sp);
@@ -161,7 +161,7 @@ protected:
if (!valobj_sp) {
result.AppendError("No diagnosis available.");
- return false;
+ return;
}
DumpValueObjectOptions::DeclPrintingHelper helper =
@@ -180,8 +180,6 @@ protected:
ValueObjectPrinter printer(valobj_sp.get(), &result.GetOutputStream(),
options);
printer.PrintValueObject();
-
- return true;
}
CommandOptions m_options;
@@ -205,10 +203,9 @@ public:
~CommandObjectFrameInfo() override = default;
protected:
- bool DoExecute(Args &command, CommandReturnObject &result) override {
+ void DoExecute(Args &command, CommandReturnObject &result) override {
m_exe_ctx.GetFrameRef().DumpUsingSettingsFormat(&result.GetOutputStream());
result.SetStatus(eReturnStatusSuccessFinishResult);
- return result.Succeeded();
}
};
@@ -299,7 +296,7 @@ public:
Options *GetOptions() override { return &m_options; }
protected:
- bool DoExecute(Args &command, CommandReturnObject &result) override {
+ void DoExecute(Args &command, CommandReturnObject &result) override {
// No need to check "thread" for validity as eCommandRequiresThread ensures
// it is valid
Thread *thread = m_exe_ctx.GetThreadPtr();
@@ -320,7 +317,7 @@ protected:
// 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.");
- return false;
+ return;
} else
frame_idx = 0;
}
@@ -345,7 +342,7 @@ protected:
// 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.");
- return false;
+ return;
} else
frame_idx = num_frames - 1;
}
@@ -359,14 +356,14 @@ protected:
m_options.GenerateOptionUsage(
result.GetErrorStream(), *this,
GetCommandInterpreter().GetDebugger().GetTerminalWidth());
- return false;
+ return;
}
if (command.GetArgumentCount() == 1) {
if (command[0].ref().getAsInteger(0, frame_idx)) {
result.AppendErrorWithFormat("invalid frame index argument '%s'.",
command[0].c_str());
- return false;
+ return;
}
} else if (command.GetArgumentCount() == 0) {
frame_idx = thread->GetSelectedFrameIndex(SelectMostRelevantFrame);
@@ -385,8 +382,6 @@ protected:
result.AppendErrorWithFormat("Frame index (%u) out of range.\n",
frame_idx);
}
-
- return result.Succeeded();
}
CommandOptions m_options;
@@ -495,6 +490,8 @@ protected:
case eValueTypeRegisterSet:
case eValueTypeConstResult:
case eValueTypeVariableThreadLocal:
+ case eValueTypeVTable:
+ case eValueTypeVTableEntry:
return false;
}
}
@@ -524,7 +521,7 @@ protected:
return std::nullopt;
}
- bool DoExecute(Args &command, CommandReturnObject &result) override {
+ void DoExecute(Args &command, CommandReturnObject &result) override {
// No need to check "frame" for validity as eCommandRequiresFrame ensures
// it is valid
StackFrame *frame = m_exe_ctx.GetFramePtr();
@@ -733,13 +730,11 @@ protected:
m_cmd_name);
// Increment statistics.
- bool res = result.Succeeded();
TargetStats &target_stats = GetSelectedOrDummyTarget().GetStatistics();
- if (res)
+ if (result.Succeeded())
target_stats.GetFrameVariableStats().NotifySuccess();
else
target_stats.GetFrameVariableStats().NotifyFailure();
- return res;
}
OptionGroupOptions m_option_group;
@@ -821,7 +816,7 @@ private:
Options *GetOptions() override { return &m_options; }
protected:
- bool DoExecute(Args &command, CommandReturnObject &result) override;
+ void DoExecute(Args &command, CommandReturnObject &result) override;
public:
CommandObjectFrameRecognizerAdd(CommandInterpreter &interpreter)
@@ -877,33 +872,33 @@ Process 1234 stopped
~CommandObjectFrameRecognizerAdd() override = default;
};
-bool CommandObjectFrameRecognizerAdd::DoExecute(Args &command,
+void CommandObjectFrameRecognizerAdd::DoExecute(Args &command,
CommandReturnObject &result) {
#if LLDB_ENABLE_PYTHON
if (m_options.m_class_name.empty()) {
result.AppendErrorWithFormat(
"%s needs a Python class name (-l argument).\n", m_cmd_name.c_str());
- return false;
+ return;
}
if (m_options.m_module.empty()) {
result.AppendErrorWithFormat("%s needs a module name (-s argument).\n",
m_cmd_name.c_str());
- return false;
+ return;
}
if (m_options.m_symbols.empty()) {
result.AppendErrorWithFormat(
"%s needs at least one symbol name (-n argument).\n",
m_cmd_name.c_str());
- return false;
+ return;
}
if (m_options.m_regex && m_options.m_symbols.size() > 1) {
result.AppendErrorWithFormat(
"%s needs only one symbol regular expression (-n argument).\n",
m_cmd_name.c_str());
- return false;
+ return;
}
ScriptInterpreter *interpreter = GetDebugger().GetScriptInterpreter();
@@ -934,7 +929,6 @@ bool CommandObjectFrameRecognizerAdd::DoExecute(Args &command,
#endif
result.SetStatus(eReturnStatusSuccessFinishNoResult);
- return result.Succeeded();
}
class CommandObjectFrameRecognizerClear : public CommandObjectParsed {
@@ -946,12 +940,11 @@ public:
~CommandObjectFrameRecognizerClear() override = default;
protected:
- bool DoExecute(Args &command, CommandReturnObject &result) override {
+ void DoExecute(Args &command, CommandReturnObject &result) override {
GetSelectedOrDummyTarget()
.GetFrameRecognizerManager()
.RemoveAllRecognizers();
result.SetStatus(eReturnStatusSuccessFinishResult);
- return result.Succeeded();
}
};
@@ -995,33 +988,33 @@ public:
}
protected:
- bool DoExecute(Args &command, CommandReturnObject &result) override {
+ void DoExecute(Args &command, CommandReturnObject &result) override {
if (command.GetArgumentCount() == 0) {
if (!m_interpreter.Confirm(
"About to delete all frame recognizers, do you want to do that?",
true)) {
result.AppendMessage("Operation cancelled...");
- return false;
+ return;
}
GetSelectedOrDummyTarget()
.GetFrameRecognizerManager()
.RemoveAllRecognizers();
result.SetStatus(eReturnStatusSuccessFinishResult);
- return result.Succeeded();
+ return;
}
if (command.GetArgumentCount() != 1) {
result.AppendErrorWithFormat("'%s' takes zero or one arguments.\n",
m_cmd_name.c_str());
- return false;
+ return;
}
uint32_t recognizer_id;
if (!llvm::to_integer(command.GetArgumentAtIndex(0), recognizer_id)) {
result.AppendErrorWithFormat("'%s' is not a valid recognizer id.\n",
command.GetArgumentAtIndex(0));
- return false;
+ return;
}
if (!GetSelectedOrDummyTarget()
@@ -1029,10 +1022,9 @@ protected:
.RemoveRecognizerWithID(recognizer_id)) {
result.AppendErrorWithFormat("'%s' is not a valid recognizer id.\n",
command.GetArgumentAtIndex(0));
- return false;
+ return;
}
result.SetStatus(eReturnStatusSuccessFinishResult);
- return result.Succeeded();
}
};
@@ -1046,7 +1038,7 @@ public:
~CommandObjectFrameRecognizerList() override = default;
protected:
- bool DoExecute(Args &command, CommandReturnObject &result) override {
+ void DoExecute(Args &command, CommandReturnObject &result) override {
bool any_printed = false;
GetSelectedOrDummyTarget().GetFrameRecognizerManager().ForEach(
[&result, &any_printed](
@@ -1078,7 +1070,6 @@ protected:
result.GetOutputStream().PutCString("no matching results found.\n");
result.SetStatus(eReturnStatusSuccessFinishNoResult);
}
- return result.Succeeded();
}
};
@@ -1107,35 +1098,35 @@ public:
~CommandObjectFrameRecognizerInfo() override = default;
protected:
- bool DoExecute(Args &command, CommandReturnObject &result) override {
+ void DoExecute(Args &command, CommandReturnObject &result) override {
const char *frame_index_str = command.GetArgumentAtIndex(0);
uint32_t frame_index;
if (!llvm::to_integer(frame_index_str, frame_index)) {
result.AppendErrorWithFormat("'%s' is not a valid frame index.",
frame_index_str);
- return false;
+ return;
}
Process *process = m_exe_ctx.GetProcessPtr();
if (process == nullptr) {
result.AppendError("no process");
- return false;
+ return;
}
Thread *thread = m_exe_ctx.GetThreadPtr();
if (thread == nullptr) {
result.AppendError("no thread");
- return false;
+ return;
}
if (command.GetArgumentCount() != 1) {
result.AppendErrorWithFormat(
"'%s' takes exactly one frame index argument.\n", m_cmd_name.c_str());
- return false;
+ return;
}
StackFrameSP frame_sp = thread->GetStackFrameAtIndex(frame_index);
if (!frame_sp) {
result.AppendErrorWithFormat("no frame with index %u", frame_index);
- return false;
+ return;
}
auto recognizer = GetSelectedOrDummyTarget()
@@ -1152,7 +1143,6 @@ protected:
}
output_stream.EOL();
result.SetStatus(eReturnStatusSuccessFinishResult);
- return result.Succeeded();
}
};