9#include "lldb/Host/Config.h"
17#include "../lldb-python.h"
19#include "../SWIGPythonBridge.h"
20#include "../ScriptInterpreterPythonImpl.h"
27using Locker = ScriptInterpreterPythonImpl::Locker;
29ScriptedThreadPythonInterface::ScriptedThreadPythonInterface(
30 ScriptInterpreterPythonImpl &interpreter)
33llvm::Expected<StructuredData::GenericSP>
34ScriptedThreadPythonInterface::CreatePluginObject(
38 std::make_shared<ExecutionContextRef>(exe_ctx);
40 return ScriptedPythonInterface::CreatePluginObject(class_name, script_obj,
41 exe_ctx_ref_sp, sd_impl);
44lldb::tid_t ScriptedThreadPythonInterface::GetThreadID() {
48 if (!ScriptedInterface::CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj,
55std::optional<std::string> ScriptedThreadPythonInterface::GetName() {
59 if (!ScriptedInterface::CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj,
63 return obj->GetStringValue().str();
70 if (!ScriptedInterface::CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj,
74 return static_cast<StateType>(obj->GetUnsignedIntegerValue(eStateInvalid));
77std::optional<std::string> ScriptedThreadPythonInterface::GetQueue() {
81 if (!ScriptedInterface::CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj,
85 return obj->GetStringValue().str();
91 Dispatch<StructuredData::DictionarySP>(
"get_stop_reason",
error);
93 if (!ScriptedInterface::CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, dict,
103 Dispatch<StructuredData::ArraySP>(
"get_stackframes",
error);
105 if (!ScriptedInterface::CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, arr,
115 Dispatch<StructuredData::DictionarySP>(
"get_register_info",
error);
117 if (!ScriptedInterface::CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, dict,
124std::optional<std::string> ScriptedThreadPythonInterface::GetRegisterContext() {
128 if (!ScriptedInterface::CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj,
132 return obj->GetAsString()->GetValue().str();
138 Dispatch<StructuredData::ArraySP>(
"get_extended_info",
error);
140 if (!ScriptedInterface::CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, arr,
static llvm::raw_ostream & error(Stream &strm)
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
std::shared_ptr< Dictionary > DictionarySP
std::shared_ptr< Object > ObjectSP
std::shared_ptr< Array > ArraySP
#define LLDB_INVALID_THREAD_ID
A class that represents a running process on the host machine.
StateType
Process and Thread States.
std::shared_ptr< lldb_private::ExecutionContextRef > ExecutionContextRefSP