aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/lldb/source/Interpreter/CommandObject.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2021-08-22 19:00:43 +0000
committerDimitry Andric <dim@FreeBSD.org>2021-11-13 20:39:49 +0000
commitfe6060f10f634930ff71b7c50291ddc610da2475 (patch)
tree1483580c790bd4d27b6500a7542b5ee00534d3cc /contrib/llvm-project/lldb/source/Interpreter/CommandObject.cpp
parentb61bce17f346d79cecfd8f195a64b10f77be43b1 (diff)
parent344a3780b2e33f6ca763666c380202b18aab72a3 (diff)
Diffstat (limited to 'contrib/llvm-project/lldb/source/Interpreter/CommandObject.cpp')
-rw-r--r--contrib/llvm-project/lldb/source/Interpreter/CommandObject.cpp26
1 files changed, 10 insertions, 16 deletions
diff --git a/contrib/llvm-project/lldb/source/Interpreter/CommandObject.cpp b/contrib/llvm-project/lldb/source/Interpreter/CommandObject.cpp
index 71adf8c39f1b..a7dcd5682701 100644
--- a/contrib/llvm-project/lldb/source/Interpreter/CommandObject.cpp
+++ b/contrib/llvm-project/lldb/source/Interpreter/CommandObject.cpp
@@ -12,8 +12,8 @@
#include <sstream>
#include <string>
-#include <ctype.h>
-#include <stdlib.h>
+#include <cctype>
+#include <cstdlib>
#include "lldb/Core/Address.h"
#include "lldb/Interpreter/Options.h"
@@ -42,15 +42,12 @@ CommandObject::CommandObject(CommandInterpreter &interpreter,
llvm::StringRef name, llvm::StringRef help,
llvm::StringRef syntax, uint32_t flags)
: m_interpreter(interpreter), m_cmd_name(std::string(name)),
- m_cmd_help_short(), m_cmd_help_long(), m_cmd_syntax(), m_flags(flags),
- m_arguments(), m_deprecated_command_override_callback(nullptr),
+ m_flags(flags), m_deprecated_command_override_callback(nullptr),
m_command_override_callback(nullptr), m_command_override_baton(nullptr) {
m_cmd_help_short = std::string(help);
m_cmd_syntax = std::string(syntax);
}
-CommandObject::~CommandObject() {}
-
Debugger &CommandObject::GetDebugger() { return m_interpreter.GetDebugger(); }
llvm::StringRef CommandObject::GetHelp() { return m_cmd_help_short; }
@@ -222,7 +219,6 @@ bool CommandObject::CheckRequirements(CommandReturnObject &result) {
// A process that is not running is considered paused.
if (GetFlags().Test(eCommandProcessMustBeLaunched)) {
result.AppendError("Process must exist.");
- result.SetStatus(eReturnStatusFailed);
return false;
}
} else {
@@ -242,7 +238,6 @@ bool CommandObject::CheckRequirements(CommandReturnObject &result) {
case eStateUnloaded:
if (GetFlags().Test(eCommandProcessMustBeLaunched)) {
result.AppendError("Process must be launched.");
- result.SetStatus(eReturnStatusFailed);
return false;
}
break;
@@ -252,7 +247,6 @@ bool CommandObject::CheckRequirements(CommandReturnObject &result) {
if (GetFlags().Test(eCommandProcessMustBePaused)) {
result.AppendError("Process is running. Use 'process interrupt' to "
"pause execution.");
- result.SetStatus(eReturnStatusFailed);
return false;
}
}
@@ -262,7 +256,7 @@ bool CommandObject::CheckRequirements(CommandReturnObject &result) {
if (GetFlags().Test(eCommandProcessMustBeTraced)) {
Target *target = m_exe_ctx.GetTargetPtr();
if (target && !target->GetTrace()) {
- result.SetError("Process is not being traced.");
+ result.AppendError("Process is not being traced.");
return false;
}
}
@@ -322,11 +316,11 @@ bool CommandObject::HelpTextContainsWord(llvm::StringRef search_word,
llvm::StringRef long_help = GetHelpLong();
llvm::StringRef syntax_help = GetSyntax();
- if (search_short_help && short_help.contains_lower(search_word))
+ if (search_short_help && short_help.contains_insensitive(search_word))
found_word = true;
- else if (search_long_help && long_help.contains_lower(search_word))
+ else if (search_long_help && long_help.contains_insensitive(search_word))
found_word = true;
- else if (search_syntax && syntax_help.contains_lower(search_word))
+ else if (search_syntax && syntax_help.contains_insensitive(search_word))
found_word = true;
if (!found_word && search_options && GetOptions() != nullptr) {
@@ -336,7 +330,7 @@ bool CommandObject::HelpTextContainsWord(llvm::StringRef search_word,
GetCommandInterpreter().GetDebugger().GetTerminalWidth());
if (!usage_help.Empty()) {
llvm::StringRef usage_text = usage_help.GetString();
- if (usage_text.contains_lower(search_word))
+ if (usage_text.contains_insensitive(search_word))
found_word = true;
}
}
@@ -354,7 +348,6 @@ bool CommandObject::ParseOptionsAndNotify(Args &args,
Status error(group_options.NotifyOptionParsingFinished(&exe_ctx));
if (error.Fail()) {
result.AppendError(error.AsCString());
- result.SetStatus(eReturnStatusFailed);
return false;
}
return true;
@@ -1129,7 +1122,8 @@ CommandObject::ArgumentTableEntry CommandObject::g_arguments_data[] = {
{ eArgRawInput, "raw-input", CommandCompletions::eNoCompletion, { nullptr, false }, "Free-form text passed to a command without prior interpretation, allowing spaces without requiring quotes. To pass arguments and free form text put two dashes ' -- ' between the last argument and any raw input." },
{ eArgTypeCommand, "command", CommandCompletions::eNoCompletion, { nullptr, false }, "An LLDB Command line command." },
{ eArgTypeColumnNum, "column", CommandCompletions::eNoCompletion, { nullptr, false }, "Column number in a source file." },
- { eArgTypeModuleUUID, "module-uuid", CommandCompletions::eModuleUUIDCompletion, { nullptr, false }, "A module UUID value." }
+ { eArgTypeModuleUUID, "module-uuid", CommandCompletions::eModuleUUIDCompletion, { nullptr, false }, "A module UUID value." },
+ { eArgTypeSaveCoreStyle, "corefile-style", CommandCompletions::eNoCompletion, { nullptr, false }, "The type of corefile that lldb will try to create, dependant on this target's capabilities." }
// clang-format on
};