LLDB mainline
lldb_private::ScriptedInterface Class Referenceabstract

#include <ScriptedInterface.h>

Inheritance diagram for lldb_private::ScriptedInterface:
[legend]

Classes

struct  AbstractMethodRequirement

Public Member Functions

 ScriptedInterface ()=default
virtual ~ScriptedInterface ()=default
StructuredData::GenericSP GetScriptObjectInstance ()
const std::optional< ScriptedMetadata > & GetScriptedMetadata () const
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.
virtual llvm::Expected< FileSpec > GetScriptedModulePath ()
llvm::SmallVector< llvm::StringLiteral > const GetAbstractMethods () const

Static Public Member Functions

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 Attributes

StructuredData::GenericSP m_object_instance_sp
std::optional< ScriptedMetadata > m_scripted_metadata

Detailed Description

Definition at line 27 of file ScriptedInterface.h.

Constructor & Destructor Documentation

◆ ScriptedInterface()

lldb_private::ScriptedInterface::ScriptedInterface ( )
default

◆ ~ScriptedInterface()

virtual lldb_private::ScriptedInterface::~ScriptedInterface ( )
virtualdefault

Member Function Documentation

◆ CreateInstance()

bool lldb_private::ScriptedInterface::CreateInstance ( lldb::ScriptLanguage language,
ScriptedInterfaceUsages usages )
inlinestatic

Definition at line 98 of file ScriptedInterface.h.

Referenced by lldb_private::OperatingSystemPythonInterface::Initialize(), lldb_private::ScriptedBreakpointPythonInterface::Initialize(), lldb_private::ScriptedCommandPythonInterface::Initialize(), lldb_private::ScriptedFramePythonInterface::Initialize(), lldb_private::ScriptedHookPythonInterface::Initialize(), lldb_private::ScriptedPlatformPythonInterface::Initialize(), lldb_private::ScriptedProcessPythonInterface::Initialize(), lldb_private::ScriptedStackFrameRecognizerPythonInterface::Initialize(), lldb_private::ScriptedStringSummaryPythonInterface::Initialize(), lldb_private::ScriptedSyntheticChildrenPythonInterface::Initialize(), lldb_private::ScriptedThreadPlanPythonInterface::Initialize(), lldb_private::ScriptedThreadPythonInterface::Initialize(), lldb_private::OperatingSystemPythonInterface::Terminate(), lldb_private::ScriptedBreakpointPythonInterface::Terminate(), lldb_private::ScriptedCommandPythonInterface::Terminate(), lldb_private::ScriptedFramePythonInterface::Terminate(), lldb_private::ScriptedHookPythonInterface::Terminate(), lldb_private::ScriptedPlatformPythonInterface::Terminate(), lldb_private::ScriptedProcessPythonInterface::Terminate(), lldb_private::ScriptedStackFrameRecognizerPythonInterface::Terminate(), lldb_private::ScriptedStringSummaryPythonInterface::Terminate(), lldb_private::ScriptedSyntheticChildrenPythonInterface::Terminate(), lldb_private::ScriptedThreadPlanPythonInterface::Terminate(), and lldb_private::ScriptedThreadPythonInterface::Terminate().

◆ ErrorWithMessage()

◆ GetAbstractMethodRequirements()

◆ GetAbstractMethods()

llvm::SmallVector< llvm::StringLiteral > const lldb_private::ScriptedInterface::GetAbstractMethods ( ) const
inline

Definition at line 69 of file ScriptedInterface.h.

References GetAbstractMethodRequirements().

◆ GetOptionalMethods()

virtual llvm::SmallVector< llvm::StringLiteral > lldb_private::ScriptedInterface::GetOptionalMethods ( ) const
inlinevirtual

Methods a script may legitimately leave out, for which LLDB has a documented answer.

This is the counterpart of GetAbstractMethodRequirements(): a method is either required, and its absence rejects the class outright, or listed here, and its absence is an expected answer. Only methods named here may be dispatched with ScriptedPythonInterface::DispatchToOptional().

Reimplemented in lldb_private::ScriptedFramePythonInterface, lldb_private::ScriptedHookPythonInterface, lldb_private::ScriptedSyntheticChildrenPythonInterface, and lldb_private::ScriptedThreadPlanPythonInterface.

Definition at line 61 of file ScriptedInterface.h.

Referenced by lldb_private::ScriptedPythonInterface::DispatchToOptional().

◆ GetScriptedMetadata()

const std::optional< ScriptedMetadata > & lldb_private::ScriptedInterface::GetScriptedMetadata ( ) const
inline

Definition at line 36 of file ScriptedInterface.h.

References m_scripted_metadata.

Referenced by lldb_private::ScriptedPythonInterface::Dispatch().

◆ GetScriptedModulePath()

virtual llvm::Expected< FileSpec > lldb_private::ScriptedInterface::GetScriptedModulePath ( )
inlinevirtual

Reimplemented in lldb_private::ScriptedPythonInterface.

Definition at line 65 of file ScriptedInterface.h.

◆ GetScriptObjectInstance()

StructuredData::GenericSP lldb_private::ScriptedInterface::GetScriptObjectInstance ( )
inline

◆ UserCanRunDirectly()

virtual bool lldb_private::ScriptedInterface::UserCanRunDirectly ( ) const
inlinevirtual

Whether the user can invoke this extension directly, the way a scripted command can.

Those never introduce the target's API mutex bypass, so at top level they serialize like any other command; nested inside an already-bypassed callback every extension inherits the ambient policy.

Reimplemented in lldb_private::ScriptedCommandInterface.

Definition at line 44 of file ScriptedInterface.h.

Referenced by lldb_private::ScriptedPythonInterface::CallStaticMethod(), lldb_private::ScriptedPythonInterface::CreatePluginObject(), and lldb_private::ScriptedPythonInterface::Dispatch().

Member Data Documentation

◆ m_object_instance_sp

◆ m_scripted_metadata

std::optional<ScriptedMetadata> lldb_private::ScriptedInterface::m_scripted_metadata
protected

The documentation for this class was generated from the following file: