From 182f0d1a34419445bb19d67581d6ac1afc98b7fa Mon Sep 17 00:00:00 2001 From: Med Ismail Bennani Date: Thu, 18 Feb 2021 11:31:10 +0100 Subject: [lldb/Interpreter] Add ScriptInterpreter Wrapper for ScriptedProcess This patch adds a ScriptedProcess interface to the ScriptInterpreter and more specifically, to the ScriptInterpreterPython. This interface will be used in the C++ `ScriptProcess` Process Plugin to call the script methods. At the moment, not all methods are implemented, they will upstreamed in upcoming patches. This patch also adds helper methods to the ScriptInterpreter to convert `SBAPI` Types (SBData & SBError) to `lldb_private` types (DataExtractor & Status). rdar://65508855 Differential Revision: https://reviews.llvm.org/D95711 Signed-off-by: Med Ismail Bennani --- .../ScriptInterpreter/Python/PythonTestSuite.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'lldb/unittests/ScriptInterpreter/Python/PythonTestSuite.cpp') diff --git a/lldb/unittests/ScriptInterpreter/Python/PythonTestSuite.cpp b/lldb/unittests/ScriptInterpreter/Python/PythonTestSuite.cpp index 58ddf0c..f93733b 100644 --- a/lldb/unittests/ScriptInterpreter/Python/PythonTestSuite.cpp +++ b/lldb/unittests/ScriptInterpreter/Python/PythonTestSuite.cpp @@ -12,6 +12,7 @@ #include "Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h" #include "Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h" +#include "lldb/API/SBError.h" #include "lldb/Host/FileSystem.h" #include "lldb/Host/HostInfo.h" @@ -153,6 +154,14 @@ extern "C" int LLDBSwigPython_GetIndexOfChildWithName(void *implementor, return 0; } +extern "C" void *LLDBSWIGPython_CastPyObjectToSBData(void *data) { + return nullptr; +} + +extern "C" void *LLDBSWIGPython_CastPyObjectToSBError(void *data) { + return nullptr; +} + extern "C" void *LLDBSWIGPython_CastPyObjectToSBValue(void *data) { return nullptr; } @@ -207,6 +216,13 @@ LLDBSWIGPythonCreateOSPlugin(const char *python_class_name, return nullptr; } +extern "C" void *LLDBSwigPythonCreateScriptedProcess( + const char *python_class_name, const char *session_dictionary_name, + const lldb::TargetSP &target_sp, StructuredDataImpl *args_impl, + std::string &error_string) { + return nullptr; +} + extern "C" void * LLDBSWIGPython_CreateFrameRecognizer(const char *python_class_name, const char *session_dictionary_name) { -- cgit v1.1