aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp
diff options
context:
space:
mode:
authorMed Ismail Bennani <medismail.bennani@gmail.com>2023-02-03 12:28:47 -0800
committerMed Ismail Bennani <medismail.bennani@gmail.com>2023-02-03 12:29:01 -0800
commitc1928033047409f977b26ffc938d59188f1ced97 (patch)
treeca2d6248fb629ec8eff457ba992ad4e2447ed864 /lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp
parenta48c4a45e0c517bf1508b3c55cf1d4d875a92353 (diff)
downloadllvm-c1928033047409f977b26ffc938d59188f1ced97.zip
llvm-c1928033047409f977b26ffc938d59188f1ced97.tar.gz
llvm-c1928033047409f977b26ffc938d59188f1ced97.tar.bz2
[lldb] Add a way to get a scripted process implementation from the SBAPI
This patch introduces a new `GetScriptedImplementation` method to the SBProcess class in the SBAPI. It will allow users of Scripted Processes to fetch the scripted implementation object from to script interpreter to be able to interact with it directly (without having to go through lldb). This allows to user to perform action that are not specified in the scripted process interface, like calling un-specified methods, but also to enrich the implementation, by passing it complex objects. Differential Revision: https://reviews.llvm.org/D143236 Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
Diffstat (limited to 'lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp')
-rw-r--r--lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp b/lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp
index 58629a5..d7d87c7 100644
--- a/lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp
+++ b/lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp
@@ -512,3 +512,10 @@ void ScriptedProcess::UpdateQueueListIfNeeded() {
ScriptedProcessInterface &ScriptedProcess::GetInterface() const {
return m_interpreter->GetScriptedProcessInterface();
}
+
+void *ScriptedProcess::GetImplementation() {
+ if (m_script_object_sp &&
+ m_script_object_sp->GetType() == eStructuredDataTypeGeneric)
+ return m_script_object_sp->GetAsGeneric()->GetValue();
+ return nullptr;
+}