Med Ismail Bennani 3925204c1f [lldb/Plugins] Introduce Scripted Interface Factory
This patch splits the previous `ScriptedProcessPythonInterface` into
multiple specific classes:

1. The `ScriptedInterface` abstract class that carries the interface
   instance object and its virtual pure abstract creation method.

2. The `ScriptedPythonInterface` that holds a generic `Dispatch` method that
   can be used by various interfaces to call python methods and also keeps a
   reference to the Python Script Interpreter instance.

3. The `ScriptedProcessInterface` that describes the base Scripted
   Process model with all the methods used in the underlying script.

All these components are used to refactor the `ScriptedProcessPythonInterface`
class, making it more modular.

This patch is also a requirement for the upcoming work on `ScriptedThread`.

Differential Revision: https://reviews.llvm.org/D107521

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2021-09-03 19:37:25 +02:00

37 lines
832 B
CMake

if(NOT LLDB_PYTHON_RELATIVE_PATH)
message(FATAL_ERROR "LLDB_PYTHON_RELATIVE_PATH is not set.")
endif()
add_definitions(-DLLDB_PYTHON_RELATIVE_LIBDIR="${LLDB_PYTHON_RELATIVE_PATH}")
if (LLDB_ENABLE_LIBEDIT)
list(APPEND LLDB_LIBEDIT_LIBS ${LibEdit_LIBRARIES})
endif()
add_lldb_library(lldbPluginScriptInterpreterPython PLUGIN
PythonDataObjects.cpp
PythonReadline.cpp
ScriptInterpreterPython.cpp
ScriptedPythonInterface.cpp
ScriptedProcessPythonInterface.cpp
SWIGPythonBridge.cpp
LINK_LIBS
lldbBreakpoint
lldbCore
lldbDataFormatters
lldbHost
lldbInterpreter
lldbTarget
${Python3_LIBRARIES}
${LLDB_LIBEDIT_LIBS}
LINK_COMPONENTS
Support
)
if (LLDB_ENABLE_LIBEDIT)
target_include_directories(lldbPluginScriptInterpreterPython PUBLIC
${LibEdit_INCLUDE_DIRS}
)
endif()