LLDB mainline
lldb_private::Target::HookScripted Class Reference

#include <Target.h>

Inheritance diagram for lldb_private::Target::HookScripted:
[legend]

Public Member Functions

 ~HookScripted () override=default
void GetDescription (Stream &s, lldb::DescriptionLevel level) const override
void HandleModuleLoaded (lldb::StreamSP output) override
void HandleModuleUnloaded (lldb::StreamSP output) override
StopHook::StopHookResult HandleStop (ExecutionContext &exe_ctx, lldb::StreamSP output) override
 Called when the process stops.
Status SetScriptCallback (std::string class_name, StructuredData::ObjectSP extra_args_sp)
Public Member Functions inherited from lldb_private::Target::Hook
 Hook (const Hook &rhs)
virtual ~Hook ()=default
HookKind GetHookKind () const
lldb::TargetSPGetTarget ()
bool IsEnabled ()
void SetIsEnabled (bool enabled)
uint32_t GetTriggerMask () const
 Return the bitmask of triggers this hook responds to.
bool FiresOn (uint32_t trigger) const
 Return true if this hook fires on the given trigger.
void SetSCSpecifier (SymbolContextSpecifier *specifier)
 Set the symbol context specifier. The hook takes ownership.
SymbolContextSpecifierGetSCSpecifier ()
bool ExecutionContextPasses (const ExecutionContext &exe_ctx)
 Check if the execution context passes the specifier and thread spec filters.
void SetThreadSpecifier (ThreadSpec *specifier)
 Set the thread specifier. The hook takes ownership.
ThreadSpecGetThreadSpecifier ()
void SetRunAtInitialStop (bool at_initial_stop)
bool GetRunAtInitialStop () const
void SetAutoContinue (bool auto_continue)
bool GetAutoContinue () const
void SetSuppressOutput (bool suppress_output)
bool GetSuppressOutput () const
Public Member Functions inherited from lldb_private::UserID
 UserID (lldb::user_id_t uid=LLDB_INVALID_UID)
 Construct with optional user ID.
 ~UserID ()=default
 Destructor.
void Clear ()
 Clears the object state.
lldb::user_id_t GetID () const
 Get accessor for the user ID.
void SetID (lldb::user_id_t uid)
 Set accessor for the user ID.

Private Member Functions

 HookScripted (lldb::TargetSP target_sp, lldb::user_id_t uid)

Private Attributes

std::string m_class_name
StructuredDataImpl m_extra_args
lldb::ScriptedHookInterfaceSP m_interface_sp

Friends

class Target

Additional Inherited Members

Public Types inherited from lldb_private::Target::Hook
enum class  HookKind : uint32_t { CommandBased = 0 , ScriptBased }
enum  TriggerBit : uint32_t { kModulesLoaded = (1u << 0) , kModulesUnloaded = (1u << 1) , kProcessStop = (1u << 2) }
 Individual trigger bits. Combine with bitwise OR to form a trigger mask. More...
Protected Member Functions inherited from lldb_private::Target::Hook
void GetFilterDescription (Stream &s, lldb::DescriptionLevel level) const
 Print the filter portion of the description (AutoContinue, Specifier, ThreadSpec).
 Hook (lldb::TargetSP target_sp, lldb::user_id_t uid, HookKind kind)
Protected Attributes inherited from lldb_private::Target::Hook
lldb::TargetSP m_target_sp
HookKind m_kind
bool m_enabled = true
uint32_t m_trigger_mask = 0
lldb::SymbolContextSpecifierSP m_sc_specifier_sp
std::unique_ptr< ThreadSpecm_thread_spec_up
bool m_at_initial_stop = true
bool m_auto_continue = false
bool m_suppress_output = false
Protected Attributes inherited from lldb_private::UserID
lldb::user_id_t m_uid
 The user ID that uniquely identifies an object.

Detailed Description

Definition at line 1815 of file Target.h.

Constructor & Destructor Documentation

◆ ~HookScripted()

lldb_private::Target::HookScripted::~HookScripted ( )
overridedefault

◆ HookScripted()

lldb_private::Target::HookScripted::HookScripted ( lldb::TargetSP target_sp,
lldb::user_id_t uid )
inlineprivate

Member Function Documentation

◆ GetDescription()

◆ HandleModuleLoaded()

void Target::HookScripted::HandleModuleLoaded ( lldb::StreamSP output)
overridevirtual

Reimplemented from lldb_private::Target::Hook.

Definition at line 4578 of file Target.cpp.

References lldb_private::StreamString::GetData(), and m_interface_sp.

◆ HandleModuleUnloaded()

void Target::HookScripted::HandleModuleUnloaded ( lldb::StreamSP output)
overridevirtual

Reimplemented from lldb_private::Target::Hook.

Definition at line 4587 of file Target.cpp.

References lldb_private::StreamString::GetData(), and m_interface_sp.

◆ HandleStop()

Target::StopHook::StopHookResult Target::HookScripted::HandleStop ( ExecutionContext & exe_ctx,
lldb::StreamSP output )
overridevirtual

Called when the process stops.

Returns a StopHookResult indicating whether the process should remain stopped or continue.

Reimplemented from lldb_private::Target::Hook.

Definition at line 4597 of file Target.cpp.

References lldb_private::StreamString::GetData(), lldb_private::ExecutionContext::GetTargetPtr(), lldb_private::Target::StopHook::KeepStopped, m_interface_sp, and lldb_private::Target::StopHook::RequestContinue.

◆ SetScriptCallback()

◆ Target

friend class Target
friend

Definition at line 1836 of file Target.h.

References Target.

Referenced by Target.

Member Data Documentation

◆ m_class_name

std::string lldb_private::Target::HookScripted::m_class_name
private

Definition at line 1830 of file Target.h.

Referenced by GetDescription(), and SetScriptCallback().

◆ m_extra_args

StructuredDataImpl lldb_private::Target::HookScripted::m_extra_args
private

Definition at line 1831 of file Target.h.

Referenced by GetDescription(), and SetScriptCallback().

◆ m_interface_sp

lldb::ScriptedHookInterfaceSP lldb_private::Target::HookScripted::m_interface_sp
private

Definition at line 1832 of file Target.h.

Referenced by HandleModuleLoaded(), HandleModuleUnloaded(), HandleStop(), and SetScriptCallback().


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