|
LLDB mainline
|
#include <ScriptedPythonInterface.h>
Classes | |
| struct | AbstractMethodCheckerPayload |
Public Types | |
| enum class | AbstractMethodCheckerCases { eNotImplemented , eNotAllocated , eNotCallable , eUnknownArgumentCount , eInvalidArgumentCount , eValid } |
Public Member Functions | |
| 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::ScriptedInterface | |
| ScriptedInterface ()=default | |
| virtual | ~ScriptedInterface ()=default |
| StructuredData::GenericSP | GetScriptObjectInstance () |
| virtual llvm::SmallVector< AbstractMethodRequirement > | GetAbstractMethodRequirements () const =0 |
| llvm::SmallVector< llvm::StringLiteral > const | GetAbstractMethods () const |
Protected Attributes | |
| ScriptInterpreterPythonImpl & | m_interpreter |
| Protected Attributes inherited from lldb_private::ScriptedInterface | |
| StructuredData::GenericSP | m_object_instance_sp |
Additional Inherited Members | |
| 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 27 of file ScriptedPythonInterface.h.
|
strong |
| Enumerator | |
|---|---|
| eNotImplemented | |
| eNotAllocated | |
| eNotCallable | |
| eUnknownArgumentCount | |
| eInvalidArgumentCount | |
| eValid | |
Definition at line 32 of file ScriptedPythonInterface.h.
| ScriptedPythonInterface::ScriptedPythonInterface | ( | ScriptInterpreterPythonImpl & | interpreter | ) |
Definition at line 25 of file ScriptedPythonInterface.cpp.
References m_interpreter, and lldb_private::ScriptedInterface::ScriptedInterface().
Referenced by lldb_private::ScriptedBreakpointPythonInterface::ScriptedBreakpointPythonInterface(), lldb_private::ScriptedFrameProviderPythonInterface::ScriptedFrameProviderPythonInterface(), lldb_private::ScriptedFramePythonInterface::ScriptedFramePythonInterface(), lldb_private::ScriptedPlatformPythonInterface::ScriptedPlatformPythonInterface(), lldb_private::ScriptedProcessPythonInterface::ScriptedProcessPythonInterface(), lldb_private::ScriptedStopHookPythonInterface::ScriptedStopHookPythonInterface(), lldb_private::ScriptedThreadPlanPythonInterface::ScriptedThreadPlanPythonInterface(), and lldb_private::ScriptedThreadPythonInterface::ScriptedThreadPythonInterface().
|
overridedefault |
|
inline |
Call a static method on a Python class without creating an instance.
This method resolves a Python class by name and calls a static method on it, returning the result. This is useful for calling class-level methods that don't require an instance.
| class_name | The fully-qualified name of the Python class. |
| method_name | The name of the static method to call. |
| error | Output parameter to receive error information if the call fails. |
| args | Arguments to pass to the static method. |
Definition at line 401 of file ScriptedPythonInterface.h.
References lldb_private::ScriptInterpreterPythonImpl::Locker::AcquireLock, error(), lldb_private::ScriptedInterface::ErrorWithMessage(), ExtractValueFromPythonObject(), lldb_private::ScriptInterpreterPythonImpl::Locker::FreeLock, lldb_private::Status::FromError(), m_interpreter, lldb_private::ScriptInterpreterPythonImpl::Locker::NoSTDIN, ReassignPtrsOrRefsArgs(), and TransformArgs().
Referenced by lldb_private::ScriptedFrameProviderPythonInterface::AppliesToThread(), lldb_private::ScriptedFrameProviderPythonInterface::GetDescription(), and lldb_private::ScriptedFrameProviderPythonInterface::GetPriority().
|
inline |
Definition at line 112 of file ScriptedPythonInterface.h.
References eInvalidArgumentCount, eNotAllocated, eNotCallable, eNotImplemented, eUnknownArgumentCount, eValid, lldb_private::ScriptedInterface::GetAbstractMethodRequirements(), lldb_private::python::PythonDictionary::GetItem(), lldb_private::python::PythonDictionary::HasKey(), and SET_CASE_AND_CONTINUE.
Referenced by CreatePluginObject().
|
inline |
Definition at line 171 of file ScriptedPythonInterface.h.
References lldb_private::ScriptInterpreterPythonImpl::Locker::AcquireLock, CheckAbstractMethodImplementation(), eInvalidArgumentCount, eNotAllocated, eNotCallable, eNotImplemented, error(), eUnknownArgumentCount, eValid, lldb_private::ScriptInterpreterPythonImpl::Locker::FreeLock, lldb_private::Status::FromError(), lldb_private::GetLog(), lldb_private::StructuredData::Generic::GetValue(), LLDB_LOG, m_interpreter, lldb_private::ScriptedInterface::m_object_instance_sp, lldb_private::ScriptInterpreterPythonImpl::Locker::NoSTDIN, lldb_private::Script, and TransformArgs().
Referenced by lldb_private::OperatingSystemPythonInterface::CreatePluginObject(), lldb_private::ScriptedBreakpointPythonInterface::CreatePluginObject(), lldb_private::ScriptedFrameProviderPythonInterface::CreatePluginObject(), lldb_private::ScriptedFramePythonInterface::CreatePluginObject(), lldb_private::ScriptedPlatformPythonInterface::CreatePluginObject(), lldb_private::ScriptedProcessPythonInterface::CreatePluginObject(), lldb_private::ScriptedStopHookPythonInterface::CreatePluginObject(), lldb_private::ScriptedThreadPlanPythonInterface::CreatePluginObject(), and lldb_private::ScriptedThreadPythonInterface::CreatePluginObject().
|
inlineprotected |
Definition at line 500 of file ScriptedPythonInterface.h.
References lldb_private::ScriptInterpreterPythonImpl::Locker::AcquireLock, error(), lldb_private::ScriptedInterface::ErrorWithMessage(), ExtractValueFromPythonObject(), lldb_private::ScriptInterpreterPythonImpl::Locker::FreeLock, lldb_private::Status::FromError(), lldb_private::ScriptedInterface::GetAbstractMethods(), m_interpreter, lldb_private::ScriptedInterface::m_object_instance_sp, lldb_private::ScriptInterpreterPythonImpl::Locker::NoSTDIN, ReassignPtrsOrRefsArgs(), and TransformArgs().
Referenced by lldb_private::ScriptedProcessPythonInterface::CreateBreakpoint(), lldb_private::OperatingSystemPythonInterface::CreateThread(), lldb_private::OperatingSystemPythonInterface::DoesPluginReportAllThreads(), lldb_private::ScriptedThreadPlanPythonInterface::ExplainsStop(), lldb_private::ScriptedProcessPythonInterface::GetCapabilities(), lldb_private::ScriptedBreakpointPythonInterface::GetDepth(), lldb_private::ScriptedFramePythonInterface::GetDisplayFunctionName(), lldb_private::ScriptedThreadPythonInterface::GetExtendedInfo(), lldb_private::ScriptedFrameProviderPythonInterface::GetFrameAtIndex(), lldb_private::ScriptedFramePythonInterface::GetFunctionName(), lldb_private::ScriptedFramePythonInterface::GetID(), lldb_private::ScriptedProcessPythonInterface::GetLoadedImages(), lldb_private::ScriptedBreakpointPythonInterface::GetLocationDescription(), lldb_private::ScriptedProcessPythonInterface::GetMemoryRegionContainingAddress(), lldb_private::ScriptedProcessPythonInterface::GetMetadata(), lldb_private::ScriptedThreadPythonInterface::GetName(), lldb_private::ScriptedFramePythonInterface::GetPC(), lldb_private::ScriptedProcessPythonInterface::GetProcessID(), lldb_private::ScriptedPlatformPythonInterface::GetProcessInfo(), lldb_private::ScriptedThreadPythonInterface::GetQueue(), lldb_private::ScriptedFramePythonInterface::GetRegisterContext(), lldb_private::ScriptedThreadPythonInterface::GetRegisterContext(), lldb_private::OperatingSystemPythonInterface::GetRegisterContextForTID(), lldb_private::ScriptedFramePythonInterface::GetRegisterInfo(), lldb_private::ScriptedThreadPythonInterface::GetRegisterInfo(), lldb_private::ScriptedThreadPlanPythonInterface::GetRunState(), lldb_private::ScriptedThreadPythonInterface::GetScriptedFramePluginName(), lldb_private::ScriptedProcessPythonInterface::GetScriptedThreadPluginName(), lldb_private::ScriptedBreakpointPythonInterface::GetShortHelp(), lldb_private::ScriptedThreadPythonInterface::GetStackFrames(), lldb_private::ScriptedThreadPythonInterface::GetState(), GetStatusFromMethod(), lldb_private::ScriptedThreadPlanPythonInterface::GetStopDescription(), lldb_private::ScriptedThreadPythonInterface::GetStopReason(), lldb_private::ScriptedFramePythonInterface::GetSymbolContext(), lldb_private::ScriptedThreadPythonInterface::GetThreadID(), lldb_private::OperatingSystemPythonInterface::GetThreadInfo(), lldb_private::ScriptedProcessPythonInterface::GetThreadsInfo(), lldb_private::ScriptedFramePythonInterface::GetValueObjectForVariableExpression(), lldb_private::ScriptedFramePythonInterface::GetVariables(), lldb_private::ScriptedStopHookPythonInterface::HandleStop(), lldb_private::ScriptedProcessPythonInterface::IsAlive(), lldb_private::ScriptedFramePythonInterface::IsArtificial(), lldb_private::ScriptedFramePythonInterface::IsHidden(), lldb_private::ScriptedFramePythonInterface::IsInlined(), lldb_private::ScriptedThreadPlanPythonInterface::IsStale(), lldb_private::ScriptedPlatformPythonInterface::ListProcesses(), lldb_private::ScriptedProcessPythonInterface::ReadMemoryAtAddress(), lldb_private::ScriptedBreakpointPythonInterface::ResolverCallback(), lldb_private::ScriptedThreadPlanPythonInterface::ShouldStop(), lldb_private::ScriptedBreakpointPythonInterface::WasHit(), and lldb_private::ScriptedProcessPythonInterface::WriteMemoryAtAddress().
|
protected |
Definition at line 46 of file ScriptedPythonInterface.cpp.
References error(), lldb_private::Status::FromErrorString(), lldb_private::python::PythonObject::get(), lldb_private::python::LLDBSWIGPython_CastPyObjectToSBError(), and m_interpreter.
|
protected |
Definition at line 58 of file ScriptedPythonInterface.cpp.
References error(), lldb_private::Status::FromErrorString(), lldb_private::python::PythonObject::get(), lldb_private::python::LLDBSWIGPython_CastPyObjectToSBEvent(), and m_interpreter.
|
protected |
Definition at line 109 of file ScriptedPythonInterface.cpp.
References error(), lldb_private::Status::FromErrorString(), lldb_private::python::PythonObject::get(), lldb_private::python::LLDBSWIGPython_CastPyObjectToSBSymbolContext(), and m_interpreter.
|
inlineprotected |
Definition at line 495 of file ScriptedPythonInterface.h.
References lldb_private::python::PythonObject::CreateStructuredObject(), and error().
Referenced by CallStaticMethod(), Dispatch(), ReverseTransform(), ScriptedPythonInterface::ExtractValueFromPythonObject< lldb::BreakpointLocationSP >(), lldb_private::ScriptedPythonInterface::ExtractValueFromPythonObject< lldb::BreakpointLocationSP >(), ScriptedPythonInterface::ExtractValueFromPythonObject< lldb::BreakpointSP >(), lldb_private::ScriptedPythonInterface::ExtractValueFromPythonObject< lldb::BreakpointSP >(), ScriptedPythonInterface::ExtractValueFromPythonObject< lldb::DataExtractorSP >(), lldb_private::ScriptedPythonInterface::ExtractValueFromPythonObject< lldb::DataExtractorSP >(), ScriptedPythonInterface::ExtractValueFromPythonObject< lldb::DescriptionLevel >(), lldb_private::ScriptedPythonInterface::ExtractValueFromPythonObject< lldb::DescriptionLevel >(), ScriptedPythonInterface::ExtractValueFromPythonObject< lldb::ExecutionContextRefSP >(), lldb_private::ScriptedPythonInterface::ExtractValueFromPythonObject< lldb::ExecutionContextRefSP >(), ScriptedPythonInterface::ExtractValueFromPythonObject< lldb::ProcessAttachInfoSP >(), lldb_private::ScriptedPythonInterface::ExtractValueFromPythonObject< lldb::ProcessAttachInfoSP >(), ScriptedPythonInterface::ExtractValueFromPythonObject< lldb::ProcessLaunchInfoSP >(), lldb_private::ScriptedPythonInterface::ExtractValueFromPythonObject< lldb::ProcessLaunchInfoSP >(), ScriptedPythonInterface::ExtractValueFromPythonObject< lldb::StackFrameListSP >(), lldb_private::ScriptedPythonInterface::ExtractValueFromPythonObject< lldb::StackFrameListSP >(), ScriptedPythonInterface::ExtractValueFromPythonObject< lldb::StackFrameSP >(), lldb_private::ScriptedPythonInterface::ExtractValueFromPythonObject< lldb::StackFrameSP >(), ScriptedPythonInterface::ExtractValueFromPythonObject< lldb::StreamSP >(), lldb_private::ScriptedPythonInterface::ExtractValueFromPythonObject< lldb::StreamSP >(), ScriptedPythonInterface::ExtractValueFromPythonObject< lldb::ThreadSP >(), lldb_private::ScriptedPythonInterface::ExtractValueFromPythonObject< lldb::ThreadSP >(), ScriptedPythonInterface::ExtractValueFromPythonObject< lldb::ValueObjectListSP >(), lldb_private::ScriptedPythonInterface::ExtractValueFromPythonObject< lldb::ValueObjectListSP >(), ScriptedPythonInterface::ExtractValueFromPythonObject< lldb::ValueObjectSP >(), lldb_private::ScriptedPythonInterface::ExtractValueFromPythonObject< lldb::ValueObjectSP >(), ScriptedPythonInterface::ExtractValueFromPythonObject< StructuredData::ArraySP >(), lldb_private::ScriptedPythonInterface::ExtractValueFromPythonObject< StructuredData::ArraySP >(), ScriptedPythonInterface::ExtractValueFromPythonObject< StructuredData::DictionarySP >(), and lldb_private::ScriptedPythonInterface::ExtractValueFromPythonObject< StructuredData::DictionarySP >().
|
protected |
References error().
|
protected |
References error().
|
protected |
References error().
|
inlineprotected |
Definition at line 731 of file ScriptedPythonInterface.h.
|
inlineprotected |
Definition at line 727 of file ScriptedPythonInterface.h.
|
inlineprotected |
Definition at line 722 of file ScriptedPythonInterface.h.
References FormatArgs().
Referenced by FormatArgs().
|
inlineoverridevirtual |
Reimplemented from lldb_private::ScriptedInterface.
Definition at line 55 of file ScriptedPythonInterface.h.
References lldb_private::ScriptInterpreterPythonImpl::Locker::AcquireLock, lldb_private::ScriptInterpreterPythonImpl::Locker::FreeLock, m_interpreter, lldb_private::ScriptedInterface::m_object_instance_sp, and lldb_private::ScriptInterpreterPythonImpl::Locker::NoSTDIN.
|
inlineprotected |
Definition at line 563 of file ScriptedPythonInterface.h.
References Dispatch(), and error().
Referenced by lldb_private::ScriptedProcessPythonInterface::Attach(), lldb_private::ScriptedPlatformPythonInterface::AttachToProcess(), lldb_private::ScriptedPlatformPythonInterface::KillProcess(), lldb_private::ScriptedProcessPythonInterface::Launch(), lldb_private::ScriptedPlatformPythonInterface::LaunchProcess(), and lldb_private::ScriptedProcessPythonInterface::Resume().
|
inlineprotected |
Definition at line 712 of file ScriptedPythonInterface.h.
References ReassignPtrsOrRefsArgs().
|
inlineprotected |
Definition at line 701 of file ScriptedPythonInterface.h.
References error(), and TransformBack().
Referenced by CallStaticMethod(), Dispatch(), and ReassignPtrsOrRefsArgs().
|
inlineprotected |
Definition at line 671 of file ScriptedPythonInterface.h.
References lldb_private::python::Borrowed, error(), lldb_private::Status::FromErrorStringWithFormatv(), lldb_private::python::PythonObject::get(), lldb_private::python::PythonBoolean::GetValue(), and lldb_private::python::PythonObject::IsValid().
|
inlineprotected |
Definition at line 666 of file ScriptedPythonInterface.h.
References error(), and ExtractValueFromPythonObject().
|
inlineprotected |
Definition at line 661 of file ScriptedPythonInterface.h.
References error().
Referenced by TransformBack().
|
inlineprotected |
Definition at line 575 of file ScriptedPythonInterface.h.
|
inlineprotected |
Definition at line 580 of file ScriptedPythonInterface.h.
References lldb_private::Status::Clone(), and lldb_private::python::SWIGBridge::ToSWIGWrapper().
|
inlineprotected |
Definition at line 588 of file ScriptedPythonInterface.h.
References lldb_private::python::SWIGBridge::ToSWIGWrapper().
|
inlineprotected |
Definition at line 636 of file ScriptedPythonInterface.h.
References lldb_private::python::SWIGBridge::ToSWIGWrapper().
|
inlineprotected |
Definition at line 632 of file ScriptedPythonInterface.h.
References lldb_private::python::SWIGBridge::ToSWIGWrapper().
|
inlineprotected |
Definition at line 604 of file ScriptedPythonInterface.h.
References lldb_private::python::SWIGBridge::ToSWIGWrapper().
|
inlineprotected |
Definition at line 600 of file ScriptedPythonInterface.h.
References lldb_private::python::SWIGBridge::ToSWIGWrapper().
|
inlineprotected |
Definition at line 648 of file ScriptedPythonInterface.h.
References lldb_private::python::SWIGBridge::ToSWIGWrapper().
|
inlineprotected |
Definition at line 652 of file ScriptedPythonInterface.h.
References lldb_private::python::SWIGBridge::ToSWIGWrapper().
|
inlineprotected |
Definition at line 592 of file ScriptedPythonInterface.h.
References lldb_private::python::SWIGBridge::ToSWIGWrapper().
|
inlineprotected |
Definition at line 624 of file ScriptedPythonInterface.h.
References lldb_private::python::SWIGBridge::ToSWIGWrapper().
|
inlineprotected |
Definition at line 628 of file ScriptedPythonInterface.h.
References lldb_private::python::SWIGBridge::ToSWIGWrapper().
|
inlineprotected |
Definition at line 608 of file ScriptedPythonInterface.h.
References lldb_private::python::SWIGBridge::ToSWIGWrapper().
|
inlineprotected |
Definition at line 616 of file ScriptedPythonInterface.h.
References lldb_private::python::SWIGBridge::ToSWIGWrapper().
|
inlineprotected |
Definition at line 644 of file ScriptedPythonInterface.h.
References lldb_private::python::SWIGBridge::ToSWIGWrapper().
|
inlineprotected |
Definition at line 640 of file ScriptedPythonInterface.h.
References lldb_private::python::SWIGBridge::ToSWIGWrapper().
|
inlineprotected |
Definition at line 596 of file ScriptedPythonInterface.h.
References lldb_private::python::SWIGBridge::ToSWIGWrapper().
|
inlineprotected |
Definition at line 620 of file ScriptedPythonInterface.h.
References lldb_private::python::SWIGBridge::ToSWIGWrapper().
|
inlineprotected |
Definition at line 612 of file ScriptedPythonInterface.h.
References lldb_private::python::SWIGBridge::ToSWIGWrapper().
|
inlineprotected |
Definition at line 656 of file ScriptedPythonInterface.h.
References lldb_private::python::SWIGBridge::ToSWIGWrapper().
|
inlineprotected |
Definition at line 584 of file ScriptedPythonInterface.h.
References lldb_private::python::SWIGBridge::ToSWIGWrapper().
|
inlineprotected |
Definition at line 570 of file ScriptedPythonInterface.h.
Referenced by TransformTuple().
|
inlineprotected |
Definition at line 691 of file ScriptedPythonInterface.h.
References TransformTuple().
Referenced by CallStaticMethod(), CreatePluginObject(), and Dispatch().
|
inlineprotected |
Definition at line 696 of file ScriptedPythonInterface.h.
References error(), and ReverseTransform().
Referenced by ReassignPtrsOrRefsArgs().
|
inlineprotected |
Definition at line 683 of file ScriptedPythonInterface.h.
References Transform().
Referenced by TransformArgs().
|
protected |
Definition at line 734 of file ScriptedPythonInterface.h.
Referenced by CallStaticMethod(), CreatePluginObject(), lldb_private::ScriptedThreadPythonInterface::CreateScriptedFrameInterface(), lldb_private::ScriptedProcessPythonInterface::CreateScriptedThreadInterface(), Dispatch(), ExtractValueFromPythonObject(), GetScriptedModulePath(), and ScriptedPythonInterface().