[lldb/Plugins] Introduce Scripted Interface Factory
authorMed Ismail Bennani <medismail.bennani@gmail.com>
Fri, 3 Sep 2021 17:35:02 +0000 (17:35 +0000)
committerMed Ismail Bennani <medismail.bennani@gmail.com>
Fri, 3 Sep 2021 17:37:25 +0000 (19:37 +0200)
commit3925204c1f5880f491e08d8481e88342bbeb7bc4
treeb60a7d478c4d9c0ef14cc96682f24ef3fa6b8f20
parentb9e57e030560fef9ddc51caca8bacfefccdf8a62
[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>
lldb/bindings/python/python-wrapper.swig
lldb/include/lldb/Interpreter/ScriptedInterface.h [new file with mode: 0644]
lldb/include/lldb/Interpreter/ScriptedProcessInterface.h
lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp
lldb/source/Plugins/ScriptInterpreter/Python/CMakeLists.txt
lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h
lldb/source/Plugins/ScriptInterpreter/Python/ScriptedProcessPythonInterface.cpp
lldb/source/Plugins/ScriptInterpreter/Python/ScriptedProcessPythonInterface.h
lldb/source/Plugins/ScriptInterpreter/Python/ScriptedPythonInterface.cpp [new file with mode: 0644]
lldb/source/Plugins/ScriptInterpreter/Python/ScriptedPythonInterface.h [new file with mode: 0644]
lldb/unittests/ScriptInterpreter/Python/PythonTestSuite.cpp