|
LLDB mainline
|
#include <ScriptedHookPythonInterface.h>
Public Member Functions | |
| ScriptedHookPythonInterface (ScriptInterpreterPythonImpl &interpreter) | |
| llvm::Expected< StructuredData::GenericSP > | CreatePluginObject (llvm::StringRef class_name, lldb::TargetSP target_sp, const StructuredDataImpl &args_sp) override |
| llvm::SmallVector< AbstractMethodRequirement > | GetAbstractMethodRequirements () const override |
| A hook class must implement at least one callback. | |
| SupportedHookMethods | GetSupportedMethods () override |
| Check which of the three hook methods the Python class implements. | |
| void | HandleModuleLoaded (lldb::StreamSP &output_sp) override |
| Called when modules are loaded into the target. | |
| void | HandleModuleUnloaded (lldb::StreamSP &output_sp) override |
| Called when modules are unloaded from the target. Optional. | |
| llvm::Expected< bool > | HandleStop (ExecutionContext &exe_ctx, lldb::StreamSP &output_sp) override |
| Called when the process stops. | |
| llvm::StringRef | GetPluginName () override |
| Public Member Functions inherited from lldb_private::ScriptedInterface | |
| ScriptedInterface ()=default | |
| virtual | ~ScriptedInterface ()=default |
| StructuredData::GenericSP | GetScriptObjectInstance () |
| llvm::SmallVector< llvm::StringLiteral > const | GetAbstractMethods () const |
| Public Member Functions inherited from lldb_private::ScriptedPythonInterface | |
| ScriptedPythonInterface (ScriptInterpreterPythonImpl &interpreter) | |
| ~ScriptedPythonInterface () override=default | |
| llvm::Expected< FileSpec > | GetScriptedModulePath () override |
| llvm::Expected< std::map< llvm::StringLiteral, AbstractMethodCheckerPayload > > | CheckAbstractMethodImplementation (const python::PythonDictionary &class_dict) const |
| template<typename... Args> | |
| llvm::Expected< StructuredData::GenericSP > | CreatePluginObject (llvm::StringRef class_name, StructuredData::Generic *script_obj, Args... args) |
| template<typename T = StructuredData::ObjectSP, typename... Args> | |
| T | CallStaticMethod (llvm::StringRef class_name, llvm::StringRef method_name, Status &error, Args &&...args) |
| Call a static method on a Python class without creating an instance. | |
| Public Member Functions inherited from lldb_private::PluginInterface | |
| PluginInterface ()=default | |
| virtual | ~PluginInterface ()=default |
| PluginInterface (const PluginInterface &)=delete | |
| PluginInterface & | operator= (const PluginInterface &)=delete |
Static Public Member Functions | |
| static void | Initialize () |
| static void | Terminate () |
| static llvm::StringRef | GetPluginNameStatic () |
| Static Public Member Functions inherited from lldb_private::ScriptedInterface | |
| template<typename Ret> | |
| static Ret | ErrorWithMessage (llvm::StringRef caller_name, llvm::StringRef error_msg, Status &error, LLDBLog log_category=LLDBLog::Process) |
| template<typename T = StructuredData::ObjectSP> | |
| static bool | CheckStructuredDataObject (llvm::StringRef caller, T obj, Status &error) |
| static bool | CreateInstance (lldb::ScriptLanguage language, ScriptedInterfaceUsages usages) |
Definition at line 17 of file ScriptedHookPythonInterface.h.
| ScriptedHookPythonInterface::ScriptedHookPythonInterface | ( | ScriptInterpreterPythonImpl & | interpreter | ) |
Definition at line 23 of file ScriptedHookPythonInterface.cpp.
References lldb_private::ScriptedPythonInterface::ScriptedPythonInterface().
|
overridevirtual |
Implements lldb_private::ScriptedHookInterface.
Definition at line 54 of file ScriptedHookPythonInterface.cpp.
References lldb_private::ScriptedPythonInterface::CreatePluginObject().
|
inlineoverridevirtual |
A hook class must implement at least one callback.
All three are individually optional; hooks that implement none will be rejected at creation time.
Implements lldb_private::ScriptedInterface.
Definition at line 31 of file ScriptedHookPythonInterface.h.
|
inlineoverridevirtual |
Implements lldb_private::PluginInterface.
Definition at line 50 of file ScriptedHookPythonInterface.h.
References GetPluginNameStatic().
|
inlinestatic |
Definition at line 46 of file ScriptedHookPythonInterface.h.
Referenced by GetPluginName(), and Initialize().
|
overridevirtual |
Check which of the three hook methods the Python class implements.
Reimplemented from lldb_private::ScriptedHookInterface.
Definition at line 28 of file ScriptedHookPythonInterface.cpp.
References lldb_private::ScriptInterpreterPythonImpl::Locker::AcquireLock, lldb_private::python::Borrowed, lldb_private::ScriptInterpreterPythonImpl::Locker::FreeLock, lldb_private::ScriptedHookInterface::SupportedHookMethods::handle_module_loaded, lldb_private::ScriptedHookInterface::SupportedHookMethods::handle_module_unloaded, lldb_private::ScriptedHookInterface::SupportedHookMethods::handle_stop, lldb_private::python::PythonObject::HasAttribute(), lldb_private::python::PythonObject::IsValid(), lldb_private::ScriptedPythonInterface::m_interpreter, lldb_private::ScriptedInterface::m_object_instance_sp, and lldb_private::ScriptInterpreterPythonImpl::Locker::NoSTDIN.
|
overridevirtual |
Called when modules are loaded into the target.
Reimplemented from lldb_private::ScriptedHookInterface.
Definition at line 61 of file ScriptedHookPythonInterface.cpp.
References lldb_private::ScriptedPythonInterface::Dispatch(), and error().
|
overridevirtual |
Called when modules are unloaded from the target. Optional.
Reimplemented from lldb_private::ScriptedHookInterface.
Definition at line 67 of file ScriptedHookPythonInterface.cpp.
References lldb_private::ScriptedPythonInterface::Dispatch(), and error().
|
overridevirtual |
Called when the process stops.
Returns "should_stop" if false, the process will continue. Defaults to true (stop on unimplemented).
Reimplemented from lldb_private::ScriptedHookInterface.
Definition at line 74 of file ScriptedHookPythonInterface.cpp.
References lldb_private::ScriptedInterface::CheckStructuredDataObject(), lldb_private::ScriptedPythonInterface::Dispatch(), and error().
|
static |
Definition at line 92 of file ScriptedHookPythonInterface.cpp.
References lldb_private::ScriptedInterface::CreateInstance(), lldb::eScriptLanguagePython, GetPluginNameStatic(), and lldb_private::PluginManager::RegisterPlugin().
Referenced by lldb_private::ScriptInterpreterPythonInterfaces::Initialize().
|
static |
Definition at line 103 of file ScriptedHookPythonInterface.cpp.
References lldb_private::ScriptedInterface::CreateInstance(), and lldb_private::PluginManager::UnregisterPlugin().
Referenced by lldb_private::ScriptInterpreterPythonInterfaces::Terminate().