|
LLDB mainline
|
#include <Target.h>
Public Types | |
| 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... | |
Public Member Functions | |
| Hook (const Hook &rhs) | |
| virtual | ~Hook ()=default |
| HookKind | GetHookKind () const |
| lldb::TargetSP & | GetTarget () |
| 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. | |
| SymbolContextSpecifier * | GetSCSpecifier () |
| 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. | |
| ThreadSpec * | GetThreadSpecifier () |
| 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 |
| virtual void | HandleModuleLoaded (lldb::StreamSP output) |
| virtual void | HandleModuleUnloaded (lldb::StreamSP output) |
| virtual StopHook::StopHookResult | HandleStop (ExecutionContext &exe_ctx, lldb::StreamSP output) |
| Called when the process stops. | |
| virtual void | GetDescription (Stream &s, lldb::DescriptionLevel level) 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. | |
Protected Member Functions | |
| 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 | |
| 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< ThreadSpec > | m_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. | |
|
strong |
| enum lldb_private::Target::Hook::TriggerBit : uint32_t |
| Target::Hook::Hook | ( | const Hook & | rhs | ) |
Definition at line 4326 of file Target.cpp.
References lldb_private::UserID::GetID(), Hook(), m_at_initial_stop, m_auto_continue, m_enabled, m_kind, m_sc_specifier_sp, m_suppress_output, m_target_sp, m_thread_spec_up, m_trigger_mask, and lldb_private::UserID::UserID().
Referenced by Hook(), lldb_private::Target::HookCommandLine::HookCommandLine(), and lldb_private::Target::HookScripted::HookScripted().
|
virtualdefault |
|
protected |
Definition at line 4323 of file Target.cpp.
References m_kind, m_target_sp, and lldb_private::UserID::UserID().
| bool Target::Hook::ExecutionContextPasses | ( | const ExecutionContext & | exe_ctx | ) |
Check if the execution context passes the specifier and thread spec filters.
Always returns true if no filters are set.
Definition at line 4345 of file Target.cpp.
References lldb_private::ExecutionContext::GetFramePtr(), GetSCSpecifier(), lldb_private::StackFrame::GetSymbolContext(), lldb_private::ExecutionContext::GetThreadRef(), GetThreadSpecifier(), and lldb_private::SymbolContextSpecifier::SymbolContextMatches().
|
inline |
Return true if this hook fires on the given trigger.
Definition at line 1710 of file Target.h.
References m_trigger_mask.
|
inline |
Definition at line 1736 of file Target.h.
References m_auto_continue.
|
virtual |
Reimplemented in lldb_private::Target::HookCommandLine, and lldb_private::Target::HookScripted.
Definition at line 4361 of file Target.cpp.
References lldb::eDescriptionLevelBrief, lldb_private::UserID::GetID(), lldb_private::Stream::Indent(), lldb_private::Stream::IndentLess(), lldb_private::Stream::IndentMore(), kModulesLoaded, kModulesUnloaded, kProcessStop, m_enabled, m_trigger_mask, and lldb_private::Stream::Printf().
Referenced by lldb_private::Target::HookCommandLine::GetDescription(), and lldb_private::Target::HookScripted::GetDescription().
|
protected |
Print the filter portion of the description (AutoContinue, Specifier, ThreadSpec).
Called by subclass GetDescription after printing the hook-specific content (commands or class).
Definition at line 4394 of file Target.cpp.
References lldb_private::StreamString::GetString(), lldb_private::Stream::Indent(), lldb_private::Stream::IndentLess(), lldb_private::Stream::IndentMore(), m_auto_continue, m_sc_specifier_sp, m_thread_spec_up, and lldb_private::Stream::PutCString().
Referenced by lldb_private::Target::HookCommandLine::GetDescription(), and lldb_private::Target::HookScripted::GetDescription().
|
inline |
|
inline |
Definition at line 1729 of file Target.h.
References m_at_initial_stop.
|
inline |
Definition at line 1716 of file Target.h.
References m_sc_specifier_sp.
Referenced by ExecutionContextPasses().
|
inline |
Definition at line 1741 of file Target.h.
References m_suppress_output.
|
inline |
Definition at line 1700 of file Target.h.
References m_target_sp.
Referenced by lldb_private::Target::HookCommandLine::HandleModuleLoaded(), and lldb_private::Target::HookScripted::SetScriptCallback().
|
inline |
Definition at line 1724 of file Target.h.
References m_thread_spec_up.
Referenced by ExecutionContextPasses().
|
inline |
Return the bitmask of triggers this hook responds to.
Each bit corresponds to a TriggerBit value.
Definition at line 1707 of file Target.h.
References m_trigger_mask.
|
inlinevirtual |
Reimplemented in lldb_private::Target::HookCommandLine, and lldb_private::Target::HookScripted.
|
inlinevirtual |
Reimplemented in lldb_private::Target::HookCommandLine, and lldb_private::Target::HookScripted.
|
inlinevirtual |
Called when the process stops.
Returns a StopHookResult indicating whether the process should remain stopped or continue.
Reimplemented in lldb_private::Target::HookCommandLine, and lldb_private::Target::HookScripted.
Definition at line 1750 of file Target.h.
References lldb_private::Target::StopHook::NoPreference.
|
inline |
|
inline |
Definition at line 1733 of file Target.h.
References m_auto_continue.
|
inline |
|
inline |
Definition at line 1726 of file Target.h.
References m_at_initial_stop.
| void Target::Hook::SetSCSpecifier | ( | SymbolContextSpecifier * | specifier | ) |
Set the symbol context specifier. The hook takes ownership.
Definition at line 4337 of file Target.cpp.
References m_sc_specifier_sp.
|
inline |
Definition at line 1738 of file Target.h.
References m_suppress_output.
| void Target::Hook::SetThreadSpecifier | ( | ThreadSpec * | specifier | ) |
Set the thread specifier. The hook takes ownership.
Definition at line 4341 of file Target.cpp.
References m_thread_spec_up.
|
protected |
Definition at line 1770 of file Target.h.
Referenced by GetRunAtInitialStop(), Hook(), and SetRunAtInitialStop().
|
protected |
Definition at line 1773 of file Target.h.
Referenced by GetAutoContinue(), GetFilterDescription(), Hook(), and SetAutoContinue().
|
protected |
Definition at line 1764 of file Target.h.
Referenced by GetDescription(), Hook(), IsEnabled(), and SetIsEnabled().
|
protected |
Definition at line 1763 of file Target.h.
Referenced by GetHookKind(), Hook(), and Hook().
|
protected |
Definition at line 1768 of file Target.h.
Referenced by GetFilterDescription(), GetSCSpecifier(), Hook(), and SetSCSpecifier().
|
protected |
Definition at line 1774 of file Target.h.
Referenced by GetSuppressOutput(), Hook(), and SetSuppressOutput().
|
protected |
Definition at line 1762 of file Target.h.
Referenced by GetTarget(), Hook(), and Hook().
|
protected |
Definition at line 1769 of file Target.h.
Referenced by GetFilterDescription(), GetThreadSpecifier(), Hook(), and SetThreadSpecifier().
|
protected |
Definition at line 1765 of file Target.h.
Referenced by lldb_private::Target::HookCommandLine::AddTrigger(), FiresOn(), GetDescription(), GetTriggerMask(), Hook(), lldb_private::Target::HookCommandLine::RemoveTrigger(), lldb_private::Target::HookScripted::SetScriptCallback(), and lldb_private::Target::HookCommandLine::SetTriggerMask().