summaryrefslogtreecommitdiff
path: root/source/Interpreter
diff options
context:
space:
mode:
Diffstat (limited to 'source/Interpreter')
-rw-r--r--source/Interpreter/Args.cpp18
-rw-r--r--source/Interpreter/CommandInterpreter.cpp22
-rw-r--r--source/Interpreter/CommandObject.cpp2
-rw-r--r--source/Interpreter/CommandReturnObject.cpp6
-rw-r--r--source/Interpreter/OptionGroupArchitecture.cpp9
-rw-r--r--source/Interpreter/OptionGroupBoolean.cpp8
-rw-r--r--source/Interpreter/OptionGroupFile.cpp17
-rw-r--r--source/Interpreter/OptionGroupFormat.cpp8
-rw-r--r--source/Interpreter/OptionGroupOutputFile.cpp9
-rw-r--r--source/Interpreter/OptionGroupPlatform.cpp11
-rw-r--r--source/Interpreter/OptionGroupString.cpp8
-rw-r--r--source/Interpreter/OptionGroupUInt64.cpp8
-rw-r--r--source/Interpreter/OptionGroupUUID.cpp8
-rw-r--r--source/Interpreter/OptionGroupValueObjectDisplay.cpp4
-rw-r--r--source/Interpreter/OptionGroupVariable.cpp25
-rw-r--r--source/Interpreter/OptionGroupWatchpoint.cpp9
-rw-r--r--source/Interpreter/OptionValue.cpp16
-rw-r--r--source/Interpreter/OptionValueArch.cpp6
-rw-r--r--source/Interpreter/OptionValueArray.cpp15
-rw-r--r--source/Interpreter/OptionValueBoolean.cpp6
-rw-r--r--source/Interpreter/OptionValueChar.cpp6
-rw-r--r--source/Interpreter/OptionValueDictionary.cpp24
-rw-r--r--source/Interpreter/OptionValueEnumeration.cpp6
-rw-r--r--source/Interpreter/OptionValueFileSpec.cpp6
-rw-r--r--source/Interpreter/OptionValueFileSpecLIst.cpp6
-rw-r--r--source/Interpreter/OptionValueFormat.cpp6
-rw-r--r--source/Interpreter/OptionValueFormatEntity.cpp8
-rw-r--r--source/Interpreter/OptionValueLanguage.cpp6
-rw-r--r--source/Interpreter/OptionValuePathMappings.cpp6
-rw-r--r--source/Interpreter/OptionValueProperties.cpp29
-rw-r--r--source/Interpreter/OptionValueRegex.cpp6
-rw-r--r--source/Interpreter/OptionValueSInt64.cpp6
-rw-r--r--source/Interpreter/OptionValueString.cpp18
-rw-r--r--source/Interpreter/OptionValueUInt64.cpp8
-rw-r--r--source/Interpreter/OptionValueUUID.cpp6
-rw-r--r--source/Interpreter/Options.cpp18
-rw-r--r--source/Interpreter/ScriptInterpreter.cpp6
37 files changed, 199 insertions, 187 deletions
diff --git a/source/Interpreter/Args.cpp b/source/Interpreter/Args.cpp
index 5bfe13f55e49..a23ba3094b22 100644
--- a/source/Interpreter/Args.cpp
+++ b/source/Interpreter/Args.cpp
@@ -420,10 +420,10 @@ void Args::SetArguments(const char **argv) {
SetArguments(ArgvToArgc(argv), argv);
}
-Error Args::ParseOptions(Options &options, ExecutionContext *execution_context,
- PlatformSP platform_sp, bool require_validation) {
+Status Args::ParseOptions(Options &options, ExecutionContext *execution_context,
+ PlatformSP platform_sp, bool require_validation) {
StreamString sstr;
- Error error;
+ Status error;
Option *long_options = options.GetLongOptions();
if (long_options == nullptr) {
error.SetErrorStringWithFormat("invalid long options");
@@ -547,7 +547,7 @@ void Args::Clear() {
lldb::addr_t Args::StringToAddress(const ExecutionContext *exe_ctx,
llvm::StringRef s, lldb::addr_t fail_value,
- Error *error_ptr) {
+ Status *error_ptr) {
bool error_set = false;
if (s.empty()) {
if (error_ptr)
@@ -630,7 +630,7 @@ lldb::addr_t Args::StringToAddress(const ExecutionContext *exe_ctx,
if (regex_match.GetMatchAtIndex(s, 3, str)) {
if (!llvm::StringRef(str).getAsInteger(0, offset)) {
- Error error;
+ Status error;
addr = StringToAddress(exe_ctx, name.c_str(),
LLDB_INVALID_ADDRESS, &error);
if (addr != LLDB_INVALID_ADDRESS) {
@@ -774,7 +774,7 @@ const char *Args::GetShellSafeArgument(const FileSpec &shell,
int64_t Args::StringToOptionEnum(llvm::StringRef s,
OptionEnumValueElement *enum_values,
- int32_t fail_value, Error &error) {
+ int32_t fail_value, Status &error) {
error.Clear();
if (!enum_values) {
error.SetErrorString("invalid enumeration argument");
@@ -819,10 +819,10 @@ Args::StringToScriptLanguage(llvm::StringRef s, lldb::ScriptLanguage fail_value,
return fail_value;
}
-Error Args::StringToFormat(const char *s, lldb::Format &format,
- size_t *byte_size_ptr) {
+Status Args::StringToFormat(const char *s, lldb::Format &format,
+ size_t *byte_size_ptr) {
format = eFormatInvalid;
- Error error;
+ Status error;
if (s && s[0]) {
if (byte_size_ptr) {
diff --git a/source/Interpreter/CommandInterpreter.cpp b/source/Interpreter/CommandInterpreter.cpp
index 8703bc97f06e..a1d8eded09f5 100644
--- a/source/Interpreter/CommandInterpreter.cpp
+++ b/source/Interpreter/CommandInterpreter.cpp
@@ -169,7 +169,8 @@ bool CommandInterpreter::GetSpaceReplPrompts() const {
}
void CommandInterpreter::Initialize() {
- Timer scoped_timer(LLVM_PRETTY_FUNCTION, LLVM_PRETTY_FUNCTION);
+ static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
+ Timer scoped_timer(func_cat, LLVM_PRETTY_FUNCTION);
CommandReturnObject result;
@@ -391,7 +392,8 @@ const char *CommandInterpreter::ProcessEmbeddedScriptCommands(const char *arg) {
}
void CommandInterpreter::LoadCommandDictionary() {
- Timer scoped_timer(LLVM_PRETTY_FUNCTION, LLVM_PRETTY_FUNCTION);
+ static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
+ Timer scoped_timer(func_cat, LLVM_PRETTY_FUNCTION);
lldb::ScriptLanguage script_language = m_debugger.GetScriptLanguage();
@@ -1373,7 +1375,7 @@ CommandObject *CommandInterpreter::BuildAliasResult(
return alias_cmd_obj;
}
-Error CommandInterpreter::PreprocessCommand(std::string &command) {
+Status CommandInterpreter::PreprocessCommand(std::string &command) {
// The command preprocessor needs to do things to the command
// line before any parsing of arguments or anything else is done.
// The only current stuff that gets preprocessed is anything enclosed
@@ -1381,7 +1383,7 @@ Error CommandInterpreter::PreprocessCommand(std::string &command) {
// the result of the expression must be a scalar that can be substituted
// into the command. An example would be:
// (lldb) memory read `$rsp + 20`
- Error error; // Error for any expressions that might not evaluate
+ Status error; // Status for any expressions that might not evaluate
size_t start_backtick;
size_t pos = 0;
while ((start_backtick = command.find('`', pos)) != std::string::npos) {
@@ -1533,8 +1535,8 @@ bool CommandInterpreter::HandleCommand(const char *command_line,
if (log)
log->Printf("Processing command: %s", command_line);
- Timer scoped_timer(LLVM_PRETTY_FUNCTION, "Handling command: %s.",
- command_line);
+ static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
+ Timer scoped_timer(func_cat, "Handling command: %s.", command_line);
if (!no_context_switching)
UpdateExecutionContext(override_context);
@@ -1601,7 +1603,7 @@ bool CommandInterpreter::HandleCommand(const char *command_line,
return true;
}
- Error error(PreprocessCommand(command_string));
+ Status error(PreprocessCommand(command_string));
if (error.Fail()) {
result.AppendError(error.AsCString());
@@ -2355,8 +2357,8 @@ void CommandInterpreter::HandleCommandsFromFile(
StreamFileSP input_file_sp(new StreamFile());
std::string cmd_file_path = cmd_file.GetPath();
- Error error = input_file_sp->GetFile().Open(cmd_file_path.c_str(),
- File::eOpenOptionRead);
+ Status error = input_file_sp->GetFile().Open(cmd_file_path.c_str(),
+ File::eOpenOptionRead);
if (error.Success()) {
Debugger &debugger = GetDebugger();
@@ -2653,7 +2655,7 @@ size_t CommandInterpreter::GetProcessOutput() {
char stdio_buffer[1024];
size_t len;
size_t total_bytes = 0;
- Error error;
+ Status error;
TargetSP target_sp(m_debugger.GetTargetList().GetSelectedTarget());
if (target_sp) {
ProcessSP process_sp(target_sp->GetProcessSP());
diff --git a/source/Interpreter/CommandObject.cpp b/source/Interpreter/CommandObject.cpp
index 2a6c77d7deba..f9a5b10bb4b8 100644
--- a/source/Interpreter/CommandObject.cpp
+++ b/source/Interpreter/CommandObject.cpp
@@ -99,7 +99,7 @@ bool CommandObject::ParseOptions(Args &args, CommandReturnObject &result) {
// See if the subclass has options?
Options *options = GetOptions();
if (options != nullptr) {
- Error error;
+ Status error;
auto exe_ctx = GetCommandInterpreter().GetExecutionContext();
options->NotifyOptionParsingStarting(&exe_ctx);
diff --git a/source/Interpreter/CommandReturnObject.cpp b/source/Interpreter/CommandReturnObject.cpp
index 00fcff510cff..75c02588066c 100644
--- a/source/Interpreter/CommandReturnObject.cpp
+++ b/source/Interpreter/CommandReturnObject.cpp
@@ -13,7 +13,7 @@
// C++ Includes
// Other libraries and framework includes
// Project includes
-#include "lldb/Utility/Error.h"
+#include "lldb/Utility/Status.h"
#include "lldb/Utility/StreamString.h"
using namespace lldb;
@@ -111,7 +111,7 @@ void CommandReturnObject::AppendError(llvm::StringRef in_string) {
GetErrorStream() << "error: " << in_string << "\n";
}
-void CommandReturnObject::SetError(const Error &error,
+void CommandReturnObject::SetError(const Status &error,
const char *fallback_error_cstr) {
const char *error_cstr = error.AsCString();
if (error_cstr == nullptr)
@@ -127,7 +127,7 @@ void CommandReturnObject::SetError(llvm::StringRef error_str) {
SetStatus(eReturnStatusFailed);
}
-// Similar to AppendError, but do not prepend 'Error: ' to message, and
+// Similar to AppendError, but do not prepend 'Status: ' to message, and
// don't append "\n" to the end of it.
void CommandReturnObject::AppendRawError(llvm::StringRef in_string) {
diff --git a/source/Interpreter/OptionGroupArchitecture.cpp b/source/Interpreter/OptionGroupArchitecture.cpp
index 4a6bf48a24d4..d5354fe0739c 100644
--- a/source/Interpreter/OptionGroupArchitecture.cpp
+++ b/source/Interpreter/OptionGroupArchitecture.cpp
@@ -41,10 +41,11 @@ bool OptionGroupArchitecture::GetArchitecture(Platform *platform,
return arch.IsValid();
}
-Error OptionGroupArchitecture::SetOptionValue(
- uint32_t option_idx, llvm::StringRef option_arg,
- ExecutionContext *execution_context) {
- Error error;
+Status
+OptionGroupArchitecture::SetOptionValue(uint32_t option_idx,
+ llvm::StringRef option_arg,
+ ExecutionContext *execution_context) {
+ Status error;
const int short_option = g_option_table[option_idx].short_option;
switch (short_option) {
diff --git a/source/Interpreter/OptionGroupBoolean.cpp b/source/Interpreter/OptionGroupBoolean.cpp
index 4956b83c8f7a..5fd4ce7aecfa 100644
--- a/source/Interpreter/OptionGroupBoolean.cpp
+++ b/source/Interpreter/OptionGroupBoolean.cpp
@@ -40,10 +40,10 @@ OptionGroupBoolean::OptionGroupBoolean(uint32_t usage_mask, bool required,
OptionGroupBoolean::~OptionGroupBoolean() {}
-Error OptionGroupBoolean::SetOptionValue(uint32_t option_idx,
- llvm::StringRef option_value,
- ExecutionContext *execution_context) {
- Error error;
+Status OptionGroupBoolean::SetOptionValue(uint32_t option_idx,
+ llvm::StringRef option_value,
+ ExecutionContext *execution_context) {
+ Status error;
if (m_option_definition.option_has_arg == OptionParser::eNoArgument) {
// Not argument, toggle the default value and mark the option as having been
// set
diff --git a/source/Interpreter/OptionGroupFile.cpp b/source/Interpreter/OptionGroupFile.cpp
index 995a6a46e48e..d45f00a66616 100644
--- a/source/Interpreter/OptionGroupFile.cpp
+++ b/source/Interpreter/OptionGroupFile.cpp
@@ -38,10 +38,10 @@ OptionGroupFile::OptionGroupFile(uint32_t usage_mask, bool required,
OptionGroupFile::~OptionGroupFile() {}
-Error OptionGroupFile::SetOptionValue(uint32_t option_idx,
- llvm::StringRef option_arg,
- ExecutionContext *execution_context) {
- Error error(m_file.SetValueFromString(option_arg));
+Status OptionGroupFile::SetOptionValue(uint32_t option_idx,
+ llvm::StringRef option_arg,
+ ExecutionContext *execution_context) {
+ Status error(m_file.SetValueFromString(option_arg));
return error;
}
@@ -69,10 +69,11 @@ OptionGroupFileList::OptionGroupFileList(
OptionGroupFileList::~OptionGroupFileList() {}
-Error OptionGroupFileList::SetOptionValue(uint32_t option_idx,
- llvm::StringRef option_value,
- ExecutionContext *execution_context) {
- Error error(m_file_list.SetValueFromString(option_value));
+Status
+OptionGroupFileList::SetOptionValue(uint32_t option_idx,
+ llvm::StringRef option_value,
+ ExecutionContext *execution_context) {
+ Status error(m_file_list.SetValueFromString(option_value));
return error;
}
diff --git a/source/Interpreter/OptionGroupFormat.cpp b/source/Interpreter/OptionGroupFormat.cpp
index df5e2b3cd346..7c4239f92642 100644
--- a/source/Interpreter/OptionGroupFormat.cpp
+++ b/source/Interpreter/OptionGroupFormat.cpp
@@ -58,10 +58,10 @@ llvm::ArrayRef<OptionDefinition> OptionGroupFormat::GetDefinitions() {
return result.take_front(2);
}
-Error OptionGroupFormat::SetOptionValue(uint32_t option_idx,
- llvm::StringRef option_arg,
- ExecutionContext *execution_context) {
- Error error;
+Status OptionGroupFormat::SetOptionValue(uint32_t option_idx,
+ llvm::StringRef option_arg,
+ ExecutionContext *execution_context) {
+ Status error;
const int short_option = g_option_table[option_idx].short_option;
switch (short_option) {
diff --git a/source/Interpreter/OptionGroupOutputFile.cpp b/source/Interpreter/OptionGroupOutputFile.cpp
index 7b0ee61dd7eb..fd406494ea97 100644
--- a/source/Interpreter/OptionGroupOutputFile.cpp
+++ b/source/Interpreter/OptionGroupOutputFile.cpp
@@ -38,10 +38,11 @@ llvm::ArrayRef<OptionDefinition> OptionGroupOutputFile::GetDefinitions() {
return llvm::makeArrayRef(g_option_table);
}
-Error OptionGroupOutputFile::SetOptionValue(
- uint32_t option_idx, llvm::StringRef option_arg,
- ExecutionContext *execution_context) {
- Error error;
+Status
+OptionGroupOutputFile::SetOptionValue(uint32_t option_idx,
+ llvm::StringRef option_arg,
+ ExecutionContext *execution_context) {
+ Status error;
const int short_option = g_option_table[option_idx].short_option;
switch (short_option) {
diff --git a/source/Interpreter/OptionGroupPlatform.cpp b/source/Interpreter/OptionGroupPlatform.cpp
index f6edca82a142..5747c6a8815d 100644
--- a/source/Interpreter/OptionGroupPlatform.cpp
+++ b/source/Interpreter/OptionGroupPlatform.cpp
@@ -22,7 +22,7 @@ using namespace lldb_private;
PlatformSP OptionGroupPlatform::CreatePlatformWithOptions(
CommandInterpreter &interpreter, const ArchSpec &arch, bool make_selected,
- Error &error, ArchSpec &platform_arch) const {
+ Status &error, ArchSpec &platform_arch) const {
PlatformSP platform_sp;
if (!m_platform_name.empty()) {
@@ -92,10 +92,11 @@ llvm::ArrayRef<OptionDefinition> OptionGroupPlatform::GetDefinitions() {
return result.drop_front();
}
-Error OptionGroupPlatform::SetOptionValue(uint32_t option_idx,
- llvm::StringRef option_arg,
- ExecutionContext *execution_context) {
- Error error;
+Status
+OptionGroupPlatform::SetOptionValue(uint32_t option_idx,
+ llvm::StringRef option_arg,
+ ExecutionContext *execution_context) {
+ Status error;
if (!m_include_platform_option)
++option_idx;
diff --git a/source/Interpreter/OptionGroupString.cpp b/source/Interpreter/OptionGroupString.cpp
index 5705264dba20..1a161945a17f 100644
--- a/source/Interpreter/OptionGroupString.cpp
+++ b/source/Interpreter/OptionGroupString.cpp
@@ -39,10 +39,10 @@ OptionGroupString::OptionGroupString(uint32_t usage_mask, bool required,
OptionGroupString::~OptionGroupString() {}
-Error OptionGroupString::SetOptionValue(uint32_t option_idx,
- llvm::StringRef option_arg,
- ExecutionContext *execution_context) {
- Error error(m_value.SetValueFromString(option_arg));
+Status OptionGroupString::SetOptionValue(uint32_t option_idx,
+ llvm::StringRef option_arg,
+ ExecutionContext *execution_context) {
+ Status error(m_value.SetValueFromString(option_arg));
return error;
}
diff --git a/source/Interpreter/OptionGroupUInt64.cpp b/source/Interpreter/OptionGroupUInt64.cpp
index a6a0d49232c1..ae4828c3e926 100644
--- a/source/Interpreter/OptionGroupUInt64.cpp
+++ b/source/Interpreter/OptionGroupUInt64.cpp
@@ -39,10 +39,10 @@ OptionGroupUInt64::OptionGroupUInt64(uint32_t usage_mask, bool required,
OptionGroupUInt64::~OptionGroupUInt64() {}
-Error OptionGroupUInt64::SetOptionValue(uint32_t option_idx,
- llvm::StringRef option_arg,
- ExecutionContext *execution_context) {
- Error error(m_value.SetValueFromString(option_arg));
+Status OptionGroupUInt64::SetOptionValue(uint32_t option_idx,
+ llvm::StringRef option_arg,
+ ExecutionContext *execution_context) {
+ Status error(m_value.SetValueFromString(option_arg));
return error;
}
diff --git a/source/Interpreter/OptionGroupUUID.cpp b/source/Interpreter/OptionGroupUUID.cpp
index 32a9962b5b97..bf02d1b660cf 100644
--- a/source/Interpreter/OptionGroupUUID.cpp
+++ b/source/Interpreter/OptionGroupUUID.cpp
@@ -31,10 +31,10 @@ llvm::ArrayRef<OptionDefinition> OptionGroupUUID::GetDefinitions() {
return llvm::makeArrayRef(g_option_table);
}
-Error OptionGroupUUID::SetOptionValue(uint32_t option_idx,
- llvm::StringRef option_arg,
- ExecutionContext *execution_context) {
- Error error;
+Status OptionGroupUUID::SetOptionValue(uint32_t option_idx,
+ llvm::StringRef option_arg,
+ ExecutionContext *execution_context) {
+ Status error;
const int short_option = g_option_table[option_idx].short_option;
switch (short_option) {
diff --git a/source/Interpreter/OptionGroupValueObjectDisplay.cpp b/source/Interpreter/OptionGroupValueObjectDisplay.cpp
index 89acf3f0d3f9..ce27d948c93c 100644
--- a/source/Interpreter/OptionGroupValueObjectDisplay.cpp
+++ b/source/Interpreter/OptionGroupValueObjectDisplay.cpp
@@ -75,10 +75,10 @@ OptionGroupValueObjectDisplay::GetDefinitions() {
return llvm::makeArrayRef(g_option_table);
}
-Error OptionGroupValueObjectDisplay::SetOptionValue(
+Status OptionGroupValueObjectDisplay::SetOptionValue(
uint32_t option_idx, llvm::StringRef option_arg,
ExecutionContext *execution_context) {
- Error error;
+ Status error;
const int short_option = g_option_table[option_idx].short_option;
bool success = false;
diff --git a/source/Interpreter/OptionGroupVariable.cpp b/source/Interpreter/OptionGroupVariable.cpp
index 760563071d7d..0793d3731446 100644
--- a/source/Interpreter/OptionGroupVariable.cpp
+++ b/source/Interpreter/OptionGroupVariable.cpp
@@ -17,7 +17,7 @@
#include "lldb/Host/OptionParser.h"
#include "lldb/Interpreter/CommandInterpreter.h"
#include "lldb/Target/Target.h"
-#include "lldb/Utility/Error.h"
+#include "lldb/Utility/Status.h"
using namespace lldb;
using namespace lldb_private;
@@ -52,20 +52,20 @@ static OptionDefinition g_variable_options[] = {
"Specify a summary string to use to format the variable output."},
};
-static Error ValidateNamedSummary(const char *str, void *) {
+static Status ValidateNamedSummary(const char *str, void *) {
if (!str || !str[0])
- return Error("must specify a valid named summary");
+ return Status("must specify a valid named summary");
TypeSummaryImplSP summary_sp;
if (DataVisualization::NamedSummaryFormats::GetSummaryFormat(
ConstString(str), summary_sp) == false)
- return Error("must specify a valid named summary");
- return Error();
+ return Status("must specify a valid named summary");
+ return Status();
}
-static Error ValidateSummaryString(const char *str, void *) {
+static Status ValidateSummaryString(const char *str, void *) {
if (!str || !str[0])
- return Error("must specify a non-empty summary string");
- return Error();
+ return Status("must specify a non-empty summary string");
+ return Status();
}
OptionGroupVariable::OptionGroupVariable(bool show_frame_options)
@@ -74,10 +74,11 @@ OptionGroupVariable::OptionGroupVariable(bool show_frame_options)
OptionGroupVariable::~OptionGroupVariable() {}
-Error OptionGroupVariable::SetOptionValue(uint32_t option_idx,
- llvm::StringRef option_arg,
- ExecutionContext *execution_context) {
- Error error;
+Status
+OptionGroupVariable::SetOptionValue(uint32_t option_idx,
+ llvm::StringRef option_arg,
+ ExecutionContext *execution_context) {
+ Status error;
if (!include_frame_options)
option_idx += 3;
const int short_option = g_variable_options[option_idx].short_option;
diff --git a/source/Interpreter/OptionGroupWatchpoint.cpp b/source/Interpreter/OptionGroupWatchpoint.cpp
index 1e6fab929ca7..dd4b8c86c910 100644
--- a/source/Interpreter/OptionGroupWatchpoint.cpp
+++ b/source/Interpreter/OptionGroupWatchpoint.cpp
@@ -56,10 +56,11 @@ OptionGroupWatchpoint::OptionGroupWatchpoint() : OptionGroup() {}
OptionGroupWatchpoint::~OptionGroupWatchpoint() {}
-Error OptionGroupWatchpoint::SetOptionValue(
- uint32_t option_idx, llvm::StringRef option_arg,
- ExecutionContext *execution_context) {
- Error error;
+Status
+OptionGroupWatchpoint::SetOptionValue(uint32_t option_idx,
+ llvm::StringRef option_arg,
+ ExecutionContext *execution_context) {
+ Status error;
const int short_option = g_option_table[option_idx].short_option;
switch (short_option) {
case 'w': {
diff --git a/source/Interpreter/OptionValue.cpp b/source/Interpreter/OptionValue.cpp
index 5f42f7f7056a..afcace2567ce 100644
--- a/source/Interpreter/OptionValue.cpp
+++ b/source/Interpreter/OptionValue.cpp
@@ -42,10 +42,10 @@ uint64_t OptionValue::GetUInt64Value(uint64_t fail_value, bool *success_ptr) {
return fail_value;
}
-Error OptionValue::SetSubValue(const ExecutionContext *exe_ctx,
- VarSetOperationType op, llvm::StringRef name,
- llvm::StringRef value) {
- Error error;
+Status OptionValue::SetSubValue(const ExecutionContext *exe_ctx,
+ VarSetOperationType op, llvm::StringRef name,
+ llvm::StringRef value) {
+ Status error;
error.SetErrorStringWithFormat("SetSubValue is not supported");
return error;
}
@@ -507,7 +507,7 @@ const char *OptionValue::GetBuiltinTypeAsCString(Type t) {
}
lldb::OptionValueSP OptionValue::CreateValueFromCStringForTypeMask(
- const char *value_cstr, uint32_t type_mask, Error &error) {
+ const char *value_cstr, uint32_t type_mask, Status &error) {
// If only 1 bit is set in the type mask for a dictionary or array
// then we know how to decode a value from a cstring
lldb::OptionValueSP value_sp;
@@ -582,9 +582,9 @@ size_t OptionValue::AutoComplete(CommandInterpreter &interpreter,
return matches.GetSize();
}
-Error OptionValue::SetValueFromString(llvm::StringRef value,
- VarSetOperationType op) {
- Error error;
+Status OptionValue::SetValueFromString(llvm::StringRef value,
+ VarSetOperationType op) {
+ Status error;
switch (op) {
case eVarSetOperationReplace:
error.SetErrorStringWithFormat(
diff --git a/source/Interpreter/OptionValueArch.cpp b/source/Interpreter/OptionValueArch.cpp
index 3e41300a4182..1d920a114723 100644
--- a/source/Interpreter/OptionValueArch.cpp
+++ b/source/Interpreter/OptionValueArch.cpp
@@ -38,9 +38,9 @@ void OptionValueArch::DumpValue(const ExecutionContext *exe_ctx, Stream &strm,
}
}
-Error OptionValueArch::SetValueFromString(llvm::StringRef value,
- VarSetOperationType op) {
- Error error;
+Status OptionValueArch::SetValueFromString(llvm::StringRef value,
+ VarSetOperationType op) {
+ Status error;
switch (op) {
case eVarSetOperationClear:
Clear();
diff --git a/source/Interpreter/OptionValueArray.cpp b/source/Interpreter/OptionValueArray.cpp
index 0d1825cec28b..8b62070352a6 100644
--- a/source/Interpreter/OptionValueArray.cpp
+++ b/source/Interpreter/OptionValueArray.cpp
@@ -70,18 +70,19 @@ void OptionValueArray::DumpValue(const ExecutionContext *exe_ctx, Stream &strm,
}
}
-Error OptionValueArray::SetValueFromString(llvm::StringRef value,
- VarSetOperationType op) {
+Status OptionValueArray::SetValueFromString(llvm::StringRef value,
+ VarSetOperationType op) {
Args args(value.str());
- Error error = SetArgs(args, op);
+ Status error = SetArgs(args, op);
if (error.Success())
NotifyValueChanged();
return error;
}
lldb::OptionValueSP
-OptionValueArray::GetSubValue(const ExecutionContext *exe_ctx, llvm::StringRef name,
- bool will_modify, Error &error) const {
+OptionValueArray::GetSubValue(const ExecutionContext *exe_ctx,
+ llvm::StringRef name, bool will_modify,
+ Status &error) const {
if (name.empty() || name.front() != '[') {
error.SetErrorStringWithFormat(
"invalid value path '%s', %s values only support '[<index>]' subvalues "
@@ -149,8 +150,8 @@ size_t OptionValueArray::GetArgs(Args &args) const {
return args.GetArgumentCount();
}
-Error OptionValueArray::SetArgs(const Args &args, VarSetOperationType op) {
- Error error;
+Status OptionValueArray::SetArgs(const Args &args, VarSetOperationType op) {
+ Status error;
const size_t argc = args.GetArgumentCount();
switch (op) {
case eVarSetOperationInvalid:
diff --git a/source/Interpreter/OptionValueBoolean.cpp b/source/Interpreter/OptionValueBoolean.cpp
index 92e4d891c1a8..2cb84cd6abb3 100644
--- a/source/Interpreter/OptionValueBoolean.cpp
+++ b/source/Interpreter/OptionValueBoolean.cpp
@@ -35,9 +35,9 @@ void OptionValueBoolean::DumpValue(const ExecutionContext *exe_ctx,
}
}
-Error OptionValueBoolean::SetValueFromString(llvm::StringRef value_str,
- VarSetOperationType op) {
- Error error;
+Status OptionValueBoolean::SetValueFromString(llvm::StringRef value_str,
+ VarSetOperationType op) {
+ Status error;
switch (op) {
case eVarSetOperationClear:
Clear();
diff --git a/source/Interpreter/OptionValueChar.cpp b/source/Interpreter/OptionValueChar.cpp
index 1f6acf61c68c..27684a27264d 100644
--- a/source/Interpreter/OptionValueChar.cpp
+++ b/source/Interpreter/OptionValueChar.cpp
@@ -36,9 +36,9 @@ void OptionValueChar::DumpValue(const ExecutionContext *exe_ctx, Stream &strm,
}
}
-Error OptionValueChar::SetValueFromString(llvm::StringRef value,
- VarSetOperationType op) {
- Error error;
+Status OptionValueChar::SetValueFromString(llvm::StringRef value,
+ VarSetOperationType op) {
+ Status error;
switch (op) {
case eVarSetOperationClear:
Clear();
diff --git a/source/Interpreter/OptionValueDictionary.cpp b/source/Interpreter/OptionValueDictionary.cpp
index dfba435603bb..b245a09c1951 100644
--- a/source/Interpreter/OptionValueDictionary.cpp
+++ b/source/Interpreter/OptionValueDictionary.cpp
@@ -90,8 +90,9 @@ size_t OptionValueDictionary::GetArgs(Args &args) const {
return args.GetArgumentCount();
}
-Error OptionValueDictionary::SetArgs(const Args &args, VarSetOperationType op) {
- Error error;
+Status OptionValueDictionary::SetArgs(const Args &args,
+ VarSetOperationType op) {
+ Status error;
const size_t argc = args.GetArgumentCount();
switch (op) {
case eVarSetOperationClear:
@@ -197,10 +198,10 @@ Error OptionValueDictionary::SetArgs(const Args &args, VarSetOperationType op) {
return error;
}
-Error OptionValueDictionary::SetValueFromString(llvm::StringRef value,
- VarSetOperationType op) {
+Status OptionValueDictionary::SetValueFromString(llvm::StringRef value,
+ VarSetOperationType op) {
Args args(value.str());
- Error error = SetArgs(args, op);
+ Status error = SetArgs(args, op);
if (error.Success())
NotifyValueChanged();
return error;
@@ -208,8 +209,8 @@ Error OptionValueDictionary::SetValueFromString(llvm::StringRef value,
lldb::OptionValueSP
OptionValueDictionary::GetSubValue(const ExecutionContext *exe_ctx,
- llvm::StringRef name, bool will_modify,
- Error &error) const {
+ llvm::StringRef name, bool will_modify,
+ Status &error) const {
lldb::OptionValueSP value_sp;
if (name.empty())
return nullptr;
@@ -258,10 +259,11 @@ OptionValueDictionary::GetSubValue(const ExecutionContext *exe_ctx,
return value_sp->GetSubValue(exe_ctx, sub_name, will_modify, error);
}
-Error OptionValueDictionary::SetSubValue(const ExecutionContext *exe_ctx,
- VarSetOperationType op,
- llvm::StringRef name, llvm::StringRef value) {
- Error error;
+Status OptionValueDictionary::SetSubValue(const ExecutionContext *exe_ctx,
+ VarSetOperationType op,
+ llvm::StringRef name,
+ llvm::StringRef value) {
+ Status error;
const bool will_modify = true;
lldb::OptionValueSP value_sp(GetSubValue(exe_ctx, name, will_modify, error));
if (value_sp)
diff --git a/source/Interpreter/OptionValueEnumeration.cpp b/source/Interpreter/OptionValueEnumeration.cpp
index 2bff0bdcec37..9510f4a671d1 100644
--- a/source/Interpreter/OptionValueEnumeration.cpp
+++ b/source/Interpreter/OptionValueEnumeration.cpp
@@ -45,9 +45,9 @@ void OptionValueEnumeration::DumpValue(const ExecutionContext *exe_ctx,
}
}
-Error OptionValueEnumeration::SetValueFromString(llvm::StringRef value,
- VarSetOperationType op) {
- Error error;
+Status OptionValueEnumeration::SetValueFromString(llvm::StringRef value,
+ VarSetOperationType op) {
+ Status error;
switch (op) {
case eVarSetOperationClear:
Clear();
diff --git a/source/Interpreter/OptionValueFileSpec.cpp b/source/Interpreter/OptionValueFileSpec.cpp
index 0df581af5d67..b235d4ac6863 100644
--- a/source/Interpreter/OptionValueFileSpec.cpp
+++ b/source/Interpreter/OptionValueFileSpec.cpp
@@ -54,9 +54,9 @@ void OptionValueFileSpec::DumpValue(const ExecutionContext *exe_ctx,
}
}
-Error OptionValueFileSpec::SetValueFromString(llvm::StringRef value,
- VarSetOperationType op) {
- Error error;
+Status OptionValueFileSpec::SetValueFromString(llvm::StringRef value,
+ VarSetOperationType op) {
+ Status error;
switch (op) {
case eVarSetOperationClear:
Clear();
diff --git a/source/Interpreter/OptionValueFileSpecLIst.cpp b/source/Interpreter/OptionValueFileSpecLIst.cpp
index 9cddf32206e4..7773bdc5ea9c 100644
--- a/source/Interpreter/OptionValueFileSpecLIst.cpp
+++ b/source/Interpreter/OptionValueFileSpecLIst.cpp
@@ -38,9 +38,9 @@ void OptionValueFileSpecList::DumpValue(const ExecutionContext *exe_ctx,
}
}
-Error OptionValueFileSpecList::SetValueFromString(llvm::StringRef value,
- VarSetOperationType op) {
- Error error;
+Status OptionValueFileSpecList::SetValueFromString(llvm::StringRef value,
+ VarSetOperationType op) {
+ Status error;
Args args(value.str());
const size_t argc = args.GetArgumentCount();
diff --git a/source/Interpreter/OptionValueFormat.cpp b/source/Interpreter/OptionValueFormat.cpp
index 7d58f63a381e..24dd8fd5f71c 100644
--- a/source/Interpreter/OptionValueFormat.cpp
+++ b/source/Interpreter/OptionValueFormat.cpp
@@ -31,9 +31,9 @@ void OptionValueFormat::DumpValue(const ExecutionContext *exe_ctx, Stream &strm,
}
}
-Error OptionValueFormat::SetValueFromString(llvm::StringRef value,
- VarSetOperationType op) {
- Error error;
+Status OptionValueFormat::SetValueFromString(llvm::StringRef value,
+ VarSetOperationType op) {
+ Status error;
switch (op) {
case eVarSetOperationClear:
Clear();
diff --git a/source/Interpreter/OptionValueFormatEntity.cpp b/source/Interpreter/OptionValueFormatEntity.cpp
index 5259398dcd33..e9431d4562ec 100644
--- a/source/Interpreter/OptionValueFormatEntity.cpp
+++ b/source/Interpreter/OptionValueFormatEntity.cpp
@@ -25,7 +25,7 @@ OptionValueFormatEntity::OptionValueFormatEntity(const char *default_format)
m_default_entry() {
if (default_format && default_format[0]) {
llvm::StringRef default_format_str(default_format);
- Error error = FormatEntity::Parse(default_format_str, m_default_entry);
+ Status error = FormatEntity::Parse(default_format_str, m_default_entry);
if (error.Success()) {
m_default_format = default_format;
m_current_format = default_format;
@@ -52,9 +52,9 @@ void OptionValueFormatEntity::DumpValue(const ExecutionContext *exe_ctx,
}
}
-Error OptionValueFormatEntity::SetValueFromString(llvm::StringRef value_str,
- VarSetOperationType op) {
- Error error;
+Status OptionValueFormatEntity::SetValueFromString(llvm::StringRef value_str,
+ VarSetOperationType op) {
+ Status error;
switch (op) {
case eVarSetOperationClear:
Clear();
diff --git a/source/Interpreter/OptionValueLanguage.cpp b/source/Interpreter/OptionValueLanguage.cpp
index 2ea152c436c7..3290e88c1815 100644
--- a/source/Interpreter/OptionValueLanguage.cpp
+++ b/source/Interpreter/OptionValueLanguage.cpp
@@ -32,9 +32,9 @@ void OptionValueLanguage::DumpValue(const ExecutionContext *exe_ctx,
}
}
-Error OptionValueLanguage::SetValueFromString(llvm::StringRef value,
- VarSetOperationType op) {
- Error error;
+Status OptionValueLanguage::SetValueFromString(llvm::StringRef value,
+ VarSetOperationType op) {
+ Status error;
switch (op) {
case eVarSetOperationClear:
Clear();
diff --git a/source/Interpreter/OptionValuePathMappings.cpp b/source/Interpreter/OptionValuePathMappings.cpp
index 54797422cba3..5f805720bd3f 100644
--- a/source/Interpreter/OptionValuePathMappings.cpp
+++ b/source/Interpreter/OptionValuePathMappings.cpp
@@ -40,9 +40,9 @@ void OptionValuePathMappings::DumpValue(const ExecutionContext *exe_ctx,
}
}
-Error OptionValuePathMappings::SetValueFromString(llvm::StringRef value,
- VarSetOperationType op) {
- Error error;
+Status OptionValuePathMappings::SetValueFromString(llvm::StringRef value,
+ VarSetOperationType op) {
+ Status error;
Args args(value.str());
const size_t argc = args.GetArgumentCount();
diff --git a/source/Interpreter/OptionValueProperties.cpp b/source/Interpreter/OptionValueProperties.cpp
index 732769f6e6df..ae7669605592 100644
--- a/source/Interpreter/OptionValueProperties.cpp
+++ b/source/Interpreter/OptionValueProperties.cpp
@@ -116,8 +116,8 @@ OptionValueProperties::GetValueForKey(const ExecutionContext *exe_ctx,
lldb::OptionValueSP
OptionValueProperties::GetSubValue(const ExecutionContext *exe_ctx,
- llvm::StringRef name, bool will_modify,
- Error &error) const {
+ llvm::StringRef name, bool will_modify,
+ Status &error) const {
lldb::OptionValueSP value_sp;
if (name.empty())
return OptionValueSP();
@@ -201,10 +201,11 @@ OptionValueProperties::GetSubValue(const ExecutionContext *exe_ctx,
return value_sp;
}
-Error OptionValueProperties::SetSubValue(const ExecutionContext *exe_ctx,
- VarSetOperationType op,
- llvm::StringRef name, llvm::StringRef value) {
- Error error;
+Status OptionValueProperties::SetSubValue(const ExecutionContext *exe_ctx,
+ VarSetOperationType op,
+ llvm::StringRef name,
+ llvm::StringRef value) {
+ Status error;
const bool will_modify = true;
lldb::OptionValueSP value_sp(GetSubValue(exe_ctx, name, will_modify, error));
if (value_sp)
@@ -523,9 +524,9 @@ bool OptionValueProperties::Clear() {
return true;
}
-Error OptionValueProperties::SetValueFromString(llvm::StringRef value,
- VarSetOperationType op) {
- Error error;
+Status OptionValueProperties::SetValueFromString(llvm::StringRef value,
+ VarSetOperationType op) {
+ Status error;
// Args args(value_cstr);
// const size_t argc = args.GetArgumentCount();
@@ -564,11 +565,11 @@ void OptionValueProperties::DumpValue(const ExecutionContext *exe_ctx,
}
}
-Error OptionValueProperties::DumpPropertyValue(const ExecutionContext *exe_ctx,
- Stream &strm,
- llvm::StringRef property_path,
- uint32_t dump_mask) {
- Error error;
+Status OptionValueProperties::DumpPropertyValue(const ExecutionContext *exe_ctx,
+ Stream &strm,
+ llvm::StringRef property_path,
+ uint32_t dump_mask) {
+ Status error;
const bool will_modify = false;
lldb::OptionValueSP value_sp(
GetSubValue(exe_ctx, property_path, will_modify, error));
diff --git a/source/Interpreter/OptionValueRegex.cpp b/source/Interpreter/OptionValueRegex.cpp
index 6823300c515a..aee8f97db163 100644
--- a/source/Interpreter/OptionValueRegex.cpp
+++ b/source/Interpreter/OptionValueRegex.cpp
@@ -32,9 +32,9 @@ void OptionValueRegex::DumpValue(const ExecutionContext *exe_ctx, Stream &strm,
}
}
-Error OptionValueRegex::SetValueFromString(llvm::StringRef value,
- VarSetOperationType op) {
- Error error;
+Status OptionValueRegex::SetValueFromString(llvm::StringRef value,
+ VarSetOperationType op) {
+ Status error;
switch (op) {
case eVarSetOperationInvalid:
case eVarSetOperationInsertBefore:
diff --git a/source/Interpreter/OptionValueSInt64.cpp b/source/Interpreter/OptionValueSInt64.cpp
index 3bdbfb9e2fae..9dbcd58dc3e9 100644
--- a/source/Interpreter/OptionValueSInt64.cpp
+++ b/source/Interpreter/OptionValueSInt64.cpp
@@ -34,9 +34,9 @@ void OptionValueSInt64::DumpValue(const ExecutionContext *exe_ctx, Stream &strm,
}
}
-Error OptionValueSInt64::SetValueFromString(llvm::StringRef value_ref,
- VarSetOperationType op) {
- Error error;
+Status OptionValueSInt64::SetValueFromString(llvm::StringRef value_ref,
+ VarSetOperationType op) {
+ Status error;
switch (op) {
case eVarSetOperationClear:
Clear();
diff --git a/source/Interpreter/OptionValueString.cpp b/source/Interpreter/OptionValueString.cpp
index 149ccbc7b518..1d7332dd41a6 100644
--- a/source/Interpreter/OptionValueString.cpp
+++ b/source/Interpreter/OptionValueString.cpp
@@ -47,9 +47,9 @@ void OptionValueString::DumpValue(const ExecutionContext *exe_ctx, Stream &strm,
}
}
-Error OptionValueString::SetValueFromString(llvm::StringRef value,
- VarSetOperationType op) {
- Error error;
+Status OptionValueString::SetValueFromString(llvm::StringRef value,
+ VarSetOperationType op) {
+ Status error;
std::string value_str = value.str();
value = value.trim();
@@ -127,27 +127,27 @@ lldb::OptionValueSP OptionValueString::DeepCopy() const {
return OptionValueSP(new OptionValueString(*this));
}
-Error OptionValueString::SetCurrentValue(llvm::StringRef value) {
+Status OptionValueString::SetCurrentValue(llvm::StringRef value) {
if (m_validator) {
- Error error(m_validator(value.str().c_str(), m_validator_baton));
+ Status error(m_validator(value.str().c_str(), m_validator_baton));
if (error.Fail())
return error;
}
m_current_value.assign(value);
- return Error();
+ return Status();
}
-Error OptionValueString::AppendToCurrentValue(const char *value) {
+Status OptionValueString::AppendToCurrentValue(const char *value) {
if (value && value[0]) {
if (m_validator) {
std::string new_value(m_current_value);
new_value.append(value);
- Error error(m_validator(value, m_validator_baton));
+ Status error(m_validator(value, m_validator_baton));
if (error.Fail())
return error;
m_current_value.assign(new_value);
} else
m_current_value.append(value);
}
- return Error();
+ return Status();
}
diff --git a/source/Interpreter/OptionValueUInt64.cpp b/source/Interpreter/OptionValueUInt64.cpp
index 826c9e5ba887..c8db1bd532c6 100644
--- a/source/Interpreter/OptionValueUInt64.cpp
+++ b/source/Interpreter/OptionValueUInt64.cpp
@@ -21,7 +21,7 @@ using namespace lldb;
using namespace lldb_private;
lldb::OptionValueSP OptionValueUInt64::Create(llvm::StringRef value_str,
- Error &error) {
+ Status &error) {
lldb::OptionValueSP value_sp(new OptionValueUInt64());
error = value_sp->SetValueFromString(value_str);
if (error.Fail())
@@ -40,9 +40,9 @@ void OptionValueUInt64::DumpValue(const ExecutionContext *exe_ctx, Stream &strm,
}
}
-Error OptionValueUInt64::SetValueFromString(llvm::StringRef value_ref,
- VarSetOperationType op) {
- Error error;
+Status OptionValueUInt64::SetValueFromString(llvm::StringRef value_ref,
+ VarSetOperationType op) {
+ Status error;
switch (op) {
case eVarSetOperationClear:
Clear();
diff --git a/source/Interpreter/OptionValueUUID.cpp b/source/Interpreter/OptionValueUUID.cpp
index 7378195a2f94..bec04cba8c37 100644
--- a/source/Interpreter/OptionValueUUID.cpp
+++ b/source/Interpreter/OptionValueUUID.cpp
@@ -32,9 +32,9 @@ void OptionValueUUID::DumpValue(const ExecutionContext *exe_ctx, Stream &strm,
}
}
-Error OptionValueUUID::SetValueFromString(llvm::StringRef value,
- VarSetOperationType op) {
- Error error;
+Status OptionValueUUID::SetValueFromString(llvm::StringRef value,
+ VarSetOperationType op) {
+ Status error;
switch (op) {
case eVarSetOperationClear:
Clear();
diff --git a/source/Interpreter/Options.cpp b/source/Interpreter/Options.cpp
index b8b9bdf54a0d..f8b1a8d6beba 100644
--- a/source/Interpreter/Options.cpp
+++ b/source/Interpreter/Options.cpp
@@ -42,8 +42,8 @@ void Options::NotifyOptionParsingStarting(ExecutionContext *execution_context) {
OptionParsingStarting(execution_context);
}
-Error Options::NotifyOptionParsingFinished(
- ExecutionContext *execution_context) {
+Status
+Options::NotifyOptionParsingFinished(ExecutionContext *execution_context) {
return OptionParsingFinished(execution_context);
}
@@ -905,13 +905,13 @@ void OptionGroupOptions::Finalize() {
m_did_finalize = true;
}
-Error OptionGroupOptions::SetOptionValue(uint32_t option_idx,
- llvm::StringRef option_value,
- ExecutionContext *execution_context) {
+Status OptionGroupOptions::SetOptionValue(uint32_t option_idx,
+ llvm::StringRef option_value,
+ ExecutionContext *execution_context) {
// After calling OptionGroupOptions::Append(...), you must finalize the groups
// by calling OptionGroupOptions::Finlize()
assert(m_did_finalize);
- Error error;
+ Status error;
if (option_idx < m_option_infos.size()) {
error = m_option_infos[option_idx].option_group->SetOptionValue(
m_option_infos[option_idx].option_index, option_value,
@@ -935,10 +935,10 @@ void OptionGroupOptions::OptionParsingStarting(
}
}
}
-Error OptionGroupOptions::OptionParsingFinished(
- ExecutionContext *execution_context) {
+Status
+OptionGroupOptions::OptionParsingFinished(ExecutionContext *execution_context) {
std::set<OptionGroup *> group_set;
- Error error;
+ Status error;
OptionInfos::iterator pos, end = m_option_infos.end();
for (pos = m_option_infos.begin(); pos != end; ++pos) {
OptionGroup *group = pos->option_group;
diff --git a/source/Interpreter/ScriptInterpreter.cpp b/source/Interpreter/ScriptInterpreter.cpp
index 0f7e1f8d74f4..57f7eea6e4c1 100644
--- a/source/Interpreter/ScriptInterpreter.cpp
+++ b/source/Interpreter/ScriptInterpreter.cpp
@@ -15,7 +15,7 @@
#include "lldb/Host/PseudoTerminal.h"
#include "lldb/Interpreter/CommandReturnObject.h"
-#include "lldb/Utility/Error.h"
+#include "lldb/Utility/Status.h"
#include "lldb/Utility/Stream.h"
#include "lldb/Utility/StringList.h"
@@ -75,10 +75,10 @@ ScriptInterpreter::StringToLanguage(const llvm::StringRef &language) {
return eScriptLanguageUnknown;
}
-Error ScriptInterpreter::SetBreakpointCommandCallback(
+Status ScriptInterpreter::SetBreakpointCommandCallback(
std::vector<BreakpointOptions *> &bp_options_vec,
const char *callback_text) {
- Error return_error;
+ Status return_error;
for (BreakpointOptions *bp_options : bp_options_vec) {
return_error = SetBreakpointCommandCallback(bp_options, callback_text);
if (return_error.Success())