From 1f6a57c1a0fad922e04a2b1f414b092d4b0cd8b0 Mon Sep 17 00:00:00 2001 From: Med Ismail Bennani Date: Tue, 23 Mar 2021 16:22:18 +0000 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