10#include "lldb/Host/Config.h"
29using Locker = ScriptInterpreterPythonImpl::Locker;
31OperatingSystemPythonInterface::OperatingSystemPythonInterface(
32 ScriptInterpreterPythonImpl &interpreter)
35llvm::Expected<StructuredData::GenericSP>
36OperatingSystemPythonInterface::CreatePluginObject(
39 return ScriptedPythonInterface::CreatePluginObject(class_name,
nullptr,
44OperatingSystemPythonInterface::CreateThread(
lldb::tid_t tid,
48 "create_thread",
error, tid, context);
60 Dispatch<StructuredData::ArraySP>(
"get_thread_info",
error);
70 return ScriptedThreadPythonInterface::GetRegisterInfo();
73std::optional<std::string>
74OperatingSystemPythonInterface::GetRegisterContextForTID(
lldb::tid_t tid) {
82 return obj->GetAsString()->GetValue().str();
85std::optional<bool> OperatingSystemPythonInterface::DoesPluginReportAllThreads() {
92 return obj->GetAsBoolean()->GetValue();
95void OperatingSystemPythonInterface::Initialize() {
96 const std::vector<llvm::StringRef> ci_usages = {
97 "settings set target.process.python-os-plugin-path <script-path>",
98 "settings set process.experimental.os-plugin-reports-all-threads [0/1]"};
99 const std::vector<llvm::StringRef> api_usages = {};
101 GetPluginNameStatic(), llvm::StringRef(
"Mock thread state"),
105void OperatingSystemPythonInterface::Terminate() {
static llvm::raw_ostream & error(Stream &strm)
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
const lldb::ProcessSP & GetProcessSP() const
Get accessor to get the process shared pointer.
static bool RegisterPlugin(llvm::StringRef name, llvm::StringRef description, ABICreateInstance create_callback)
static bool UnregisterPlugin(ABICreateInstance create_callback)
static bool CheckStructuredDataObject(llvm::StringRef caller, T obj, Status &error)
std::shared_ptr< Dictionary > DictionarySP
std::shared_ptr< Object > ObjectSP
std::shared_ptr< Array > ArraySP
A class that represents a running process on the host machine.