LLDB mainline
lldb_private::Target::HookCommandLine Class Reference

#include <Target.h>

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

Public Member Functions

 ~HookCommandLine () override=default
void SetTriggerMask (uint32_t mask)
 Replace the trigger mask. mask is a bitwise OR of TriggerBit values.
void AddTrigger (uint32_t trigger)
 Add a trigger to the mask. trigger is a single TriggerBit value.
void RemoveTrigger (uint32_t trigger)
 Remove a trigger from the mask. trigger is a single TriggerBit value.
StringListGetCommands ()
 Return the list of commands that this hook runs.
void SetActionFromString (const std::string &string)
 Populate the command list by splitting a single string on newlines.
void SetActionFromStrings (const std::vector< std::string > &strings)
 Populate the command list from a vector of individual command strings.
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.
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

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

Private Attributes

StringList m_commands

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 1779 of file Target.h.

Constructor & Destructor Documentation

◆ ~HookCommandLine()

lldb_private::Target::HookCommandLine::~HookCommandLine ( )
overridedefault

◆ HookCommandLine()

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

Member Function Documentation

◆ AddTrigger()

void lldb_private::Target::HookCommandLine::AddTrigger ( uint32_t trigger)
inline

Add a trigger to the mask. trigger is a single TriggerBit value.

Definition at line 1787 of file Target.h.

References lldb_private::Target::Hook::m_trigger_mask.

◆ GetCommands()

StringList & lldb_private::Target::HookCommandLine::GetCommands ( )
inline

Return the list of commands that this hook runs.

Definition at line 1793 of file Target.h.

References m_commands.

Referenced by HandleModuleLoaded(), HandleStop(), SetActionFromString(), and SetActionFromStrings().

◆ GetDescription()

◆ HandleModuleLoaded()

◆ HandleModuleUnloaded()

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

Reimplemented from lldb_private::Target::Hook.

Definition at line 4493 of file Target.cpp.

References HandleModuleLoaded().

◆ HandleStop()

◆ RemoveTrigger()

void lldb_private::Target::HookCommandLine::RemoveTrigger ( uint32_t trigger)
inline

Remove a trigger from the mask. trigger is a single TriggerBit value.

Definition at line 1790 of file Target.h.

References lldb_private::Target::Hook::m_trigger_mask.

◆ SetActionFromString()

void Target::HookCommandLine::SetActionFromString ( const std::string & string)

Populate the command list by splitting a single string on newlines.

Definition at line 4449 of file Target.cpp.

References GetCommands().

◆ SetActionFromStrings()

void Target::HookCommandLine::SetActionFromStrings ( const std::vector< std::string > & strings)

Populate the command list from a vector of individual command strings.

Definition at line 4453 of file Target.cpp.

References GetCommands().

◆ SetTriggerMask()

void lldb_private::Target::HookCommandLine::SetTriggerMask ( uint32_t mask)
inline

Replace the trigger mask. mask is a bitwise OR of TriggerBit values.

Definition at line 1784 of file Target.h.

References lldb_private::Target::Hook::m_trigger_mask.

◆ Target

friend class Target
friend

Definition at line 1812 of file Target.h.

References Target.

Referenced by Target.

Member Data Documentation

◆ m_commands

StringList lldb_private::Target::HookCommandLine::m_commands
private

Definition at line 1808 of file Target.h.

Referenced by GetCommands(), GetDescription(), HandleModuleLoaded(), and HandleStop().


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