|
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::PythonObject &obj_class) const |
| llvm::Error | CheckAbstractMethods (const python::PythonObject &obj_class, llvm::StringRef qualified_class_name) const |
| Diagnose every abstract-method violation on obj_class at once. | |
| template<typename... Args> | |
| llvm::Expected< StructuredData::GenericSP > | CreatePluginObject (const ScriptedMetadata &scripted_metadata, StructuredData::Generic *script_obj, Args... args) |
| template<typename T = StructuredData::ObjectSP, typename... Args> | |
| llvm::Expected< T > | CallStaticMethod (llvm::StringRef class_name, llvm::StringRef method_name, 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 () |
| StructuredData::GenericSP | GetScriptObjectInstance () |
| const std::optional< ScriptedMetadata > & | GetScriptedMetadata () const |
| virtual llvm::StringRef | GetPluginName ()=0 |
| The name this interface is registered under with the PluginManager. | |
| virtual bool | UserCanRunDirectly () const |
| Whether the user can invoke this extension directly, the way a scripted command can. | |
| virtual llvm::SmallVector< AbstractMethodRequirement > | GetAbstractMethodRequirements () const =0 |
| virtual llvm::SmallVector< llvm::StringLiteral > | GetOptionalMethods () const |
| Methods a script may legitimately leave out, for which LLDB has a documented answer. | |
| llvm::SmallVector< llvm::StringLiteral > const | GetAbstractMethods () const |
| ScriptedInterface (const ScriptedInterface &)=delete | |
| Delete the copy constructor. | |
| ScriptedInterface & | operator= (const ScriptedInterface &)=delete |
Static Public Member Functions | |
| static llvm::Expected< FileSpec > | GetModuleFile (llvm::StringRef module_name) |
The file the already imported module_name was loaded from, read from its __file__. | |
| Static Public Member Functions inherited from lldb_private::ScriptedInterface | |
| template<typename Ret> | |
| static Ret | ErrorWithMessage (llvm::StringRef caller_name, llvm::StringRef user_msg, Status &error, LLDBLog log_category=LLDBLog::Process) |
| static bool | CreateInstance (lldb::ScriptLanguage language, ScriptedInterfaceUsages usages) |
Protected Member Functions | |
| template<typename T = StructuredData::ObjectSP, typename... Args> | |
| llvm::Expected< std::optional< T > > | DispatchToOptional (llvm::StringRef method_name, Args &&...args) |
Call an optional method_name, reporting "the script doesn't implement
it" as std::nullopt rather than as a failure. | |
| template<typename T = StructuredData::ObjectSP> | |
| llvm::Expected< T > | ExtractValueFromPythonObject (python::PythonObject &p) |
| template<typename T = StructuredData::ObjectSP, typename... Args> | |
| llvm::Expected< T > | Dispatch (llvm::StringRef method_name, Args &&...args) |
| Call method_name on the scripted object. | |
| template<typename... Args> | |
| 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, and the SBError the method returned. | |
| template<typename T> | |
| T | Transform (T object) |
| python::PythonObject | Transform (bool arg) |
| python::PythonObject | Transform (const Status &arg) |
| python::PythonObject | Transform (Status &&arg) |
| python::PythonObject | Transform (const StructuredDataImpl &arg) |
| template<typename T, typename = std::enable_if_t< std::is_base_of_v<StructuredData::Object, T>>> | |
| python::PythonObject | Transform (std::shared_ptr< T > arg) |
| python::PythonObject | Transform (lldb::ExecutionContextRefSP arg) |
| python::PythonObject | Transform (lldb::TargetSP arg) |
| python::PythonObject | Transform (lldb::BreakpointSP arg) |
| python::PythonObject | Transform (lldb::BreakpointLocationSP arg) |
| python::PythonObject | Transform (lldb::ProcessSP arg) |
| python::PythonObject | Transform (lldb::ThreadSP arg) |
| python::PythonObject | Transform (lldb::StackFrameListSP arg) |
| python::PythonObject | Transform (lldb::ThreadPlanSP arg) |
| python::PythonObject | Transform (lldb::ProcessAttachInfoSP arg) |
| python::PythonObject | Transform (lldb::ProcessLaunchInfoSP arg) |
| python::PythonObject | Transform (Event *arg) |
| python::PythonObject | Transform (const SymbolContext &arg) |
| python::PythonObject | Transform (lldb::StreamSP arg) |
| python::PythonObject | Transform (lldb::StackFrameSP arg) |
| python::PythonObject | Transform (lldb::DataExtractorSP arg) |
| python::PythonObject | Transform (lldb::DescriptionLevel arg) |
| python::PythonObject | Transform (lldb::StepType arg) |
| python::PythonObject | Transform (lldb::ValueObjectSP arg) |
| python::PythonObject | Transform (lldb::DebuggerSP arg) |
| python::PythonObject | Transform (const std::vector< std::string > &arg) |
| python::ScopedPythonObject< lldb::SBCommandReturnObject > | Transform (CommandReturnObject *arg) |
| python::PythonObject | Transform (const TypeSummaryOptions &arg) |
| template<typename T, typename U> | |
| void | ReverseTransform (T &original_arg, U transformed_arg, Status &error) |
| template<typename T> | |
| void | ReverseTransform (T &original_arg, python::PythonObject transformed_arg, Status &error) |
| template<typename T> | |
| void | ReverseTransform (const T &original_arg, python::PythonObject transformed_arg, Status &error) |
| void | ReverseTransform (bool &original_arg, python::PythonObject transformed_arg, Status &error) |
| template<std::size_t... I, typename... Args> | |
| auto | TransformTuple (const std::tuple< Args... > &args, std::index_sequence< I... >) |
| template<typename... Args> | |
| auto | TransformArgs (const std::tuple< Args... > &args) |
| template<typename T, typename U> | |
| void | TransformBack (T &original_arg, U transformed_arg, Status &error) |
| template<typename T, typename SB> | |
| void | TransformBack (T &original_arg, python::ScopedPythonObject< SB > &transformed_arg, Status &error) |
| template<std::size_t... I, typename... Ts, typename... Us> | |
| bool | ReassignPtrsOrRefsArgs (std::tuple< Ts... > &original_args, std::tuple< Us... > &transformed_args, std::index_sequence< I... >) |
| template<typename... Ts, typename... Us> | |
| bool | ReassignPtrsOrRefsArgs (std::tuple< Ts... > &original_args, std::tuple< Us... > &transformed_args) |
| template<typename T, typename... Args> | |
| void | FormatArgs (std::string &fmt, T arg, Args... args) const |
| template<typename T> | |
| void | FormatArgs (std::string &fmt, T arg) const |
| void | FormatArgs (std::string &fmt) const |
| template<> | |
| llvm::Expected< Status > | ExtractValueFromPythonObject (python::PythonObject &p) |
| template<> | |
| llvm::Expected< Event * > | ExtractValueFromPythonObject (python::PythonObject &p) |
| template<> | |
| llvm::Expected< CommandReturnObject * > | ExtractValueFromPythonObject (python::PythonObject &p) |
| template<> | |
| llvm::Expected< SymbolContext > | ExtractValueFromPythonObject (python::PythonObject &p) |
| template<> | |
| llvm::Expected< Status > | ExtractValueFromPythonObject (python::PythonObject &p) |
| template<> | |
| llvm::Expected< Event * > | ExtractValueFromPythonObject (python::PythonObject &p) |
| template<> | |
| llvm::Expected< SymbolContext > | ExtractValueFromPythonObject (python::PythonObject &p) |
| Protected Member Functions inherited from lldb_private::ScriptedInterface | |
| void | RegisterInstance (const lldb::ScriptedInstanceRegistrySP ®istry_sp, std::string class_name, FileSpec source_path, StructuredData::DictionarySP args_sp) |
Static Protected Member Functions | |
| static std::string | ExtractPythonError (llvm::Error error) |
| Extract detailed error message including Python backtrace if available. | |
| template<typename... Ts> | |
| static llvm::Error | LogAndError (llvm::StringRef caller_name, const char *format, Ts &&...ts) |
| Log message against caller_name and return it as an error. | |
| template<typename T> | |
| 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. | |
| template<std::size_t N, typename Tuple, typename Fn, std::size_t... I> | |
| static void | ApplyPrefixImpl (Tuple &&t, Fn &&fn, std::index_sequence< I... >) |
| template<std::size_t N, typename Tuple, typename Fn> | |
| static void | ApplyPrefix (Tuple &&t, Fn &&fn) |
| template<typename Tuple, std::size_t... Is, typename Fn> | |
| static void | CallWithArity (size_t call_arity, Tuple &&t, std::index_sequence< Is... >, Fn &&fn) |
Protected Attributes | |
| ScriptInterpreterPythonImpl & | m_interpreter |
| Protected Attributes inherited from lldb_private::ScriptedInterface | |
| StructuredData::GenericSP | m_object_instance_sp |
| std::optional< ScriptedMetadata > | m_scripted_metadata |
Definition at line 29 of file ScriptedPythonInterface.h.
|
strong |
| Enumerator | |
|---|---|
| eNotImplemented | |
| eNotAllocated | |
| eNotCallable | |
| eUnknownArgumentCount | |
| eInvalidArgumentCount | |
| eValid | |
Definition at line 34 of file ScriptedPythonInterface.h.
| ScriptedPythonInterface::ScriptedPythonInterface | ( | ScriptInterpreterPythonImpl & | interpreter | ) |
Definition at line 27 of file ScriptedPythonInterface.cpp.
Referenced by lldb_private::ScriptedBreakpointPythonInterface::ScriptedBreakpointPythonInterface(), lldb_private::ScriptedCommandPythonInterface::ScriptedCommandPythonInterface(), lldb_private::ScriptedFrameProviderPythonInterface::ScriptedFrameProviderPythonInterface(), lldb_private::ScriptedFramePythonInterface::ScriptedFramePythonInterface(), lldb_private::ScriptedHookPythonInterface::ScriptedHookPythonInterface(), lldb_private::ScriptedPlatformPythonInterface::ScriptedPlatformPythonInterface(), lldb_private::ScriptedProcessPythonInterface::ScriptedProcessPythonInterface(), lldb_private::ScriptedStackFrameRecognizerPythonInterface::ScriptedStackFrameRecognizerPythonInterface(), lldb_private::ScriptedStringSummaryPythonInterface::ScriptedStringSummaryPythonInterface(), lldb_private::ScriptedSyntheticChildrenPythonInterface::ScriptedSyntheticChildrenPythonInterface(), lldb_private::ScriptedThreadPlanPythonInterface::ScriptedThreadPlanPythonInterface(), and lldb_private::ScriptedThreadPythonInterface::ScriptedThreadPythonInterface().
|
overridedefault |
|
inlinestaticprotected |
Definition at line 956 of file ScriptedPythonInterface.h.
References ApplyPrefixImpl().
Referenced by CallWithArity().
|
inlinestaticprotected |
Definition at line 951 of file ScriptedPythonInterface.h.
Referenced by ApplyPrefix().
|
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. |
| args | Arguments to pass to the static method. |
Definition at line 474 of file ScriptedPythonInterface.h.
References lldb_private::ScriptInterpreterPythonImpl::Locker::AcquireLock, ExtractPythonError(), ExtractValueFromPythonObject(), lldb_private::ScriptInterpreterPythonImpl::Locker::FreeLock, lldb_private::PolicyStack::Get(), LogAndError(), m_interpreter, lldb_private::ScriptInterpreterPythonImpl::Locker::NoSTDIN, lldb_private::PolicyStack::PushScriptedExtensionCall(), ReassignPtrsOrRefsArgs(), TransformArgs(), and lldb_private::ScriptedInterface::UserCanRunDirectly().
Referenced by lldb_private::ScriptedFrameProviderPythonInterface::AppliesToThread(), lldb_private::ScriptedFrameProviderPythonInterface::GetDescription(), and lldb_private::ScriptedFrameProviderPythonInterface::GetPriority().
|
inlinestaticprotected |
Definition at line 965 of file ScriptedPythonInterface.h.
References ApplyPrefix().
Referenced by Dispatch().
|
inline |
Definition at line 124 of file ScriptedPythonInterface.h.
References lldb_private::python::PythonObject::AsType(), eInvalidArgumentCount, eNotAllocated, eNotCallable, eNotImplemented, eUnknownArgumentCount, eValid, ExtractPythonError(), lldb_private::ScriptedInterface::GetAbstractMethodRequirements(), lldb_private::python::PythonObject::GetAttributeValue(), lldb_private::python::PythonObject::HasAttribute(), and SET_CASE_AND_CONTINUE.
Referenced by CheckAbstractMethods().
|
inline |
Diagnose every abstract-method violation on obj_class at once.
obj_class is a class object, whether resolved by name or taken from an instance's __class__. Resolving it by name means this can run before any instance exists (see CreatePluginObject), which uses it to reject a malformed class without executing its __init__.
Definition at line 187 of file ScriptedPythonInterface.h.
References lldb_private::python::PythonObject::AsType(), CheckAbstractMethodImplementation(), eInvalidArgumentCount, eNotAllocated, eNotCallable, eNotImplemented, error(), eUnknownArgumentCount, eValid, lldb_private::Status::FromError(), lldb_private::python::PythonObject::GetAttributeValue(), lldb_private::GetLog(), lldb_private::python::PythonString::GetString(), lldb_private::python::PythonObject::IsValid(), LLDB_LOG, and lldb_private::Script.
Referenced by CreatePluginObject().
|
inline |
Definition at line 279 of file ScriptedPythonInterface.h.
References lldb_private::ScriptInterpreterPythonImpl::Locker::AcquireLock, CheckAbstractMethods(), error(), ExtractPythonError(), lldb_private::ScriptInterpreterPythonImpl::Locker::FreeLock, lldb_private::PolicyStack::Get(), lldb_private::ScriptedMetadata::GetClassName(), lldb_private::GetLog(), GetModuleFile(), lldb_private::StructuredData::Generic::GetValue(), LLDB_LOG_ERROR, m_interpreter, lldb_private::ScriptedInterface::m_object_instance_sp, lldb_private::ScriptedInterface::m_scripted_metadata, lldb_private::ScriptInterpreterPythonImpl::Locker::NoSTDIN, lldb_private::PolicyStack::PushScriptedExtensionCall(), lldb_private::ScriptedInterface::RegisterInstance(), lldb_private::Script, TransformArgs(), and lldb_private::ScriptedInterface::UserCanRunDirectly().
Referenced by lldb_private::OperatingSystemPythonInterface::CreatePluginObject(), lldb_private::ScriptedBreakpointPythonInterface::CreatePluginObject(), lldb_private::ScriptedCommandPythonInterface::CreatePluginObject(), lldb_private::ScriptedFrameProviderPythonInterface::CreatePluginObject(), lldb_private::ScriptedFramePythonInterface::CreatePluginObject(), lldb_private::ScriptedHookPythonInterface::CreatePluginObject(), lldb_private::ScriptedPlatformPythonInterface::CreatePluginObject(), lldb_private::ScriptedProcessPythonInterface::CreatePluginObject(), lldb_private::ScriptedStackFrameRecognizerPythonInterface::CreatePluginObject(), lldb_private::ScriptedStringSummaryPythonInterface::CreatePluginObject(), lldb_private::ScriptedSyntheticChildrenPythonInterface::CreatePluginObject(), lldb_private::ScriptedThreadPlanPythonInterface::CreatePluginObject(), and lldb_private::ScriptedThreadPythonInterface::CreatePluginObject().
|
inlineprotected |
Call method_name on the scripted object.
The returned Expected separates the two outcomes that a plain return value cannot: a successfully extracted value (which may legitimately be empty or null, e.g. when the Python method returns None) and a failure to call the method at all.
A class that simply doesn't implement method_name fails with an UnimplementedError, so callers of optional callbacks can recognize and ignore that case without also swallowing real exceptions.
Definition at line 667 of file ScriptedPythonInterface.h.
References lldb_private::ScriptInterpreterPythonImpl::Locker::AcquireLock, CallWithArity(), ExtractPythonError(), ExtractValueFromPythonObject(), lldb_private::ScriptInterpreterPythonImpl::Locker::FreeLock, lldb_private::PolicyStack::Get(), lldb_private::ScriptedInterface::GetScriptedMetadata(), LogAndError(), m_interpreter, lldb_private::ScriptedInterface::m_object_instance_sp, lldb_private::ScriptInterpreterPythonImpl::Locker::NoSTDIN, lldb_private::PolicyStack::PushScriptedExtensionCall(), ReassignPtrsOrRefsArgs(), TransformArgs(), and lldb_private::ScriptedInterface::UserCanRunDirectly().
Referenced by lldb_private::ScriptedProcessPythonInterface::CreateBreakpoint(), lldb_private::OperatingSystemPythonInterface::CreateThread(), DispatchToOptional(), lldb_private::OperatingSystemPythonInterface::DoesPluginReportAllThreads(), lldb_private::ScriptedCommandPythonInterface::GetArgumentsDefinition(), lldb_private::ScriptedProcessPythonInterface::GetCapabilities(), lldb_private::ScriptedFramePythonInterface::GetCFA(), lldb_private::ScriptedSyntheticChildrenPythonInterface::GetChildAtIndex(), lldb_private::ScriptedBreakpointPythonInterface::GetDepth(), lldb_private::ScriptedFramePythonInterface::GetDisplayFunctionName(), lldb_private::ScriptedStackFrameRecognizerPythonInterface::GetException(), lldb_private::ScriptedThreadPythonInterface::GetExtendedInfo(), lldb_private::ScriptedCommandPythonInterface::GetFlags(), lldb_private::ScriptedFrameProviderPythonInterface::GetFrameAtIndex(), lldb_private::ScriptedFramePythonInterface::GetFunctionName(), lldb_private::ScriptedFramePythonInterface::GetID(), lldb_private::ScriptedProcessPythonInterface::GetLoadedImages(), lldb_private::ScriptedBreakpointPythonInterface::GetLocationDescription(), lldb_private::ScriptedCommandPythonInterface::GetLongHelp(), lldb_private::ScriptedProcessPythonInterface::GetMemoryRegionContainingAddress(), lldb_private::ScriptedProcessPythonInterface::GetMetadata(), lldb_private::ScriptedThreadPythonInterface::GetName(), lldb_private::ScriptedCommandPythonInterface::GetOptionsDefinition(), lldb_private::ScriptedFramePythonInterface::GetPC(), lldb_private::ScriptedProcessPythonInterface::GetProcessID(), lldb_private::ScriptedPlatformPythonInterface::GetProcessInfo(), lldb_private::ScriptedThreadPythonInterface::GetQueue(), lldb_private::ScriptedStackFrameRecognizerPythonInterface::GetRecognizedArguments(), lldb_private::ScriptedFramePythonInterface::GetRegisterContext(), lldb_private::ScriptedThreadPythonInterface::GetRegisterContext(), lldb_private::OperatingSystemPythonInterface::GetRegisterContextForTID(), lldb_private::ScriptedFramePythonInterface::GetRegisterInfo(), lldb_private::ScriptedThreadPythonInterface::GetRegisterInfo(), lldb_private::ScriptedCommandPythonInterface::GetRepeatCommand(), lldb_private::ScriptedThreadPythonInterface::GetScriptedFramePluginName(), lldb_private::ScriptedProcessPythonInterface::GetScriptedThreadPluginName(), lldb_private::ScriptedBreakpointPythonInterface::GetShortHelp(), lldb_private::ScriptedCommandPythonInterface::GetShortHelp(), lldb_private::ScriptedThreadPythonInterface::GetStackFrames(), lldb_private::ScriptedThreadPythonInterface::GetState(), GetStatusFromMethod(), lldb_private::ScriptedStackFrameRecognizerPythonInterface::GetStepThroughPlan(), lldb_private::ScriptedStackFrameRecognizerPythonInterface::GetStopDescription(), lldb_private::ScriptedThreadPythonInterface::GetStopReason(), lldb_private::ScriptedStringSummaryPythonInterface::GetSummary(), lldb_private::ScriptedFramePythonInterface::GetSymbolContext(), lldb_private::ScriptedSyntheticChildrenPythonInterface::GetSyntheticTypeName(), lldb_private::ScriptedSyntheticChildrenPythonInterface::GetSyntheticValue(), lldb_private::ScriptedThreadPythonInterface::GetThreadID(), lldb_private::OperatingSystemPythonInterface::GetThreadInfo(), lldb_private::ScriptedProcessPythonInterface::GetThreadsInfo(), lldb_private::ScriptedFramePythonInterface::GetValueObjectForVariableExpression(), lldb_private::ScriptedFramePythonInterface::GetValueTypeForVariable(), lldb_private::ScriptedFramePythonInterface::GetVariables(), lldb_private::ScriptedCommandPythonInterface::HandleArgumentCompletion(), lldb_private::ScriptedCommandPythonInterface::HandleOptionArgumentCompletion(), lldb_private::ScriptedHookPythonInterface::HandleStop(), lldb_private::ScriptedProcessPythonInterface::IsAlive(), lldb_private::ScriptedFramePythonInterface::IsArtificial(), lldb_private::ScriptedFramePythonInterface::IsHidden(), lldb_private::ScriptedFramePythonInterface::IsInlined(), lldb_private::ScriptedPlatformPythonInterface::ListProcesses(), lldb_private::ScriptedSyntheticChildrenPythonInterface::MightHaveChildren(), lldb_private::ScriptedCommandPythonInterface::OptionParsingStarted(), lldb_private::ScriptedBreakpointPythonInterface::OverridesResolver(), lldb_private::ScriptedProcessPythonInterface::ReadMemoryAtAddress(), lldb_private::ScriptedBreakpointPythonInterface::ResolverCallback(), lldb_private::ScriptedCommandPythonInterface::RunParsedCommand(), lldb_private::ScriptedCommandPythonInterface::RunRawCommand(), lldb_private::ScriptedStackFrameRecognizerPythonInterface::SelectMostRelevantFrame(), lldb_private::ScriptedBreakpointPythonInterface::SetBreakpoint(), lldb_private::ScriptedCommandPythonInterface::SetOptionValue(), lldb_private::ScriptedStackFrameRecognizerPythonInterface::ShouldHide(), lldb_private::ScriptedSyntheticChildrenPythonInterface::Update(), lldb_private::ScriptedBreakpointPythonInterface::WasHit(), and lldb_private::ScriptedProcessPythonInterface::WriteMemoryAtAddress().
|
inlineprotected |
Call an optional method_name, reporting "the script doesn't implement
it" as std::nullopt rather than as a failure.
Use this for callbacks a script may legitimately leave out. Any other failure - in particular an exception raised inside the method - propagates; this never papers over a method that ran and failed.
Definition at line 630 of file ScriptedPythonInterface.h.
References Dispatch(), lldb_private::ScriptedInterface::GetOptionalMethods(), and LogAndError().
Referenced by lldb_private::ScriptedSyntheticChildrenPythonInterface::CalculateNumChildren(), lldb_private::ScriptedThreadPlanPythonInterface::ExplainsStop(), lldb_private::ScriptedSyntheticChildrenPythonInterface::GetIndexOfChildWithName(), lldb_private::ScriptedThreadPlanPythonInterface::GetRunState(), lldb_private::ScriptedThreadPlanPythonInterface::GetStopDescription(), lldb_private::ScriptedFramePythonInterface::GetThreadPlanMetadataForStepType(), lldb_private::ScriptedHookPythonInterface::HandleModuleLoaded(), lldb_private::ScriptedHookPythonInterface::HandleModuleUnloaded(), lldb_private::ScriptedThreadPlanPythonInterface::IsStale(), and lldb_private::ScriptedThreadPlanPythonInterface::ShouldStop().
|
inlinestaticprotected |
Extract detailed error message including Python backtrace if available.
This helper processes llvm::Error objects that may contain PythonException instances, extracting full Python backtraces when available.
| error | The llvm::Error to extract information from. |
Definition at line 574 of file ScriptedPythonInterface.h.
References error(), and lldb_private::python::PythonException::ReadBacktrace().
Referenced by CallStaticMethod(), CheckAbstractMethodImplementation(), CreatePluginObject(), and Dispatch().
|
protected |
Definition at line 27 of file ScriptedPythonInterface.cpp.
References m_interpreter, and lldb_private::ScriptedInterface::ScriptedInterface().
|
protected |
Definition at line 27 of file ScriptedPythonInterface.cpp.
|
protected |
Definition at line 27 of file ScriptedPythonInterface.cpp.
|
protected |
Definition at line 27 of file ScriptedPythonInterface.cpp.
|
protected |
|
protected |
|
protected |
|
inlineprotected |
Definition at line 652 of file ScriptedPythonInterface.h.
References lldb_private::python::PythonObject::CreateStructuredObject().
Referenced by CallStaticMethod(), Dispatch(), and ReverseTransform().
|
inlineprotected |
Definition at line 1018 of file ScriptedPythonInterface.h.
|
inlineprotected |
Definition at line 1014 of file ScriptedPythonInterface.h.
|
inlineprotected |
Definition at line 1009 of file ScriptedPythonInterface.h.
References FormatArgs().
Referenced by FormatArgs().
|
inlinestatic |
The file the already imported module_name was loaded from, read from its __file__.
The caller must hold the GIL.
Definition at line 98 of file ScriptedPythonInterface.h.
Referenced by CreatePluginObject(), and GetScriptedModulePath().
|
inlineoverridevirtual |
Reimplemented from lldb_private::ScriptedInterface.
Definition at line 58 of file ScriptedPythonInterface.h.
References lldb_private::ScriptInterpreterPythonImpl::Locker::AcquireLock, lldb_private::ScriptInterpreterPythonImpl::Locker::FreeLock, GetModuleFile(), m_interpreter, lldb_private::ScriptedInterface::m_object_instance_sp, and lldb_private::ScriptInterpreterPythonImpl::Locker::NoSTDIN.
|
inlineprotected |
Call method_name and fold both failure channels into one Status: a failure to call the method at all, and the SBError the method returned.
The latter used to be dropped on the floor.
Definition at line 771 of file ScriptedPythonInterface.h.
References Dispatch(), and lldb_private::Status::FromError().
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().
|
inlinestaticprotected |
Log the failure in value_or_err and fall back to a default-constructed T.
For entry points whose return type cannot express failure. Prefer propagating the error wherever the signature can carry it; this is the stop-gap, and it is at least strictly better than dropping the error.
Logs any failure, an unimplemented method included: a site that dispatches with Dispatch() rather than DispatchToOptional() is asserting the method should have been there.
Definition at line 608 of file ScriptedPythonInterface.h.
References lldb_private::GetLog(), LLDB_LOGF, and lldb_private::Script.
Referenced by lldb_private::ScriptedFrameProviderPythonInterface::AppliesToThread(), lldb_private::OperatingSystemPythonInterface::CreateThread(), lldb_private::OperatingSystemPythonInterface::DoesPluginReportAllThreads(), lldb_private::ScriptedCommandPythonInterface::GetArgumentsDefinition(), lldb_private::ScriptedProcessPythonInterface::GetCapabilities(), lldb_private::ScriptedFramePythonInterface::GetCFA(), lldb_private::ScriptedSyntheticChildrenPythonInterface::GetChildAtIndex(), lldb_private::ScriptedBreakpointPythonInterface::GetDepth(), lldb_private::ScriptedFrameProviderPythonInterface::GetDescription(), lldb_private::ScriptedFramePythonInterface::GetDisplayFunctionName(), lldb_private::ScriptedStackFrameRecognizerPythonInterface::GetException(), lldb_private::ScriptedThreadPythonInterface::GetExtendedInfo(), lldb_private::ScriptedCommandPythonInterface::GetFlags(), lldb_private::ScriptedFrameProviderPythonInterface::GetFrameAtIndex(), lldb_private::ScriptedFramePythonInterface::GetFunctionName(), lldb_private::ScriptedFramePythonInterface::GetID(), lldb_private::ScriptedProcessPythonInterface::GetLoadedImages(), lldb_private::ScriptedBreakpointPythonInterface::GetLocationDescription(), lldb_private::ScriptedCommandPythonInterface::GetLongHelp(), lldb_private::ScriptedProcessPythonInterface::GetMetadata(), lldb_private::ScriptedThreadPythonInterface::GetName(), lldb_private::ScriptedCommandPythonInterface::GetOptionsDefinition(), lldb_private::ScriptedFramePythonInterface::GetPC(), lldb_private::ScriptedFrameProviderPythonInterface::GetPriority(), lldb_private::ScriptedProcessPythonInterface::GetProcessID(), lldb_private::ScriptedPlatformPythonInterface::GetProcessInfo(), lldb_private::ScriptedThreadPythonInterface::GetQueue(), lldb_private::ScriptedStackFrameRecognizerPythonInterface::GetRecognizedArguments(), lldb_private::ScriptedFramePythonInterface::GetRegisterContext(), lldb_private::ScriptedThreadPythonInterface::GetRegisterContext(), lldb_private::OperatingSystemPythonInterface::GetRegisterContextForTID(), lldb_private::ScriptedFramePythonInterface::GetRegisterInfo(), lldb_private::ScriptedThreadPythonInterface::GetRegisterInfo(), lldb_private::ScriptedCommandPythonInterface::GetRepeatCommand(), lldb_private::ScriptedThreadPythonInterface::GetScriptedFramePluginName(), lldb_private::ScriptedProcessPythonInterface::GetScriptedThreadPluginName(), lldb_private::ScriptedBreakpointPythonInterface::GetShortHelp(), lldb_private::ScriptedCommandPythonInterface::GetShortHelp(), lldb_private::ScriptedThreadPythonInterface::GetStackFrames(), lldb_private::ScriptedThreadPythonInterface::GetState(), lldb_private::ScriptedStackFrameRecognizerPythonInterface::GetStepThroughPlan(), lldb_private::ScriptedStackFrameRecognizerPythonInterface::GetStopDescription(), lldb_private::ScriptedThreadPythonInterface::GetStopReason(), lldb_private::ScriptedSyntheticChildrenPythonInterface::GetSyntheticTypeName(), lldb_private::ScriptedSyntheticChildrenPythonInterface::GetSyntheticValue(), lldb_private::ScriptedThreadPythonInterface::GetThreadID(), lldb_private::OperatingSystemPythonInterface::GetThreadInfo(), lldb_private::ScriptedProcessPythonInterface::GetThreadsInfo(), lldb_private::ScriptedFramePythonInterface::GetValueTypeForVariable(), lldb_private::ScriptedFramePythonInterface::GetVariables(), lldb_private::ScriptedCommandPythonInterface::HandleArgumentCompletion(), lldb_private::ScriptedCommandPythonInterface::HandleOptionArgumentCompletion(), lldb_private::ScriptedProcessPythonInterface::IsAlive(), lldb_private::ScriptedFramePythonInterface::IsArtificial(), lldb_private::ScriptedFramePythonInterface::IsHidden(), lldb_private::ScriptedFramePythonInterface::IsInlined(), lldb_private::ScriptedPlatformPythonInterface::ListProcesses(), lldb_private::ScriptedSyntheticChildrenPythonInterface::MightHaveChildren(), lldb_private::ScriptedCommandPythonInterface::OptionParsingStarted(), lldb_private::ScriptedBreakpointPythonInterface::OverridesResolver(), lldb_private::ScriptedBreakpointPythonInterface::ResolverCallback(), lldb_private::ScriptedStackFrameRecognizerPythonInterface::SelectMostRelevantFrame(), lldb_private::ScriptedBreakpointPythonInterface::SetBreakpoint(), lldb_private::ScriptedCommandPythonInterface::SetOptionValue(), lldb_private::ScriptedStackFrameRecognizerPythonInterface::ShouldHide(), and lldb_private::ScriptedSyntheticChildrenPythonInterface::Update().
|
inlinestaticprotected |
Log message against caller_name and return it as an error.
The Expected-returning counterpart of ScriptedInterface::ErrorWithMessage: it reports the failure instead of folding it into a default-constructed value.
Definition at line 589 of file ScriptedPythonInterface.h.
References lldb_private::GetLog(), LLDB_LOGF, and lldb_private::Script.
Referenced by CallStaticMethod(), Dispatch(), and DispatchToOptional().
|
inlineprotected |
Definition at line 999 of file ScriptedPythonInterface.h.
References ReassignPtrsOrRefsArgs().
|
inlineprotected |
Definition at line 988 of file ScriptedPythonInterface.h.
References error(), and TransformBack().
Referenced by CallStaticMethod(), Dispatch(), and ReassignPtrsOrRefsArgs().
|
inlineprotected |
Definition at line 925 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 922 of file ScriptedPythonInterface.h.
References error().
|
inlineprotected |
Definition at line 906 of file ScriptedPythonInterface.h.
References error(), ExtractValueFromPythonObject(), and lldb_private::Status::FromError().
|
inlineprotected |
Definition at line 901 of file ScriptedPythonInterface.h.
References error().
Referenced by TransformBack().
|
inlineprotected |
Definition at line 785 of file ScriptedPythonInterface.h.
|
inlineprotected |
Definition at line 892 of file ScriptedPythonInterface.h.
References lldb_private::python::SWIGBridge::ToSWIGWrapper().
|
inlineprotected |
Definition at line 790 of file ScriptedPythonInterface.h.
References lldb_private::Status::Clone(), and lldb_private::python::SWIGBridge::ToSWIGWrapper().
|
inlineprotected |
Definition at line 884 of file ScriptedPythonInterface.h.
References lldb_private::python::PythonList::AppendItem(), and lldb_private::python::Empty.
|
inlineprotected |
Definition at line 798 of file ScriptedPythonInterface.h.
References lldb_private::python::SWIGBridge::ToSWIGWrapper().
|
inlineprotected |
Definition at line 852 of file ScriptedPythonInterface.h.
References lldb_private::python::SWIGBridge::ToSWIGWrapper().
|
inlineprotected |
Definition at line 896 of file ScriptedPythonInterface.h.
References lldb_private::python::SWIGBridge::ToSWIGWrapper().
|
inlineprotected |
Definition at line 848 of file ScriptedPythonInterface.h.
References lldb_private::python::SWIGBridge::ToSWIGWrapper().
|
inlineprotected |
Definition at line 820 of file ScriptedPythonInterface.h.
References lldb_private::python::SWIGBridge::ToSWIGWrapper().
|
inlineprotected |
Definition at line 816 of file ScriptedPythonInterface.h.
References lldb_private::python::SWIGBridge::ToSWIGWrapper().
|
inlineprotected |
Definition at line 864 of file ScriptedPythonInterface.h.
References lldb_private::python::SWIGBridge::ToSWIGWrapper().
|
inlineprotected |
Definition at line 880 of file ScriptedPythonInterface.h.
References lldb_private::python::SWIGBridge::ToSWIGWrapper().
|
inlineprotected |
Definition at line 868 of file ScriptedPythonInterface.h.
References lldb_private::python::SWIGBridge::ToSWIGWrapper().
|
inlineprotected |
Definition at line 808 of file ScriptedPythonInterface.h.
References lldb_private::python::SWIGBridge::ToSWIGWrapper().
|
inlineprotected |
Definition at line 840 of file ScriptedPythonInterface.h.
References lldb_private::python::SWIGBridge::ToSWIGWrapper().
|
inlineprotected |
Definition at line 844 of file ScriptedPythonInterface.h.
References lldb_private::python::SWIGBridge::ToSWIGWrapper().
|
inlineprotected |
Definition at line 824 of file ScriptedPythonInterface.h.
References lldb_private::python::SWIGBridge::ToSWIGWrapper().
|
inlineprotected |
Definition at line 832 of file ScriptedPythonInterface.h.
References lldb_private::python::SWIGBridge::ToSWIGWrapper().
|
inlineprotected |
Definition at line 860 of file ScriptedPythonInterface.h.
References lldb_private::python::SWIGBridge::ToSWIGWrapper().
|
inlineprotected |
Definition at line 872 of file ScriptedPythonInterface.h.
References lldb_private::python::SWIGBridge::ToSWIGWrapper().
|
inlineprotected |
Definition at line 856 of file ScriptedPythonInterface.h.
References lldb_private::python::SWIGBridge::ToSWIGWrapper().
|
inlineprotected |
Definition at line 812 of file ScriptedPythonInterface.h.
References lldb_private::python::SWIGBridge::ToSWIGWrapper().
|
inlineprotected |
Definition at line 836 of file ScriptedPythonInterface.h.
References lldb_private::python::SWIGBridge::ToSWIGWrapper().
|
inlineprotected |
Definition at line 828 of file ScriptedPythonInterface.h.
References lldb_private::python::SWIGBridge::ToSWIGWrapper().
|
inlineprotected |
Definition at line 876 of file ScriptedPythonInterface.h.
References lldb_private::python::SWIGBridge::ToSWIGWrapper().
|
inlineprotected |
Definition at line 794 of file ScriptedPythonInterface.h.
References lldb_private::python::SWIGBridge::ToSWIGWrapper().
|
inlineprotected |
Definition at line 804 of file ScriptedPythonInterface.h.
References Transform().
|
inlineprotected |
Definition at line 780 of file ScriptedPythonInterface.h.
Referenced by Transform(), and TransformTuple().
|
inlineprotected |
Definition at line 945 of file ScriptedPythonInterface.h.
References TransformTuple().
Referenced by CallStaticMethod(), CreatePluginObject(), and Dispatch().
|
inlineprotected |
Definition at line 983 of file ScriptedPythonInterface.h.
References error().
|
inlineprotected |
Definition at line 974 of file ScriptedPythonInterface.h.
References error(), and ReverseTransform().
Referenced by ReassignPtrsOrRefsArgs().
|
inlineprotected |
Definition at line 937 of file ScriptedPythonInterface.h.
References Transform().
Referenced by TransformArgs().
|
protected |
Definition at line 1021 of file ScriptedPythonInterface.h.
Referenced by CallStaticMethod(), CreatePluginObject(), lldb_private::ScriptedSyntheticChildrenPythonInterface::CreatePluginObject(), lldb_private::ScriptedThreadPythonInterface::CreateScriptedFrameInterface(), lldb_private::ScriptedProcessPythonInterface::CreateScriptedThreadInterface(), Dispatch(), ExtractValueFromPythonObject(), GetScriptedModulePath(), lldb_private::ScriptedHookPythonInterface::GetSupportedMethods(), lldb_private::ScriptedFramePythonInterface::GetThreadPlanMetadataForStepType(), lldb_private::ScriptedCommandPythonInterface::RunParsedCommand(), and lldb_private::ScriptedCommandPythonInterface::RunRawCommand().