9#include "lldb/Host/Config.h"
17#include "../lldb-python.h"
19#include "../SWIGPythonBridge.h"
20#include "../ScriptInterpreterPythonImpl.h"
26using Locker = ScriptInterpreterPythonImpl::Locker;
28ScriptedPlatformPythonInterface::ScriptedPlatformPythonInterface(
29 ScriptInterpreterPythonImpl &interpreter)
32llvm::Expected<StructuredData::GenericSP>
33ScriptedPlatformPythonInterface::CreatePluginObject(
37 std::make_shared<ExecutionContextRef>(exe_ctx);
39 return ScriptedPythonInterface::CreatePluginObject(class_name, script_obj,
40 exe_ctx_ref_sp, sd_impl);
46 Dispatch<StructuredData::DictionarySP>(
"list_processes",
error);
48 if (!dict_sp || !dict_sp->IsValid() ||
error.Fail()) {
49 return ScriptedInterface::ErrorWithMessage<StructuredData::DictionarySP>(
51 llvm::Twine(
"Null or invalid object (" +
52 llvm::Twine(
error.AsCString()) + llvm::Twine(
")."))
61ScriptedPlatformPythonInterface::GetProcessInfo(
lldb::pid_t pid) {
64 Dispatch<StructuredData::DictionarySP>(
"get_process_info",
error, pid);
66 if (!dict_sp || !dict_sp->IsValid() ||
error.Fail()) {
67 return ScriptedInterface::ErrorWithMessage<StructuredData::DictionarySP>(
69 llvm::Twine(
"Null or invalid object (" +
70 llvm::Twine(
error.AsCString()) + llvm::Twine(
")."))
78Status ScriptedPlatformPythonInterface::AttachToProcess(
81 return GetStatusFromMethod(
"attach_to_process");
84Status ScriptedPlatformPythonInterface::LaunchProcess(
87 return GetStatusFromMethod(
"launch_process");
91 return GetStatusFromMethod(
"kill_process", pid);
static llvm::raw_ostream & error(Stream &strm)
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
std::shared_ptr< Dictionary > DictionarySP
A class that represents a running process on the host machine.
std::shared_ptr< lldb_private::ProcessAttachInfo > ProcessAttachInfoSP
std::shared_ptr< lldb_private::ProcessLaunchInfo > ProcessLaunchInfoSP
std::shared_ptr< lldb_private::ExecutionContextRef > ExecutionContextRefSP