53llvm::Expected<StructuredData::GenericSP>
77 std::make_shared<ExecutionContextRef>(exe_ctx);
86 return error.ToError();
89 return obj->GetBooleanValue();
93 const std::vector<llvm::StringRef> ci_usages = {
94 "target hook add -P <script-name> [-k key -v value ...]"};
95 const std::vector<llvm::StringRef> api_usages = {};
98 llvm::StringRef(
"Perform actions on target lifecycle events (module "
99 "load/unload, process stop)."),
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)
SupportedHookMethods GetSupportedMethods() override
Check which of the three hook methods the Python class implements.
void HandleModuleUnloaded(lldb::StreamSP &output_sp) override
Called when modules are unloaded from the target. Optional.
static llvm::StringRef GetPluginNameStatic()
void HandleModuleLoaded(lldb::StreamSP &output_sp) override
Called when modules are loaded into the target.
llvm::Expected< bool > HandleStop(ExecutionContext &exe_ctx, lldb::StreamSP &output_sp) override
Called when the process stops.
ScriptedHookPythonInterface(ScriptInterpreterPythonImpl &interpreter)
llvm::Expected< StructuredData::GenericSP > CreatePluginObject(llvm::StringRef class_name, lldb::TargetSP target_sp, const StructuredDataImpl &args_sp) override
static bool CheckStructuredDataObject(llvm::StringRef caller, T obj, Status &error)
static bool CreateInstance(lldb::ScriptLanguage language, ScriptedInterfaceUsages usages)
StructuredData::GenericSP m_object_instance_sp
llvm::Expected< StructuredData::GenericSP > CreatePluginObject(llvm::StringRef class_name, StructuredData::Generic *script_obj, Args... args)
ScriptInterpreterPythonImpl & m_interpreter
ScriptedPythonInterface(ScriptInterpreterPythonImpl &interpreter)
T Dispatch(llvm::StringRef method_name, Status &error, Args &&...args)
std::shared_ptr< Object > ObjectSP
bool HasAttribute(llvm::StringRef attribute) const
A class that represents a running process on the host machine.
std::shared_ptr< lldb_private::Stream > StreamSP
std::shared_ptr< lldb_private::Target > TargetSP
std::shared_ptr< lldb_private::ExecutionContextRef > ExecutionContextRefSP
Describes which hook callback methods the Python class implements.
bool handle_module_unloaded
bool handle_module_loaded