diff options
author | Med Ismail Bennani <medismail.bennani@gmail.com> | 2021-10-06 00:09:20 +0000 |
---|---|---|
committer | Med Ismail Bennani <medismail.bennani@gmail.com> | 2021-10-08 14:54:07 +0200 |
commit | 59d8dd79e1f9dead2dc2756e139073083e487228 (patch) | |
tree | 4f45c1452f97e10655c8e69549ab146ee93d0d2c /lldb/source/Plugins/ScriptInterpreter/Python/ScriptedPythonInterface.cpp | |
parent | 6393c21d476de2584b3ac010aace6a9b26d5bbec (diff) | |
download | llvm-59d8dd79e1f9dead2dc2756e139073083e487228.zip llvm-59d8dd79e1f9dead2dc2756e139073083e487228.tar.gz llvm-59d8dd79e1f9dead2dc2756e139073083e487228.tar.bz2 |
[lldb/Plugins] Add support for ScriptedThread in ScriptedProcess
This patch introduces the `ScriptedThread` class with its python
interface.
When used with `ScriptedProcess`, `ScriptedThreaad` can provide various
information such as the thread state, stop reason or even its register
context.
This can be used to reconstruct the program stack frames using lldb's unwinder.
rdar://74503836
Differential Revision: https://reviews.llvm.org/D107585
Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/ScriptedPythonInterface.cpp')
-rw-r--r-- | lldb/source/Plugins/ScriptInterpreter/Python/ScriptedPythonInterface.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptedPythonInterface.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptedPythonInterface.cpp index a38cb10..e8fb38e 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptedPythonInterface.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptedPythonInterface.cpp @@ -36,6 +36,14 @@ ScriptedPythonInterface::GetStatusFromMethod(llvm::StringRef method_name) { } template <> +StructuredData::DictionarySP +ScriptedPythonInterface::ExtractValueFromPythonObject< + StructuredData::DictionarySP>(python::PythonObject &p, Status &error) { + python::PythonDictionary result_dict(python::PyRefType::Borrowed, p.get()); + return result_dict.CreateStructuredDictionary(); +} + +template <> Status ScriptedPythonInterface::ExtractValueFromPythonObject<Status>( python::PythonObject &p, Status &error) { if (lldb::SBError *sb_error = reinterpret_cast<lldb::SBError *>( |