[Lldb-commits] [lldb] [lldb] Unifying Scripted Affordance Interfaces (wip) (PR #68052)
via lldb-commits
lldb-commits at lists.llvm.org
Mon Oct 2 17:02:26 PDT 2023
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff 824b1677a44e25b7c9808c774ba2d894ff14df2b 3ef039a731e09ec3767e71714fc273084c5773a8 -- lldb/include/lldb/Interpreter/Interfaces/OperatingSystemInterface.h lldb/include/lldb/Interpreter/Interfaces/ScriptedThreadInterface.h lldb/include/lldb/Interpreter/Interfaces/ScriptedThreadPlanInterface.h lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/OperatingSystemPythonInterface.cpp lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/OperatingSystemPythonInterface.h lldb/include/lldb/Interpreter/ScriptInterpreter.h lldb/include/lldb/Target/ThreadPlanPython.h lldb/include/lldb/lldb-forward.h lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.h lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp lldb/source/Plugins/Process/scripted/ScriptedThread.cpp lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h lldb/source/Target/ThreadPlanPython.cpp lldb/include/lldb/Interpreter/Interfaces/ScriptedInterface.h lldb/include/lldb/Interpreter/Interfaces/ScriptedPlatformInterface.h lldb/include/lldb/Interpreter/Interfaces/ScriptedProcessInterface.h lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPlatformPythonInterface.cpp lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPlatformPythonInterface.h lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedProcessPythonInterface.cpp lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedProcessPythonInterface.h lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.cpp lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.h lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPythonInterface.cpp lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPythonInterface.h
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/lldb/include/lldb/Interpreter/Interfaces/ScriptedInterface.h b/lldb/include/lldb/Interpreter/Interfaces/ScriptedInterface.h
index 31b1087fe930..3202eae9d195 100644
--- a/lldb/include/lldb/Interpreter/Interfaces/ScriptedInterface.h
+++ b/lldb/include/lldb/Interpreter/Interfaces/ScriptedInterface.h
@@ -25,10 +25,10 @@ public:
ScriptedInterface() = default;
virtual ~ScriptedInterface() = default;
- template <typename ...Args>
+ template <typename... Args>
StructuredData::GenericSP
CreatePluginObject(llvm::StringRef class_name,
- StructuredData::Generic *script_obj, Args && ...args) {
+ StructuredData::Generic *script_obj, Args &&...args) {
llvm_unreachable("Not implemented.");
}
diff --git a/lldb/include/lldb/Interpreter/Interfaces/ScriptedPlatformInterface.h b/lldb/include/lldb/Interpreter/Interfaces/ScriptedPlatformInterface.h
index cf7ba42af77d..28cf1f104fb2 100644
--- a/lldb/include/lldb/Interpreter/Interfaces/ScriptedPlatformInterface.h
+++ b/lldb/include/lldb/Interpreter/Interfaces/ScriptedPlatformInterface.h
@@ -19,7 +19,7 @@
namespace lldb_private {
class ScriptedPlatformInterface : virtual public ScriptedInterface {
public:
- template <typename ...Args>
+ template <typename... Args>
StructuredData::GenericSP
CreatePluginObject(llvm::StringRef class_name,
StructuredData::Generic *script_obj, Args &&...args) {
diff --git a/lldb/include/lldb/Interpreter/Interfaces/ScriptedProcessInterface.h b/lldb/include/lldb/Interpreter/Interfaces/ScriptedProcessInterface.h
index 9aec14c92f2c..54350914f5da 100644
--- a/lldb/include/lldb/Interpreter/Interfaces/ScriptedProcessInterface.h
+++ b/lldb/include/lldb/Interpreter/Interfaces/ScriptedProcessInterface.h
@@ -21,7 +21,7 @@
namespace lldb_private {
class ScriptedProcessInterface : virtual public ScriptedInterface {
public:
- template <typename ...Args>
+ template <typename... Args>
StructuredData::GenericSP
CreatePluginObject(llvm::StringRef class_name,
StructuredData::Generic *script_obj, Args &&...args) {
diff --git a/lldb/include/lldb/Interpreter/Interfaces/ScriptedThreadInterface.h b/lldb/include/lldb/Interpreter/Interfaces/ScriptedThreadInterface.h
index 9c6e46cb7f59..48b81d86b306 100644
--- a/lldb/include/lldb/Interpreter/Interfaces/ScriptedThreadInterface.h
+++ b/lldb/include/lldb/Interpreter/Interfaces/ScriptedThreadInterface.h
@@ -20,7 +20,7 @@
namespace lldb_private {
class ScriptedThreadInterface : virtual public ScriptedInterface {
public:
- template <typename ...Args>
+ template <typename... Args>
StructuredData::GenericSP
CreatePluginObject(llvm::StringRef class_name,
StructuredData::Generic *script_obj, Args &&...args) {
diff --git a/lldb/include/lldb/Interpreter/Interfaces/ScriptedThreadPlanInterface.h b/lldb/include/lldb/Interpreter/Interfaces/ScriptedThreadPlanInterface.h
index 46da47fd460b..cc565cb74a04 100644
--- a/lldb/include/lldb/Interpreter/Interfaces/ScriptedThreadPlanInterface.h
+++ b/lldb/include/lldb/Interpreter/Interfaces/ScriptedThreadPlanInterface.h
@@ -20,13 +20,13 @@
namespace lldb_private {
class ScriptedThreadPlanInterface : virtual public ScriptedInterface {
public:
- template <typename ...Args>
+ template <typename... Args>
StructuredData::GenericSP
CreatePluginObject(llvm::StringRef class_name,
StructuredData::Generic *script_obj, Args &&...args) {
llvm_unreachable("Not implemented.");
}
-
+
virtual bool ExplainsStop(Event *event) { return true; }
virtual bool ShouldStop(Event *event) { return true; }
diff --git a/lldb/include/lldb/Interpreter/ScriptInterpreter.h b/lldb/include/lldb/Interpreter/ScriptInterpreter.h
index cc4ff96de747..deb7168e80e9 100644
--- a/lldb/include/lldb/Interpreter/ScriptInterpreter.h
+++ b/lldb/include/lldb/Interpreter/ScriptInterpreter.h
@@ -552,8 +552,9 @@ public:
virtual lldb::ScriptedThreadInterfaceSP CreateScriptedThreadInterface() {
return std::make_shared<ScriptedThreadInterface>();
}
-
- virtual lldb::ScriptedThreadPlanInterfaceSP CreateScriptedThreadPlanInterface() {
+
+ virtual lldb::ScriptedThreadPlanInterfaceSP
+ CreateScriptedThreadPlanInterface() {
return std::make_shared<ScriptedThreadPlanInterface>();
}
diff --git a/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp b/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp
index 28739a07de7d..b67a1c0aa442 100644
--- a/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp
+++ b/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp
@@ -116,7 +116,8 @@ OperatingSystemPython::OperatingSystemPython(lldb_private::Process *process,
ExecutionContext exe_ctx(process);
StructuredData::GenericSP owned_script_object_sp =
- operating_system_interface->CreatePluginObject(os_plugin_class_name, nullptr, exe_ctx);
+ operating_system_interface->CreatePluginObject(os_plugin_class_name,
+ nullptr, exe_ctx);
if (!owned_script_object_sp)
// return llvm::createStringError(llvm::inconvertibleErrorCode(),
diff --git a/lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp b/lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp
index 614c699f55d3..9e71f35aa7ff 100644
--- a/lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp
+++ b/lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp
@@ -109,7 +109,8 @@ ScriptedProcess::ScriptedProcess(lldb::TargetSP target_sp,
// Create process script object
StructuredData::GenericSP object_sp = GetInterface().CreatePluginObject(
- m_scripted_metadata.GetClassName(), nullptr, exe_ctx, m_scripted_metadata.GetArgsSP());
+ m_scripted_metadata.GetClassName(), nullptr, exe_ctx,
+ m_scripted_metadata.GetArgsSP());
if (!object_sp || !object_sp->IsValid()) {
error.SetErrorStringWithFormat("ScriptedProcess::%s () - ERROR: %s",
diff --git a/lldb/source/Plugins/Process/scripted/ScriptedThread.cpp b/lldb/source/Plugins/Process/scripted/ScriptedThread.cpp
index e4af8e95a753..c81f1700c881 100644
--- a/lldb/source/Plugins/Process/scripted/ScriptedThread.cpp
+++ b/lldb/source/Plugins/Process/scripted/ScriptedThread.cpp
@@ -58,8 +58,8 @@ ScriptedThread::Create(ScriptedProcess &process,
ExecutionContext exe_ctx(process);
StructuredData::GenericSP owned_script_object_sp =
scripted_thread_interface->CreatePluginObject(
- thread_class_name, script_object,
- exe_ctx, process.m_scripted_metadata.GetArgsSP());
+ thread_class_name, script_object, exe_ctx,
+ process.m_scripted_metadata.GetArgsSP());
if (!owned_script_object_sp)
return llvm::createStringError(llvm::inconvertibleErrorCode(),
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/OperatingSystemPythonInterface.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/OperatingSystemPythonInterface.cpp
index 4efbbbfe4087..37052014df67 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/OperatingSystemPythonInterface.cpp
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/OperatingSystemPythonInterface.cpp
@@ -31,10 +31,8 @@ OperatingSystemPythonInterface::OperatingSystemPythonInterface(
StructuredData::GenericSP OperatingSystemPythonInterface::CreatePluginObject(
llvm::StringRef class_name, StructuredData::Generic *script_obj,
ExecutionContext &exe_ctx, StructuredData::DictionarySP args_sp) {
- return ScriptedPythonInterface::CreatePluginObject(class_name,
- script_obj,
- exe_ctx,
- args_sp);
+ return ScriptedPythonInterface::CreatePluginObject(class_name, script_obj,
+ exe_ctx, args_sp);
}
StructuredData::DictionarySP
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/OperatingSystemPythonInterface.h b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/OperatingSystemPythonInterface.h
index 87fded49f796..1e2560865c45 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/OperatingSystemPythonInterface.h
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/OperatingSystemPythonInterface.h
@@ -24,11 +24,9 @@ class OperatingSystemPythonInterface
public:
OperatingSystemPythonInterface(ScriptInterpreterPythonImpl &interpreter);
- StructuredData::GenericSP
- CreatePluginObject(llvm::StringRef class_name,
- StructuredData::Generic *script_obj,
- ExecutionContext &exe_ctx,
- StructuredData::DictionarySP args_sp);
+ StructuredData::GenericSP CreatePluginObject(
+ llvm::StringRef class_name, StructuredData::Generic *script_obj,
+ ExecutionContext &exe_ctx, StructuredData::DictionarySP args_sp);
StructuredData::DictionarySP CreateThread(lldb::tid_t tid,
lldb::addr_t context) override;
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPlatformPythonInterface.h b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPlatformPythonInterface.h
index 45e6c7fc1c1b..e51a695a12bf 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPlatformPythonInterface.h
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPlatformPythonInterface.h
@@ -21,12 +21,13 @@ class ScriptedPlatformPythonInterface : public ScriptedPlatformInterface,
public ScriptedPythonInterface {
public:
ScriptedPlatformPythonInterface(ScriptInterpreterPythonImpl &interpreter);
-
- template <typename ...Args>
+
+ template <typename... Args>
StructuredData::GenericSP
CreatePluginObject(llvm::StringRef class_name,
- StructuredData::Generic *script_obj, Args ...args) {
- return ScriptedPythonInterface::CreatePluginObject(class_name, std::forward<Args>(args)...);
+ StructuredData::Generic *script_obj, Args... args) {
+ return ScriptedPythonInterface::CreatePluginObject(
+ class_name, std::forward<Args>(args)...);
}
StructuredData::DictionarySP ListProcesses() override;
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedProcessPythonInterface.h b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedProcessPythonInterface.h
index 4555cc0b1e84..9bb325f4af20 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedProcessPythonInterface.h
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedProcessPythonInterface.h
@@ -23,11 +23,12 @@ class ScriptedProcessPythonInterface : public ScriptedProcessInterface,
public:
ScriptedProcessPythonInterface(ScriptInterpreterPythonImpl &interpreter);
- template <typename ...Args>
+ template <typename... Args>
StructuredData::GenericSP
CreatePluginObject(llvm::StringRef class_name,
- StructuredData::Generic *script_obj, Args ...args) {
- return ScriptedPythonInterface::CreatePluginObject(class_name, std::forward<Args>(args)...);
+ StructuredData::Generic *script_obj, Args... args) {
+ return ScriptedPythonInterface::CreatePluginObject(
+ class_name, std::forward<Args>(args)...);
}
StructuredData::DictionarySP GetCapabilities() override;
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.h b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.h
index 706cfee32dc2..9326dced119c 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.h
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.h
@@ -30,29 +30,34 @@ class ScriptInterpreterPythonImpl;
class ScriptedPythonInterface : virtual public ScriptedInterface {
public:
ScriptedPythonInterface(ScriptInterpreterPythonImpl &interpreter);
-
- template <typename ...Args>
+
+ template <typename... Args>
StructuredData::GenericSP
CreatePluginObject(llvm::StringRef class_name,
- StructuredData::Generic *script_obj, Args ...args) {
+ StructuredData::Generic *script_obj, Args... args) {
using namespace python;
using Locker = ScriptInterpreterPythonImpl::Locker;
-
+
std::string error_string;
- if (class_name.empty() || llvm::StringRef(m_interpreter.GetDictionaryName()).empty())
+ if (class_name.empty() ||
+ llvm::StringRef(m_interpreter.GetDictionaryName()).empty())
return {};
Locker py_lock(&m_interpreter, Locker::AcquireLock | Locker::NoSTDIN,
Locker::FreeLock);
- auto dict = PythonModule::MainModule().ResolveName<python::PythonDictionary>(m_interpreter.GetDictionaryName());
- auto pfunc = PythonObject::ResolveNameWithDictionary<python::PythonCallable>(class_name, dict);
+ auto dict =
+ PythonModule::MainModule().ResolveName<python::PythonDictionary>(
+ m_interpreter.GetDictionaryName());
+ auto pfunc =
+ PythonObject::ResolveNameWithDictionary<python::PythonCallable>(
+ class_name, dict);
if (!pfunc.IsAllocated()) {
error_string.append("could not find script class: ");
error_string.append(class_name);
return {};
}
-
+
std::tuple<Args...> original_args = std::forward_as_tuple(args...);
auto transformed_args = TransformArgs(original_args);
@@ -60,7 +65,7 @@ public:
if (!arg_info) {
llvm::handleAllErrors(
arg_info.takeError(),
- [&](PythonException &E) { error_string.append(E.ReadBacktrace()); },
+ [&](PythonException &E) { error_string.append(E.ReadBacktrace()); },
[&](const llvm::ErrorInfoBase &E) {
error_string.append(E.message());
});
@@ -68,29 +73,34 @@ public:
}
PythonObject result = {};
-// switch (arg_info.get().max_positional_args) {
-// case 1:
-// // FIXME: Since this is used by different scripting affordances, they can have different number
-// // of argument but also different types of arguments (i.e SBExecutionContect vs SBProcess)
-// // We need to have a more reliable way to forward positional arguments.
-// result = pfunc(SWIGBridge::ToSWIGWrapper(exe_ctx_sp->GetProcessSP()));
-// break;
-// case 2:
-// result = pfunc(SWIGBridge::ToSWIGWrapper(exe_ctx_sp), SWIGBridge::ToSWIGWrapper(args_impl));
-// break;
-// default:
-// error_string.assign("wrong number of arguments in __init__, should be 2 "
-// "(not including self)");
-// break;
-// }
-
+ // switch (arg_info.get().max_positional_args) {
+ // case 1:
+ // // FIXME: Since this is used by different scripting affordances,
+ // they can have different number
+ // // of argument but also different types of arguments (i.e
+ // SBExecutionContect vs SBProcess)
+ // // We need to have a more reliable way to forward positional
+ // arguments. result =
+ // pfunc(SWIGBridge::ToSWIGWrapper(exe_ctx_sp->GetProcessSP()));
+ // break;
+ // case 2:
+ // result = pfunc(SWIGBridge::ToSWIGWrapper(exe_ctx_sp),
+ // SWIGBridge::ToSWIGWrapper(args_impl)); break;
+ // default:
+ // error_string.assign("wrong number of arguments in __init__, should
+ // be 2 "
+ // "(not including self)");
+ // break;
+ // }
+
if (!result.IsValid())
return {};
- m_object_instance_sp = StructuredData::GenericSP(new StructuredPythonObject(std::move(result)));
+ m_object_instance_sp = StructuredData::GenericSP(
+ new StructuredPythonObject(std::move(result)));
return m_object_instance_sp;
}
-
+
~ScriptedPythonInterface() override = default;
protected:
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPythonInterface.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPythonInterface.cpp
index 1721565b3e2f..13f06863075d 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPythonInterface.cpp
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPythonInterface.cpp
@@ -29,38 +29,40 @@ ScriptedThreadPythonInterface::ScriptedThreadPythonInterface(
ScriptInterpreterPythonImpl &interpreter)
: ScriptedThreadInterface(), ScriptedPythonInterface(interpreter) {}
-//StructuredData::GenericSP ScriptedThreadPythonInterface::CreatePluginObject(
-// const llvm::StringRef class_name, ExecutionContext &exe_ctx,
-// StructuredData::DictionarySP args_sp, StructuredData::Generic *script_obj) {
-// if (class_name.empty() && !script_obj)
-// return {};
+// StructuredData::GenericSP ScriptedThreadPythonInterface::CreatePluginObject(
+// const llvm::StringRef class_name, ExecutionContext &exe_ctx,
+// StructuredData::DictionarySP args_sp, StructuredData::Generic
+// *script_obj) {
+// if (class_name.empty() && !script_obj)
+// return {};
//
-// StructuredDataImpl args_impl(args_sp);
-// std::string error_string;
+// StructuredDataImpl args_impl(args_sp);
+// std::string error_string;
//
-// Locker py_lock(&m_interpreter, Locker::AcquireLock | Locker::NoSTDIN,
-// Locker::FreeLock);
+// Locker py_lock(&m_interpreter, Locker::AcquireLock | Locker::NoSTDIN,
+// Locker::FreeLock);
//
-// PythonObject ret_val;
+// PythonObject ret_val;
//
-// if (!script_obj) {
-// lldb::ExecutionContextRefSP exe_ctx_ref_sp =
-// std::make_shared<ExecutionContextRef>(exe_ctx);
-// ret_val = SWIGBridge::LLDBSwigPythonCreateScriptedObject(
-// class_name.str().c_str(), m_interpreter.GetDictionaryName(),
-// exe_ctx_ref_sp, args_impl, error_string);
-// } else
-// ret_val = PythonObject(PyRefType::Borrowed,
-// static_cast<PyObject *>(script_obj->GetValue()));
+// if (!script_obj) {
+// lldb::ExecutionContextRefSP exe_ctx_ref_sp =
+// std::make_shared<ExecutionContextRef>(exe_ctx);
+// ret_val = SWIGBridge::LLDBSwigPythonCreateScriptedObject(
+// class_name.str().c_str(), m_interpreter.GetDictionaryName(),
+// exe_ctx_ref_sp, args_impl, error_string);
+// } else
+// ret_val = PythonObject(PyRefType::Borrowed,
+// static_cast<PyObject *>(script_obj->GetValue()));
//
-// if (!ret_val)
-// return {};
+// if (!ret_val)
+// return {};
//
-// m_object_instance_sp =
-// StructuredData::GenericSP(new StructuredPythonObject(std::move(ret_val)));
+// m_object_instance_sp =
+// StructuredData::GenericSP(new
+// StructuredPythonObject(std::move(ret_val)));
//
-// return m_object_instance_sp;
-//}
+// return m_object_instance_sp;
+// }
lldb::tid_t ScriptedThreadPythonInterface::GetThreadID() {
Status error;
diff --git a/lldb/source/Target/ThreadPlanPython.cpp b/lldb/source/Target/ThreadPlanPython.cpp
index d7e0d59ea205..ca1ea9bbcb90 100644
--- a/lldb/source/Target/ThreadPlanPython.cpp
+++ b/lldb/source/Target/ThreadPlanPython.cpp
@@ -32,14 +32,13 @@ ThreadPlanPython::ThreadPlanPython(Thread &thread, const char *class_name,
eVoteNoOpinion, eVoteNoOpinion),
m_class_name(class_name), m_args_data(args_data), m_did_push(false),
m_stop_others(false) {
- ScriptInterpreter* interpreter = GetScriptInterpreter();
+ ScriptInterpreter *interpreter = GetScriptInterpreter();
if (!interpreter) {
SetPlanComplete(false);
// FIXME: error handling
return;
}
-
m_interface = interpreter->CreateScriptedThreadPlanInterface();
SetIsControllingPlan(true);
SetOkayToDiscard(true);
@@ -90,8 +89,8 @@ bool ThreadPlanPython::ShouldStop(Event *event_ptr) {
if (script_interp) {
bool script_error;
should_stop = m_interface->ShouldStop(event_ptr);
-// if (script_error)
-// SetPlanComplete(false);
+ // if (script_error)
+ // SetPlanComplete(false);
}
}
return should_stop;
@@ -108,8 +107,8 @@ bool ThreadPlanPython::IsPlanStale() {
if (script_interp) {
bool script_error;
is_stale = m_interface->IsStale();
-// if (script_error)
-// SetPlanComplete(false);
+ // if (script_error)
+ // SetPlanComplete(false);
}
}
return is_stale;
@@ -126,8 +125,8 @@ bool ThreadPlanPython::DoPlanExplainsStop(Event *event_ptr) {
if (script_interp) {
bool script_error;
explains_stop = m_interface->ExplainsStop(event_ptr);
-// if (script_error)
-// SetPlanComplete(false);
+ // if (script_error)
+ // SetPlanComplete(false);
}
}
return explains_stop;
``````````
</details>
https://github.com/llvm/llvm-project/pull/68052
More information about the lldb-commits
mailing list