summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/ScriptInterpreter/Python
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python')
-rw-r--r--lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp50
-rw-r--r--lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h38
2 files changed, 44 insertions, 44 deletions
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
index cfab9b33e66..985a7978c6a 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
@@ -723,7 +723,7 @@ bool ScriptInterpreterPython::ExecuteOneLine(
// the result object
Pipe pipe;
- Error pipe_result = pipe.CreateNew(false);
+ Status pipe_result = pipe.CreateNew(false);
if (pipe_result.Success()) {
#if defined(_WIN32)
lldb::file_t read_file = pipe.GetReadNativeHandle();
@@ -1133,9 +1133,9 @@ bool ScriptInterpreterPython::ExecuteOneLineWithReturn(
return ret_success;
}
-Error ScriptInterpreterPython::ExecuteMultipleLines(
+Status ScriptInterpreterPython::ExecuteMultipleLines(
const char *in_string, const ExecuteScriptOptions &options) {
- Error error;
+ Status error;
Locker locker(this, ScriptInterpreterPython::Locker::AcquireLock |
ScriptInterpreterPython::Locker::InitSession |
@@ -1220,10 +1220,10 @@ void ScriptInterpreterPython::SetBreakpointCommandCallbackFunction(
bp_options, oneliner.c_str());
}
-Error ScriptInterpreterPython::SetBreakpointCommandCallback(
+Status ScriptInterpreterPython::SetBreakpointCommandCallback(
BreakpointOptions *bp_options,
std::unique_ptr<BreakpointOptions::CommandData> &cmd_data_up) {
- Error error;
+ Status error;
error = GenerateBreakpointCommandCallbackData(cmd_data_up->user_source,
cmd_data_up->script_source);
if (error.Fail()) {
@@ -1237,7 +1237,7 @@ Error ScriptInterpreterPython::SetBreakpointCommandCallback(
}
// Set a Python one-liner as the callback for the breakpoint.
-Error ScriptInterpreterPython::SetBreakpointCommandCallback(
+Status ScriptInterpreterPython::SetBreakpointCommandCallback(
BreakpointOptions *bp_options, const char *command_body_text) {
auto data_ap = llvm::make_unique<CommandDataPython>();
@@ -1248,8 +1248,8 @@ Error ScriptInterpreterPython::SetBreakpointCommandCallback(
// the callback will actually invoke.
data_ap->user_source.SplitIntoLines(command_body_text);
- Error error = GenerateBreakpointCommandCallbackData(data_ap->user_source,
- data_ap->script_source);
+ Status error = GenerateBreakpointCommandCallbackData(data_ap->user_source,
+ data_ap->script_source);
if (error.Success()) {
auto baton_sp =
std::make_shared<BreakpointOptions::CommandBaton>(std::move(data_ap));
@@ -1285,20 +1285,20 @@ void ScriptInterpreterPython::SetWatchpointCommandCallback(
return;
}
-Error ScriptInterpreterPython::ExportFunctionDefinitionToInterpreter(
+Status ScriptInterpreterPython::ExportFunctionDefinitionToInterpreter(
StringList &function_def) {
// Convert StringList to one long, newline delimited, const char *.
std::string function_def_string(function_def.CopyList());
- Error error = ExecuteMultipleLines(
+ Status error = ExecuteMultipleLines(
function_def_string.c_str(),
ScriptInterpreter::ExecuteScriptOptions().SetEnableIO(false));
return error;
}
-Error ScriptInterpreterPython::GenerateFunction(const char *signature,
- const StringList &input) {
- Error error;
+Status ScriptInterpreterPython::GenerateFunction(const char *signature,
+ const StringList &input) {
+ Status error;
int num_lines = input.GetSize();
if (num_lines == 0) {
error.SetErrorString("No input data.");
@@ -1830,7 +1830,7 @@ lldb::StateType ScriptInterpreterPython::ScriptedThreadPlanGetRunState(
StructuredData::ObjectSP
ScriptInterpreterPython::LoadPluginModule(const FileSpec &file_spec,
- lldb_private::Error &error) {
+ lldb_private::Status &error) {
if (!file_spec.Exists()) {
error.SetErrorString("no such file");
return StructuredData::ObjectSP();
@@ -1847,7 +1847,7 @@ ScriptInterpreterPython::LoadPluginModule(const FileSpec &file_spec,
StructuredData::DictionarySP ScriptInterpreterPython::GetDynamicSettings(
StructuredData::ObjectSP plugin_module_sp, Target *target,
- const char *setting_name, lldb_private::Error &error) {
+ const char *setting_name, lldb_private::Status &error) {
if (!plugin_module_sp || !target || !setting_name || !setting_name[0] ||
!g_swig_plugin_get)
return StructuredData::DictionarySP();
@@ -1943,12 +1943,12 @@ bool ScriptInterpreterPython::GenerateTypeSynthClass(const char *oneliner,
return GenerateTypeSynthClass(input, output, name_token);
}
-Error ScriptInterpreterPython::GenerateBreakpointCommandCallbackData(
+Status ScriptInterpreterPython::GenerateBreakpointCommandCallbackData(
StringList &user_input, std::string &output) {
static uint32_t num_created_functions = 0;
user_input.RemoveBlankLines();
StreamString sstr;
- Error error;
+ Status error;
if (user_input.GetSize() == 0) {
error.SetErrorString("No input data.");
return error;
@@ -2395,7 +2395,7 @@ ConstString ScriptInterpreterPython::GetSyntheticTypeName(
bool ScriptInterpreterPython::RunScriptFormatKeyword(const char *impl_function,
Process *process,
std::string &output,
- Error &error) {
+ Status &error) {
bool ret_val;
if (!process) {
error.SetErrorString("no process");
@@ -2424,7 +2424,7 @@ bool ScriptInterpreterPython::RunScriptFormatKeyword(const char *impl_function,
bool ScriptInterpreterPython::RunScriptFormatKeyword(const char *impl_function,
Thread *thread,
std::string &output,
- Error &error) {
+ Status &error) {
bool ret_val;
if (!thread) {
error.SetErrorString("no thread");
@@ -2453,7 +2453,7 @@ bool ScriptInterpreterPython::RunScriptFormatKeyword(const char *impl_function,
bool ScriptInterpreterPython::RunScriptFormatKeyword(const char *impl_function,
Target *target,
std::string &output,
- Error &error) {
+ Status &error) {
bool ret_val;
if (!target) {
error.SetErrorString("no thread");
@@ -2482,7 +2482,7 @@ bool ScriptInterpreterPython::RunScriptFormatKeyword(const char *impl_function,
bool ScriptInterpreterPython::RunScriptFormatKeyword(const char *impl_function,
StackFrame *frame,
std::string &output,
- Error &error) {
+ Status &error) {
bool ret_val;
if (!frame) {
error.SetErrorString("no frame");
@@ -2511,7 +2511,7 @@ bool ScriptInterpreterPython::RunScriptFormatKeyword(const char *impl_function,
bool ScriptInterpreterPython::RunScriptFormatKeyword(const char *impl_function,
ValueObject *value,
std::string &output,
- Error &error) {
+ Status &error) {
bool ret_val;
if (!value) {
error.SetErrorString("no value");
@@ -2551,7 +2551,7 @@ uint64_t replace_all(std::string &str, const std::string &oldStr,
bool ScriptInterpreterPython::LoadScriptingModule(
const char *pathname, bool can_reload, bool init_session,
- lldb_private::Error &error, StructuredData::ObjectSP *module_sp) {
+ lldb_private::Status &error, StructuredData::ObjectSP *module_sp) {
if (!pathname || !pathname[0]) {
error.SetErrorString("invalid pathname");
return false;
@@ -2742,7 +2742,7 @@ ScriptInterpreterPython::SynchronicityHandler::~SynchronicityHandler() {
bool ScriptInterpreterPython::RunScriptBasedCommand(
const char *impl_function, const char *args,
ScriptedCommandSynchronicity synchronicity,
- lldb_private::CommandReturnObject &cmd_retobj, Error &error,
+ lldb_private::CommandReturnObject &cmd_retobj, Status &error,
const lldb_private::ExecutionContext &exe_ctx) {
if (!impl_function) {
error.SetErrorString("no function to execute");
@@ -2790,7 +2790,7 @@ bool ScriptInterpreterPython::RunScriptBasedCommand(
bool ScriptInterpreterPython::RunScriptBasedCommand(
StructuredData::GenericSP impl_obj_sp, const char *args,
ScriptedCommandSynchronicity synchronicity,
- lldb_private::CommandReturnObject &cmd_retobj, Error &error,
+ lldb_private::CommandReturnObject &cmd_retobj, Status &error,
const lldb_private::ExecutionContext &exe_ctx) {
if (!impl_obj_sp || !impl_obj_sp->IsValid()) {
error.SetErrorString("no function to execute");
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h
index 7b0e1b000d6..a71fcea7519 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h
@@ -161,11 +161,11 @@ public:
void *ret_value,
const ExecuteScriptOptions &options = ExecuteScriptOptions()) override;
- lldb_private::Error ExecuteMultipleLines(
+ lldb_private::Status ExecuteMultipleLines(
const char *in_string,
const ExecuteScriptOptions &options = ExecuteScriptOptions()) override;
- Error
+ Status
ExportFunctionDefinitionToInterpreter(StringList &function_def) override;
bool GenerateTypeScriptFunction(StringList &input, std::string &output,
@@ -229,12 +229,12 @@ public:
StructuredData::ObjectSP
LoadPluginModule(const FileSpec &file_spec,
- lldb_private::Error &error) override;
+ lldb_private::Status &error) override;
StructuredData::DictionarySP
GetDynamicSettings(StructuredData::ObjectSP plugin_module_sp, Target *target,
const char *setting_name,
- lldb_private::Error &error) override;
+ lldb_private::Status &error) override;
size_t CalculateNumChildren(const StructuredData::ObjectSP &implementor,
uint32_t max) override;
@@ -262,21 +262,21 @@ public:
RunScriptBasedCommand(const char *impl_function, const char *args,
ScriptedCommandSynchronicity synchronicity,
lldb_private::CommandReturnObject &cmd_retobj,
- Error &error,
+ Status &error,
const lldb_private::ExecutionContext &exe_ctx) override;
bool
RunScriptBasedCommand(StructuredData::GenericSP impl_obj_sp, const char *args,
ScriptedCommandSynchronicity synchronicity,
lldb_private::CommandReturnObject &cmd_retobj,
- Error &error,
+ Status &error,
const lldb_private::ExecutionContext &exe_ctx) override;
- Error GenerateFunction(const char *signature,
- const StringList &input) override;
+ Status GenerateFunction(const char *signature,
+ const StringList &input) override;
- Error GenerateBreakpointCommandCallbackData(StringList &input,
- std::string &output) override;
+ Status GenerateBreakpointCommandCallbackData(StringList &input,
+ std::string &output) override;
bool GenerateWatchpointCommandCallbackData(StringList &input,
std::string &output) override;
@@ -332,23 +332,23 @@ public:
}
bool RunScriptFormatKeyword(const char *impl_function, Process *process,
- std::string &output, Error &error) override;
+ std::string &output, Status &error) override;
bool RunScriptFormatKeyword(const char *impl_function, Thread *thread,
- std::string &output, Error &error) override;
+ std::string &output, Status &error) override;
bool RunScriptFormatKeyword(const char *impl_function, Target *target,
- std::string &output, Error &error) override;
+ std::string &output, Status &error) override;
bool RunScriptFormatKeyword(const char *impl_function, StackFrame *frame,
- std::string &output, Error &error) override;
+ std::string &output, Status &error) override;
bool RunScriptFormatKeyword(const char *impl_function, ValueObject *value,
- std::string &output, Error &error) override;
+ std::string &output, Status &error) override;
bool
LoadScriptingModule(const char *filename, bool can_reload, bool init_session,
- lldb_private::Error &error,
+ lldb_private::Status &error,
StructuredData::ObjectSP *module_sp = nullptr) override;
bool IsReservedWord(const char *word) override;
@@ -364,14 +364,14 @@ public:
CommandReturnObject &result) override;
/// Set the callback body text into the callback for the breakpoint.
- Error SetBreakpointCommandCallback(BreakpointOptions *bp_options,
- const char *callback_body) override;
+ Status SetBreakpointCommandCallback(BreakpointOptions *bp_options,
+ const char *callback_body) override;
void SetBreakpointCommandCallbackFunction(BreakpointOptions *bp_options,
const char *function_name) override;
/// This one is for deserialization:
- Error SetBreakpointCommandCallback(
+ Status SetBreakpointCommandCallback(
BreakpointOptions *bp_options,
std::unique_ptr<BreakpointOptions::CommandData> &data_up) override;
OpenPOWER on IntegriCloud