diff options
author | Med Ismail Bennani <ismail@bennani.ma> | 2024-01-29 02:21:14 -0800 |
---|---|---|
committer | Med Ismail Bennani <ismail@bennani.ma> | 2024-01-29 03:17:33 -0800 |
commit | 888501bc631c4f6d373b4081ff6c504a1ce4a682 (patch) | |
tree | 6f95d3b7480b6b2b2d2a8eaff812b944ae313068 /lldb/unittests | |
parent | 5f4ee5a2dfa97fe32ee62d1d67aa1413d5a059e6 (diff) | |
download | llvm-888501bc631c4f6d373b4081ff6c504a1ce4a682.zip llvm-888501bc631c4f6d373b4081ff6c504a1ce4a682.tar.gz llvm-888501bc631c4f6d373b4081ff6c504a1ce4a682.tar.bz2 |
[lldb] Make use of Scripted{Python,}Interface for ScriptedThreadPlan (#70392)
This patch makes ScriptedThreadPlan conforming to the ScriptedInterface
& ScriptedPythonInterface facilities by introducing 2
ScriptedThreadPlanInterface & ScriptedThreadPlanPythonInterface classes.
This allows us to get rid of every ScriptedThreadPlan-specific SWIG
method and re-use the same affordances as other scripting offordances,
like Scripted{Process,Thread,Platform} & OperatingSystem.
To do so, this adds new transformer methods for `ThreadPlan`, `Stream` &
`Event`, to allow the bijection between C++ objects and their python
counterparts.
Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
Diffstat (limited to 'lldb/unittests')
-rw-r--r-- | lldb/unittests/ScriptInterpreter/Python/PythonTestSuite.cpp | 50 |
1 files changed, 30 insertions, 20 deletions
diff --git a/lldb/unittests/ScriptInterpreter/Python/PythonTestSuite.cpp b/lldb/unittests/ScriptInterpreter/Python/PythonTestSuite.cpp index 7f3359f..8d7e6ac 100644 --- a/lldb/unittests/ScriptInterpreter/Python/PythonTestSuite.cpp +++ b/lldb/unittests/ScriptInterpreter/Python/PythonTestSuite.cpp @@ -96,26 +96,6 @@ lldb_private::python::SWIGBridge::LLDBSwigPythonCreateCommandObject( return python::PythonObject(); } -python::PythonObject -lldb_private::python::SWIGBridge::LLDBSwigPythonCreateScriptedThreadPlan( - const char *python_class_name, const char *session_dictionary_name, - const StructuredDataImpl &args_data, std::string &error_string, - const lldb::ThreadPlanSP &thread_plan_sp) { - return python::PythonObject(); -} - -bool lldb_private::python::SWIGBridge::LLDBSWIGPythonCallThreadPlan( - void *implementor, const char *method_name, Event *event_sp, - bool &got_error) { - return false; -} - -bool lldb_private::python::SWIGBridge::LLDBSWIGPythonCallThreadPlan( - void *implementor, const char *method_name, Stream *event_sp, - bool &got_error) { - return false; -} - python::PythonObject lldb_private::python::SWIGBridge:: LLDBSwigPythonCreateScriptedBreakpointResolver( const char *python_class_name, const char *session_dictionary_name, @@ -171,6 +151,16 @@ lldb_private::python::LLDBSWIGPython_CastPyObjectToSBError(PyObject *data) { } void * +lldb_private::python::LLDBSWIGPython_CastPyObjectToSBEvent(PyObject *data) { + return nullptr; +} + +void * +lldb_private::python::LLDBSWIGPython_CastPyObjectToSBStream(PyObject *data) { + return nullptr; +} + +void * lldb_private::python::LLDBSWIGPython_CastPyObjectToSBValue(PyObject *data) { return nullptr; } @@ -320,6 +310,11 @@ lldb_private::python::SWIGBridge::ToSWIGWrapper(lldb::ExecutionContextRefSP) { } python::PythonObject +lldb_private::python::SWIGBridge::ToSWIGWrapper(lldb::ThreadPlanSP) { + return python::PythonObject(); +} + +python::PythonObject lldb_private::python::SWIGBridge::ToSWIGWrapper(lldb::ProcessSP) { return python::PythonObject(); } @@ -328,3 +323,18 @@ python::PythonObject lldb_private::python::SWIGBridge::ToSWIGWrapper( const lldb_private::StructuredDataImpl &) { return python::PythonObject(); } + +python::PythonObject +lldb_private::python::SWIGBridge::ToSWIGWrapper(Event *event) { + return python::PythonObject(); +} + +python::PythonObject +lldb_private::python::SWIGBridge::ToSWIGWrapper(const Stream *stream) { + return python::PythonObject(); +} + +python::PythonObject lldb_private::python::SWIGBridge::ToSWIGWrapper( + std::shared_ptr<lldb::SBStream> stream_sb) { + return python::PythonObject(); +} |