aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/ScriptInterpreter/Python/ScriptedPythonInterface.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/ScriptedPythonInterface.cpp')
-rw-r--r--lldb/source/Plugins/ScriptInterpreter/Python/ScriptedPythonInterface.cpp31
1 files changed, 30 insertions, 1 deletions
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptedPythonInterface.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptedPythonInterface.cpp
index 789b39a..9da4623 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptedPythonInterface.cpp
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptedPythonInterface.cpp
@@ -15,7 +15,6 @@
// LLDB Python header must be included first
#include "lldb-python.h"
-#include "SWIGPythonBridge.h"
#include "ScriptInterpreterPythonImpl.h"
#include "ScriptedPythonInterface.h"
#include <optional>
@@ -72,6 +71,36 @@ ScriptedPythonInterface::ExtractValueFromPythonObject<lldb::DataExtractorSP>(
}
template <>
+lldb::ProcessAttachInfoSP ScriptedPythonInterface::ExtractValueFromPythonObject<
+ lldb::ProcessAttachInfoSP>(python::PythonObject &p, Status &error) {
+ lldb::SBAttachInfo *sb_attach_info = reinterpret_cast<lldb::SBAttachInfo *>(
+ LLDBSWIGPython_CastPyObjectToSBAttachInfo(p.get()));
+
+ if (!sb_attach_info) {
+ error.SetErrorString(
+ "Couldn't cast lldb::SBAttachInfo to lldb::ProcessAttachInfoSP.");
+ return nullptr;
+ }
+
+ return m_interpreter.GetOpaqueTypeFromSBAttachInfo(*sb_attach_info);
+}
+
+template <>
+lldb::ProcessLaunchInfoSP ScriptedPythonInterface::ExtractValueFromPythonObject<
+ lldb::ProcessLaunchInfoSP>(python::PythonObject &p, Status &error) {
+ lldb::SBLaunchInfo *sb_launch_info = reinterpret_cast<lldb::SBLaunchInfo *>(
+ LLDBSWIGPython_CastPyObjectToSBLaunchInfo(p.get()));
+
+ if (!sb_launch_info) {
+ error.SetErrorString(
+ "Couldn't cast lldb::SBLaunchInfo to lldb::ProcessLaunchInfoSP.");
+ return nullptr;
+ }
+
+ return m_interpreter.GetOpaqueTypeFromSBLaunchInfo(*sb_launch_info);
+}
+
+template <>
std::optional<MemoryRegionInfo>
ScriptedPythonInterface::ExtractValueFromPythonObject<
std::optional<MemoryRegionInfo>>(python::PythonObject &p, Status &error) {