33llvm::Expected<StructuredData::GenericSP>
38 std::make_shared<ExecutionContextRef>(exe_ctx);
40 scripted_metadata, script_obj, exe_ctx_ref_sp,
47 LLVM_PRETTY_FUNCTION);
57 std::make_shared<ProcessAttachInfo>(attach_info);
70std::optional<MemoryRegionInfo>
73 llvm::Expected<std::optional<MemoryRegionInfo>> mem_region_or_err =
75 "get_memory_region_containing_address", address);
76 if (!mem_region_or_err) {
81 return *mem_region_or_err;
87 LLVM_PRETTY_FUNCTION);
96 llvm::Expected<StructuredData::ObjectSP> obj_or_err =
105 if (!obj || !obj->IsValid())
108 return obj->GetBooleanValue();
113 llvm::Expected<lldb::DataExtractorSP> data_or_err =
127 llvm::Expected<StructuredData::ObjectSP> obj_or_err =
136 if (!obj || !obj->IsValid())
145 LLVM_PRETTY_FUNCTION);
167 return obj->GetBooleanValue();
170std::optional<std::string>
173 Dispatch(
"get_scripted_thread_plugin"), LLVM_PRETTY_FUNCTION);
177 return obj->GetStringValue().str();
188 LLVM_PRETTY_FUNCTION);
196 const std::vector<llvm::StringRef> ci_usages = {
197 "process attach -C <script-name> [-k key -v value ...]",
198 "process launch -C <script-name> [-k key -v value ...]"};
199 const std::vector<llvm::StringRef> api_usages = {
200 "SBAttachInfo.SetScriptedProcessClassName",
201 "SBAttachInfo.SetScriptedProcessDictionary",
203 "SBLaunchInfo.SetScriptedProcessClassName",
204 "SBLaunchInfo.SetScriptedProcessDictionary",
209 {ci_usages, api_usages});
static llvm::raw_ostream & error(Stream &strm)
ScriptInterpreterPythonImpl::Locker Locker
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
static bool RegisterPlugin(llvm::StringRef name, llvm::StringRef description, ABICreateInstance create_callback)
static bool UnregisterPlugin(ABICreateInstance create_callback)
static bool CreateInstance(lldb::ScriptLanguage language, ScriptedInterfaceUsages usages)
StructuredData::DictionarySP GetThreadsInfo() override
lldb::ScriptedThreadInterfaceSP CreateScriptedThreadInterface() override
StructuredData::DictionarySP GetMetadata() override
lldb::DataExtractorSP ReadMemoryAtAddress(lldb::addr_t address, size_t size, Status &error) override
StructuredData::ArraySP GetLoadedImages() override
std::optional< std::string > GetScriptedThreadPluginName() override
llvm::Expected< StructuredData::GenericSP > CreatePluginObject(const ScriptedMetadata &scripted_metadata, ExecutionContext &exe_ctx, StructuredData::Generic *script_obj=nullptr) override
bool CreateBreakpoint(lldb::addr_t addr, Status &error) override
Status Attach(const ProcessAttachInfo &attach_info) override
std::optional< MemoryRegionInfo > GetMemoryRegionContainingAddress(lldb::addr_t address, Status &error) override
static llvm::StringRef GetPluginNameStatic()
lldb::pid_t GetProcessID() override
lldb::offset_t WriteMemoryAtAddress(lldb::addr_t addr, lldb::DataExtractorSP data_sp, Status &error) override
ScriptedProcessPythonInterface(ScriptInterpreterPythonImpl &interpreter)
StructuredData::DictionarySP GetCapabilities() override
Status GetStatusFromMethod(llvm::StringRef method_name, Args &&...args)
Call method_name and fold both failure channels into one Status: a failure to call the method at all,...
ScriptInterpreterPythonImpl & m_interpreter
static T LogAndDefault(llvm::Expected< T > value_or_err, llvm::StringRef caller)
Log the failure in value_or_err and fall back to a default-constructed T.
ScriptedPythonInterface(ScriptInterpreterPythonImpl &interpreter)
llvm::Expected< T > Dispatch(llvm::StringRef method_name, Args &&...args)
Call method_name on the scripted object.
llvm::Expected< StructuredData::GenericSP > CreatePluginObject(const ScriptedMetadata &scripted_metadata, StructuredData::Generic *script_obj, Args... args)
static Status FromError(llvm::Error error)
Avoid using this in new code. Migrate APIs to llvm::Expected instead.
std::shared_ptr< Dictionary > DictionarySP
std::shared_ptr< Object > ObjectSP
std::shared_ptr< Array > ArraySP
#define LLDB_INVALID_OFFSET
#define LLDB_INVALID_PROCESS_ID
A class that represents a running process on the host machine.
@ eScriptedExtensionScriptedProcess
std::shared_ptr< lldb_private::ProcessAttachInfo > ProcessAttachInfoSP
std::shared_ptr< lldb_private::ScriptedThreadInterface > ScriptedThreadInterfaceSP
std::shared_ptr< lldb_private::DataExtractor > DataExtractorSP
std::shared_ptr< lldb_private::ExecutionContextRef > ExecutionContextRefSP