diff options
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python')
22 files changed, 61 insertions, 347 deletions
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/CMakeLists.txt b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/CMakeLists.txt index eb22a96..c60e4bb 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/CMakeLists.txt +++ b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/CMakeLists.txt @@ -20,8 +20,12 @@ if (LLDB_ENABLE_LIBEDIT) endif() add_lldb_library(lldbPluginScriptInterpreterPythonInterfaces + OperatingSystemPythonInterface.cpp ScriptedPythonInterface.cpp + ScriptedProcessPythonInterface.cpp ScriptedThreadPythonInterface.cpp + ScriptedThreadPlanPythonInterface.cpp + ScriptedPlatformPythonInterface.cpp LINK_LIBS lldbCore @@ -34,9 +38,3 @@ add_lldb_library(lldbPluginScriptInterpreterPythonInterfaces LINK_COMPONENTS Support ) - -add_subdirectory(OperatingSystemPythonInterface) -add_subdirectory(ScriptedPlatformPythonInterface) -add_subdirectory(ScriptedProcessPythonInterface) -add_subdirectory(ScriptedThreadPlanPythonInterface) - diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/OperatingSystemPythonInterface/OperatingSystemPythonInterface.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/OperatingSystemPythonInterface.cpp index 019db26..c162c73 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/OperatingSystemPythonInterface/OperatingSystemPythonInterface.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/OperatingSystemPythonInterface.cpp @@ -6,7 +6,6 @@ // //===----------------------------------------------------------------------===// -#include "lldb/Core/PluginManager.h" #include "lldb/Host/Config.h" #include "lldb/Target/ExecutionContext.h" #include "lldb/Utility/Log.h" @@ -14,13 +13,11 @@ #if LLDB_ENABLE_PYTHON -// clang-format off // LLDB Python header must be included first -#include "../../lldb-python.h" -//clang-format on +#include "../lldb-python.h" -#include "../../SWIGPythonBridge.h" -#include "../../ScriptInterpreterPythonImpl.h" +#include "../SWIGPythonBridge.h" +#include "../ScriptInterpreterPythonImpl.h" #include "OperatingSystemPythonInterface.h" using namespace lldb; @@ -28,8 +25,6 @@ using namespace lldb_private; using namespace lldb_private::python; using Locker = ScriptInterpreterPythonImpl::Locker; -LLDB_PLUGIN_DEFINE_ADV(OperatingSystemPythonInterface, ScriptInterpreterPythonOperatingSystemPythonInterface) - OperatingSystemPythonInterface::OperatingSystemPythonInterface( ScriptInterpreterPythonImpl &interpreter) : OperatingSystemInterface(), ScriptedThreadPythonInterface(interpreter) {} @@ -84,18 +79,4 @@ OperatingSystemPythonInterface::GetRegisterContextForTID(lldb::tid_t tid) { return obj->GetAsString()->GetValue().str(); } -void OperatingSystemPythonInterface::Initialize() { - const std::vector<llvm::StringRef> ci_usages = { - "settings set target.process.python-os-plugin-path <script-path>", - "settings set process.experimental.os-plugin-reports-all-threads [0/1]"}; - const std::vector<llvm::StringRef> api_usages = {}; - PluginManager::RegisterPlugin( - GetPluginNameStatic(), llvm::StringRef("Mock thread state"), - CreateInstance, eScriptLanguagePython, {ci_usages, api_usages}); -} - -void OperatingSystemPythonInterface::Terminate() { - PluginManager::UnregisterPlugin(CreateInstance); -} - #endif diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/OperatingSystemPythonInterface/OperatingSystemPythonInterface.h b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/OperatingSystemPythonInterface.h index 001d49d..da7bbf1 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/OperatingSystemPythonInterface/OperatingSystemPythonInterface.h +++ b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/OperatingSystemPythonInterface.h @@ -9,28 +9,18 @@ #ifndef LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_OPERATINGSYSTEMPYTHONINTERFACE_H #define LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_OPERATINGSYSTEMPYTHONINTERFACE_H -#if LLDB_ENABLE_PYTHON - -// clang-format off -// LLDB Python header must be included first -#include "../../lldb-python.h" -//clang-format on -#endif - #include "lldb/Host/Config.h" -#include "lldb/Interpreter/Interfaces/OperatingSystemInterface.h" #if LLDB_ENABLE_PYTHON -#include "../ScriptedThreadPythonInterface.h" - +#include "ScriptedThreadPythonInterface.h" +#include "lldb/Interpreter/Interfaces/OperatingSystemInterface.h" #include <optional> namespace lldb_private { class OperatingSystemPythonInterface : virtual public OperatingSystemInterface, - virtual public ScriptedThreadPythonInterface, - public PluginInterface { + virtual public ScriptedThreadPythonInterface { public: OperatingSystemPythonInterface(ScriptInterpreterPythonImpl &interpreter); @@ -51,16 +41,6 @@ public: StructuredData::DictionarySP GetRegisterInfo() override; std::optional<std::string> GetRegisterContextForTID(lldb::tid_t tid) override; - - static void Initialize(); - - static void Terminate(); - - static llvm::StringRef GetPluginNameStatic() { - return "OperatingSystemPythonInterface"; - } - - llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); } }; } // namespace lldb_private diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/OperatingSystemPythonInterface/CMakeLists.txt b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/OperatingSystemPythonInterface/CMakeLists.txt deleted file mode 100644 index b48f1e8..0000000 --- a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/OperatingSystemPythonInterface/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -add_lldb_library(lldbPluginScriptInterpreterPythonOperatingSystemPythonInterface PLUGIN - - OperatingSystemPythonInterface.cpp - - LINK_LIBS - lldbCore - lldbHost - lldbInterpreter - lldbTarget - lldbPluginScriptInterpreterPython - ${Python3_LIBRARIES} - ${LLDB_LIBEDIT_LIBS} - - LINK_COMPONENTS - Support - ) diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPlatformPythonInterface/ScriptedPlatformPythonInterface.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPlatformPythonInterface.cpp index 2b701f850..6e93bec 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPlatformPythonInterface/ScriptedPlatformPythonInterface.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPlatformPythonInterface.cpp @@ -6,34 +6,27 @@ // //===----------------------------------------------------------------------===// -#if LLDB_ENABLE_PYTHON - -// clang-format off -// LLDB Python header must be included first -#include "../../lldb-python.h" -//clang-format on -#endif - -#include "lldb/Core/PluginManager.h" #include "lldb/Host/Config.h" -#include "lldb/Target/ExecutionContext.h" #include "lldb/Utility/Log.h" #include "lldb/Utility/Status.h" #include "lldb/lldb-enumerations.h" #if LLDB_ENABLE_PYTHON -#include "../../SWIGPythonBridge.h" -#include "../../ScriptInterpreterPythonImpl.h" +// LLDB Python header must be included first +#include "../lldb-python.h" + +#include "../SWIGPythonBridge.h" +#include "../ScriptInterpreterPythonImpl.h" #include "ScriptedPlatformPythonInterface.h" +#include "lldb/Target/ExecutionContext.h" + using namespace lldb; using namespace lldb_private; using namespace lldb_private::python; using Locker = ScriptInterpreterPythonImpl::Locker; -LLDB_PLUGIN_DEFINE_ADV(ScriptedPlatformPythonInterface, ScriptInterpreterPythonScriptedPlatformPythonInterface) - ScriptedPlatformPythonInterface::ScriptedPlatformPythonInterface( ScriptInterpreterPythonImpl &interpreter) : ScriptedPlatformInterface(), ScriptedPythonInterface(interpreter) {} @@ -100,14 +93,4 @@ Status ScriptedPlatformPythonInterface::KillProcess(lldb::pid_t pid) { return GetStatusFromMethod("kill_process", pid); } -void ScriptedPlatformPythonInterface::Initialize() { - PluginManager::RegisterPlugin( - GetPluginNameStatic(), "Mock platform and interact with its processes.", - CreateInstance, eScriptLanguagePython, {}); -} - -void ScriptedPlatformPythonInterface::Terminate() { - PluginManager::UnregisterPlugin(CreateInstance); -} - #endif // LLDB_ENABLE_PYTHON diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPlatformPythonInterface/ScriptedPlatformPythonInterface.h b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPlatformPythonInterface.h index c4b4e45..0842d3a 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPlatformPythonInterface/ScriptedPlatformPythonInterface.h +++ b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPlatformPythonInterface.h @@ -9,25 +9,16 @@ #ifndef LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDPLATFORMPYTHONINTERFACE_H #define LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDPLATFORMPYTHONINTERFACE_H -#if LLDB_ENABLE_PYTHON - -// clang-format off -// LLDB Python header must be included first -#include "../../lldb-python.h" -//clang-format on -#endif - #include "lldb/Host/Config.h" -#include "lldb/Interpreter/Interfaces/ScriptedPlatformInterface.h" #if LLDB_ENABLE_PYTHON -#include "../ScriptedPythonInterface.h" +#include "ScriptedPythonInterface.h" +#include "lldb/Interpreter/Interfaces/ScriptedPlatformInterface.h" namespace lldb_private { class ScriptedPlatformPythonInterface : public ScriptedPlatformInterface, - public ScriptedPythonInterface, - public PluginInterface { + public ScriptedPythonInterface { public: ScriptedPlatformPythonInterface(ScriptInterpreterPythonImpl &interpreter); @@ -52,16 +43,6 @@ public: Status LaunchProcess(lldb::ProcessLaunchInfoSP launch_info) override; Status KillProcess(lldb::pid_t pid) override; - - static void Initialize(); - - static void Terminate(); - - static llvm::StringRef GetPluginNameStatic() { - return "ScriptedPlatformPythonInterface"; - } - - llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); } }; } // namespace lldb_private diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPlatformPythonInterface/CMakeLists.txt b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPlatformPythonInterface/CMakeLists.txt deleted file mode 100644 index ae5e525..0000000 --- a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPlatformPythonInterface/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -add_lldb_library(lldbPluginScriptInterpreterPythonScriptedPlatformPythonInterface PLUGIN - - ScriptedPlatformPythonInterface.cpp - - LINK_LIBS - lldbCore - lldbHost - lldbInterpreter - lldbTarget - lldbPluginScriptInterpreterPython - ${Python3_LIBRARIES} - ${LLDB_LIBEDIT_LIBS} - - LINK_COMPONENTS - Support - ) diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedProcessPythonInterface/ScriptedProcessPythonInterface.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedProcessPythonInterface.cpp index 794c3e8..313c597 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedProcessPythonInterface/ScriptedProcessPythonInterface.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedProcessPythonInterface.cpp @@ -6,16 +6,11 @@ // //===----------------------------------------------------------------------===// +#include "lldb/Host/Config.h" #if LLDB_ENABLE_PYTHON - -// clang-format off // LLDB Python header must be included first -#include "../../lldb-python.h" -//clang-format on +#include "../lldb-python.h" #endif - -#include "lldb/Core/PluginManager.h" -#include "lldb/Host/Config.h" #include "lldb/Target/Process.h" #include "lldb/Utility/Log.h" #include "lldb/Utility/Status.h" @@ -23,11 +18,10 @@ #if LLDB_ENABLE_PYTHON -#include "../../SWIGPythonBridge.h" -#include "../../ScriptInterpreterPythonImpl.h" -#include "../ScriptedThreadPythonInterface.h" +#include "../SWIGPythonBridge.h" +#include "../ScriptInterpreterPythonImpl.h" #include "ScriptedProcessPythonInterface.h" - +#include "ScriptedThreadPythonInterface.h" #include <optional> using namespace lldb; @@ -35,8 +29,6 @@ using namespace lldb_private; using namespace lldb_private::python; using Locker = ScriptInterpreterPythonImpl::Locker; -LLDB_PLUGIN_DEFINE_ADV(ScriptedProcessPythonInterface, ScriptInterpreterPythonScriptedProcessPythonInterface) - ScriptedProcessPythonInterface::ScriptedProcessPythonInterface( ScriptInterpreterPythonImpl &interpreter) : ScriptedProcessInterface(), ScriptedPythonInterface(interpreter) {} @@ -216,24 +208,4 @@ StructuredData::DictionarySP ScriptedProcessPythonInterface::GetMetadata() { return dict; } -void ScriptedProcessPythonInterface::Initialize() { - const std::vector<llvm::StringRef> ci_usages = { - "process attach -C <script-name> [-k key -v value ...]", - "process launch -C <script-name> [-k key -v value ...]"}; - const std::vector<llvm::StringRef> api_usages = { - "SBAttachInfo.SetScriptedProcessClassName", - "SBAttachInfo.SetScriptedProcessDictionary", - "SBTarget.Attach", - "SBLaunchInfo.SetScriptedProcessClassName", - "SBLaunchInfo.SetScriptedProcessDictionary", - "SBTarget.Launch"}; - PluginManager::RegisterPlugin( - GetPluginNameStatic(), llvm::StringRef("Mock process state"), - CreateInstance, eScriptLanguagePython, {ci_usages, api_usages}); -} - -void ScriptedProcessPythonInterface::Terminate() { - PluginManager::UnregisterPlugin(CreateInstance); -} - #endif diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedProcessPythonInterface/ScriptedProcessPythonInterface.h b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedProcessPythonInterface.h index 996cbd6..c75caa9 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedProcessPythonInterface/ScriptedProcessPythonInterface.h +++ b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedProcessPythonInterface.h @@ -9,27 +9,17 @@ #ifndef LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDPROCESSPYTHONINTERFACE_H #define LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDPROCESSPYTHONINTERFACE_H -#if LLDB_ENABLE_PYTHON - -// clang-format off -// LLDB Python header must be included first -#include "../../lldb-python.h" -//clang-format on -#endif - #include "lldb/Host/Config.h" -#include "lldb/Interpreter/Interfaces/ScriptedProcessInterface.h" #if LLDB_ENABLE_PYTHON -#include "../ScriptedPythonInterface.h" - +#include "ScriptedPythonInterface.h" +#include "lldb/Interpreter/Interfaces/ScriptedProcessInterface.h" #include <optional> namespace lldb_private { class ScriptedProcessPythonInterface : public ScriptedProcessInterface, - public ScriptedPythonInterface, - public PluginInterface { + public ScriptedPythonInterface { public: ScriptedProcessPythonInterface(ScriptInterpreterPythonImpl &interpreter); @@ -77,16 +67,6 @@ public: StructuredData::DictionarySP GetMetadata() override; - static void Initialize(); - - static void Terminate(); - - static llvm::StringRef GetPluginNameStatic() { - return "ScriptedProcessPythonInterface"; - } - - llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); } - private: lldb::ScriptedThreadInterfaceSP CreateScriptedThreadInterface() override; }; diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedProcessPythonInterface/CMakeLists.txt b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedProcessPythonInterface/CMakeLists.txt deleted file mode 100644 index 66ed041..0000000 --- a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedProcessPythonInterface/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -add_lldb_library(lldbPluginScriptInterpreterPythonScriptedProcessPythonInterface PLUGIN - - ScriptedProcessPythonInterface.cpp - - LINK_LIBS - lldbCore - lldbHost - lldbInterpreter - lldbTarget - lldbPluginScriptInterpreterPython - ${Python3_LIBRARIES} - ${LLDB_LIBEDIT_LIBS} - - LINK_COMPONENTS - Support - ) diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.cpp index 7bb1bfe..699412e 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.cpp @@ -6,20 +6,15 @@ // //===----------------------------------------------------------------------===// -#if LLDB_ENABLE_PYTHON - -// clang-format off -// LLDB Python header must be included first -#include "../../lldb-python.h" -//clang-format on -#endif - #include "lldb/Host/Config.h" #include "lldb/Utility/Log.h" #include "lldb/lldb-enumerations.h" #if LLDB_ENABLE_PYTHON +// LLDB Python header must be included first +#include "../lldb-python.h" + #include "../ScriptInterpreterPythonImpl.h" #include "ScriptedPythonInterface.h" #include <optional> diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.h b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.h index d92e45e..e1a3156 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.h +++ b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.h @@ -10,15 +10,6 @@ #define LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDPYTHONINTERFACE_H #if LLDB_ENABLE_PYTHON -// clang-format off -// LLDB Python header must be included first -#include "../lldb-python.h" -//clang-format on -#endif - -#include "lldb/Host/Config.h" -#include "lldb/Interpreter/Interfaces/ScriptedInterface.h" -#include "lldb/Utility/DataBufferHeap.h" #include <optional> #include <sstream> @@ -26,7 +17,9 @@ #include <type_traits> #include <utility> -#if LLDB_ENABLE_PYTHON +#include "lldb/Host/Config.h" +#include "lldb/Interpreter/Interfaces/ScriptedInterface.h" +#include "lldb/Utility/DataBufferHeap.h" #include "../PythonDataObjects.h" #include "../SWIGPythonBridge.h" diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPlanPythonInterface/ScriptedThreadPlanPythonInterface.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPlanPythonInterface.cpp index d83ab28..f23858c 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPlanPythonInterface/ScriptedThreadPlanPythonInterface.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPlanPythonInterface.cpp @@ -6,31 +6,23 @@ // //===----------------------------------------------------------------------===// -#if LLDB_ENABLE_PYTHON - -// clang-format off -// LLDB Python header must be included first -#include "../../lldb-python.h" -//clang-format on -#endif - -#include "lldb/Core/PluginManager.h" #include "lldb/Host/Config.h" #include "lldb/Utility/Log.h" #include "lldb/lldb-enumerations.h" #if LLDB_ENABLE_PYTHON -#include "../../SWIGPythonBridge.h" -#include "../../ScriptInterpreterPythonImpl.h" +// LLDB Python header must be included first +#include "../lldb-python.h" + +#include "../SWIGPythonBridge.h" +#include "../ScriptInterpreterPythonImpl.h" #include "ScriptedThreadPlanPythonInterface.h" using namespace lldb; using namespace lldb_private; using namespace lldb_private::python; -LLDB_PLUGIN_DEFINE_ADV(ScriptedThreadPlanPythonInterface, ScriptInterpreterPythonScriptedThreadPlanPythonInterface) - ScriptedThreadPlanPythonInterface::ScriptedThreadPlanPythonInterface( ScriptInterpreterPythonImpl &interpreter) : ScriptedThreadPlanInterface(), ScriptedPythonInterface(interpreter) {} @@ -110,19 +102,4 @@ ScriptedThreadPlanPythonInterface::GetStopDescription(lldb::StreamSP &stream) { return llvm::Error::success(); } -void ScriptedThreadPlanPythonInterface::Initialize() { - const std::vector<llvm::StringRef> ci_usages = { - "thread step-scripted -C <script-name> [-k key -v value ...]"}; - const std::vector<llvm::StringRef> api_usages = { - "SBThread.StepUsingScriptedThreadPlan"}; - PluginManager::RegisterPlugin( - GetPluginNameStatic(), - llvm::StringRef("Alter thread stepping logic and stop reason"), - CreateInstance, eScriptLanguagePython, {ci_usages, api_usages}); -} - -void ScriptedThreadPlanPythonInterface::Terminate() { - PluginManager::UnregisterPlugin(CreateInstance); -} - #endif diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPlanPythonInterface/ScriptedThreadPlanPythonInterface.h b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPlanPythonInterface.h index 73b17a5..6ec89b9 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPlanPythonInterface/ScriptedThreadPlanPythonInterface.h +++ b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPlanPythonInterface.h @@ -9,28 +9,17 @@ #ifndef LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDTHREADPLANPYTHONINTERFACE_H #define LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDTHREADPLANPYTHONINTERFACE_H -#if LLDB_ENABLE_PYTHON - -// clang-format off -// LLDB Python header must be included first -#include "../../lldb-python.h" -//clang-format on - -#endif - #include "lldb/Host/Config.h" -#include "lldb/Interpreter/Interfaces/ScriptedThreadPlanInterface.h" #if LLDB_ENABLE_PYTHON -#include "../ScriptedPythonInterface.h" - +#include "ScriptedPythonInterface.h" +#include "lldb/Interpreter/Interfaces/ScriptedThreadPlanInterface.h" #include <optional> namespace lldb_private { class ScriptedThreadPlanPythonInterface : public ScriptedThreadPlanInterface, - public ScriptedPythonInterface, - public PluginInterface { + public ScriptedPythonInterface { public: ScriptedThreadPlanPythonInterface(ScriptInterpreterPythonImpl &interpreter); @@ -52,16 +41,6 @@ public: lldb::StateType GetRunState() override; llvm::Error GetStopDescription(lldb::StreamSP &stream) override; - - static void Initialize(); - - static void Terminate(); - - static llvm::StringRef GetPluginNameStatic() { - return "ScriptedThreadPlanPythonInterface"; - } - - llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); } }; } // namespace lldb_private diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPlanPythonInterface/CMakeLists.txt b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPlanPythonInterface/CMakeLists.txt deleted file mode 100644 index db41da1..0000000 --- a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPlanPythonInterface/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -add_lldb_library(lldbPluginScriptInterpreterPythonScriptedThreadPlanPythonInterface PLUGIN - - ScriptedThreadPlanPythonInterface.cpp - - LINK_LIBS - lldbCore - lldbHost - lldbInterpreter - lldbTarget - lldbPluginScriptInterpreterPython - ${Python3_LIBRARIES} - ${LLDB_LIBEDIT_LIBS} - - LINK_COMPONENTS - Support - ) diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPythonInterface.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPythonInterface.cpp index baf15f7..8af89d7 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPythonInterface.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPythonInterface.cpp @@ -6,14 +6,6 @@ // //===----------------------------------------------------------------------===// -#if LLDB_ENABLE_PYTHON - -// clang-format off -// LLDB Python header must be included first -#include "../../lldb-python.h" -//clang-format on -#endif - #include "lldb/Host/Config.h" #include "lldb/Target/ExecutionContext.h" #include "lldb/Utility/Log.h" @@ -21,6 +13,9 @@ #if LLDB_ENABLE_PYTHON +// LLDB Python header must be included first +#include "../lldb-python.h" + #include "../SWIGPythonBridge.h" #include "../ScriptInterpreterPythonImpl.h" #include "ScriptedThreadPythonInterface.h" diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPythonInterface.h b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPythonInterface.h index 7724f91..5676f7f 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPythonInterface.h +++ b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPythonInterface.h @@ -9,13 +9,6 @@ #ifndef LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDTHREADPYTHONINTERFACE_H #define LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDTHREADPYTHONINTERFACE_H -#if LLDB_ENABLE_PYTHON -// clang-format off -// LLDB Python header must be included first -#include "../lldb-python.h" -//clang-format on -#endif - #include "lldb/Host/Config.h" #if LLDB_ENABLE_PYTHON diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h index f5fb605..88c1bb7 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h +++ b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h @@ -48,17 +48,12 @@ #ifndef LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_PYTHONDATAOBJECTS_H #define LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_PYTHONDATAOBJECTS_H +#include "lldb/Host/Config.h" + #if LLDB_ENABLE_PYTHON -// clang-format off // LLDB Python header must be included first #include "lldb-python.h" -//clang-format on -#endif - -#include "lldb/Host/Config.h" - -#if LLDB_ENABLE_PYTHON #include "lldb/Host/File.h" #include "lldb/Utility/StructuredData.h" diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/SWIGPythonBridge.h b/lldb/source/Plugins/ScriptInterpreter/Python/SWIGPythonBridge.h index efe173a..3026b61 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/SWIGPythonBridge.h +++ b/lldb/source/Plugins/ScriptInterpreter/Python/SWIGPythonBridge.h @@ -9,21 +9,16 @@ #ifndef LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_SWIGPYTHONBRIDGE_H #define LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_SWIGPYTHONBRIDGE_H -#if LLDB_ENABLE_PYTHON - -// clang-format off -// LLDB Python header must be included first -#include "lldb-python.h" -//clang-format on -#endif - -#include "lldb/Host/Config.h" - #include <optional> #include <string> +#include "lldb/Host/Config.h" + #if LLDB_ENABLE_PYTHON +// LLDB Python header must be included first +#include "lldb-python.h" + #include "Plugins/ScriptInterpreter/Python/PythonDataObjects.h" #include "lldb/lldb-forward.h" #include "lldb/lldb-types.h" diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp index d056bbd..70fa6d8 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp @@ -6,23 +6,18 @@ // //===----------------------------------------------------------------------===// -#if LLDB_ENABLE_PYTHON - -// clang-format off -// LLDB Python header must be included first -#include "../../lldb-python.h" -//clang-format on -#endif - #include "lldb/Host/Config.h" #include "lldb/lldb-enumerations.h" #if LLDB_ENABLE_PYTHON -#include "Interfaces/OperatingSystemPythonInterface/OperatingSystemPythonInterface.h" -#include "Interfaces/ScriptedPlatformPythonInterface/ScriptedPlatformPythonInterface.h" -#include "Interfaces/ScriptedProcessPythonInterface/ScriptedProcessPythonInterface.h" -#include "Interfaces/ScriptedThreadPlanPythonInterface/ScriptedThreadPlanPythonInterface.h" +// LLDB Python header must be included first +#include "lldb-python.h" + +#include "Interfaces/OperatingSystemPythonInterface.h" +#include "Interfaces/ScriptedPlatformPythonInterface.h" +#include "Interfaces/ScriptedProcessPythonInterface.h" +#include "Interfaces/ScriptedThreadPlanPythonInterface.h" #include "Interfaces/ScriptedThreadPythonInterface.h" #include "PythonDataObjects.h" #include "PythonReadline.h" diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h index c54530e..2e8301a 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h +++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h @@ -9,14 +9,6 @@ #ifndef LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_SCRIPTINTERPRETERPYTHON_H #define LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_SCRIPTINTERPRETERPYTHON_H -#if LLDB_ENABLE_PYTHON - -// clang-format off -// LLDB Python header must be included first -#include "lldb-python.h" -//clang-format on -#endif - #include "lldb/Host/Config.h" #if LLDB_ENABLE_PYTHON diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h index 99d5b7a..c2024ef 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h +++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h @@ -9,18 +9,12 @@ #ifndef LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_SCRIPTINTERPRETERPYTHONIMPL_H #define LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_SCRIPTINTERPRETERPYTHONIMPL_H -#if LLDB_ENABLE_PYTHON - -// clang-format off -// LLDB Python header must be included first -#include "lldb-python.h" -//clang-format on -#endif - #include "lldb/Host/Config.h" #if LLDB_ENABLE_PYTHON +#include "lldb-python.h" + #include "PythonDataObjects.h" #include "ScriptInterpreterPython.h" |