aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/ScriptInterpreter/Python
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python')
-rw-r--r--lldb/source/Plugins/ScriptInterpreter/Python/SWIGPythonBridge.h5
-rw-r--r--lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp8
-rw-r--r--lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h3
3 files changed, 14 insertions, 2 deletions
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/SWIGPythonBridge.h b/lldb/source/Plugins/ScriptInterpreter/Python/SWIGPythonBridge.h
index a2252d1..504b3aa 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/SWIGPythonBridge.h
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/SWIGPythonBridge.h
@@ -215,6 +215,11 @@ public:
const char *session_dictionary_name,
lldb::DebuggerSP debugger);
+ static bool
+ LLDBSwigPythonCallModuleNewTarget(const char *python_module_name,
+ const char *session_dictionary_name,
+ lldb::TargetSP target);
+
static python::PythonObject
LLDBSWIGPythonCreateOSPlugin(const char *python_class_name,
const char *session_dictionary_name,
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
index 4b7694d..a9c8127 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
@@ -2316,7 +2316,7 @@ uint64_t replace_all(std::string &str, const std::string &oldStr,
bool ScriptInterpreterPythonImpl::LoadScriptingModule(
const char *pathname, const LoadScriptOptions &options,
lldb_private::Status &error, StructuredData::ObjectSP *module_sp,
- FileSpec extra_search_dir) {
+ FileSpec extra_search_dir, lldb::TargetSP target_sp) {
namespace fs = llvm::sys::fs;
namespace path = llvm::sys::path;
@@ -2495,6 +2495,12 @@ bool ScriptInterpreterPythonImpl::LoadScriptingModule(
PyRefType::Owned, static_cast<PyObject *>(module_pyobj)));
}
+ // Finally, if we got a target passed in, then we should tell the new module
+ // about this target:
+ if (target_sp)
+ return SWIGBridge::LLDBSwigPythonCallModuleNewTarget(
+ module_name.c_str(), m_dictionary_name.c_str(), target_sp);
+
return true;
}
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h
index 2dc7847..0f290281 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h
@@ -245,7 +245,8 @@ public:
const LoadScriptOptions &options,
lldb_private::Status &error,
StructuredData::ObjectSP *module_sp = nullptr,
- FileSpec extra_search_dir = {}) override;
+ FileSpec extra_search_dir = {},
+ lldb::TargetSP loaded_into_target_sp = {}) override;
bool IsReservedWord(const char *word) override;