LLDB  mainline
Classes | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
lldb_private::UnixSignals Class Reference

#include <UnixSignals.h>

Inheritance diagram for lldb_private::UnixSignals:
Inheritance graph
[legend]
Collaboration diagram for lldb_private::UnixSignals:
Collaboration graph
[legend]

Classes

struct  Signal
 

Public Member Functions

 UnixSignals ()
 
virtual ~UnixSignals ()
 
const char * GetSignalAsCString (int32_t signo) const
 
bool SignalIsValid (int32_t signo) const
 
int32_t GetSignalNumberFromName (const char *name) const
 
const char * GetSignalInfo (int32_t signo, bool &should_suppress, bool &should_stop, bool &should_notify) const
 
bool GetShouldSuppress (int32_t signo) const
 
bool SetShouldSuppress (int32_t signo, bool value)
 
bool SetShouldSuppress (const char *signal_name, bool value)
 
bool GetShouldStop (int32_t signo) const
 
bool SetShouldStop (int32_t signo, bool value)
 
bool SetShouldStop (const char *signal_name, bool value)
 
bool GetShouldNotify (int32_t signo) const
 
bool SetShouldNotify (int32_t signo, bool value)
 
bool SetShouldNotify (const char *signal_name, bool value)
 
bool ResetSignal (int32_t signo, bool reset_stop=true, bool reset_notify=true, bool reset_suppress=true)
 
int32_t GetFirstSignalNumber () const
 
int32_t GetNextSignalNumber (int32_t current_signal) const
 
int32_t GetNumSignals () const
 
int32_t GetSignalAtIndex (int32_t index) const
 
ConstString GetShortName (ConstString name) const
 
void AddSignal (int signo, const char *name, bool default_suppress, bool default_stop, bool default_notify, const char *description, const char *alias=nullptr)
 
void RemoveSignal (int signo)
 
void IncrementSignalHitCount (int signo)
 Track how many times signals are hit as stop reasons. More...
 
llvm::json::Value GetHitCountStatistics () const
 Get the hit count statistics for signals. More...
 
uint64_t GetVersion () const
 
std::vector< int32_t > GetFilteredSignals (llvm::Optional< bool > should_suppress, llvm::Optional< bool > should_stop, llvm::Optional< bool > should_notify)
 

Static Public Member Functions

static lldb::UnixSignalsSP Create (const ArchSpec &arch)
 
static lldb::UnixSignalsSP CreateForHost ()
 

Protected Types

typedef std::map< int32_t, Signalcollection
 

Protected Member Functions

virtual void Reset ()
 
 UnixSignals (const UnixSignals &rhs)
 
const UnixSignalsoperator= (const UnixSignals &rhs)=delete
 

Protected Attributes

collection m_signals
 
uint64_t m_version = 0
 

Detailed Description

Definition at line 23 of file UnixSignals.h.

Member Typedef Documentation

◆ collection

typedef std::map<int32_t, Signal> lldb_private::UnixSignals::collection
protected

Definition at line 131 of file UnixSignals.h.

Constructor & Destructor Documentation

◆ UnixSignals() [1/2]

UnixSignals::UnixSignals ( )

Definition at line 63 of file UnixSignals.cpp.

References Reset().

◆ ~UnixSignals()

UnixSignals::~UnixSignals ( )
virtualdefault

◆ UnixSignals() [2/2]

UnixSignals::UnixSignals ( const UnixSignals rhs)
protected

Definition at line 65 of file UnixSignals.cpp.

Member Function Documentation

◆ AddSignal()

void UnixSignals::AddSignal ( int  signo,
const char *  name,
bool  default_suppress,
bool  default_stop,
bool  default_notify,
const char *  description,
const char *  alias = nullptr 
)

◆ Create()

lldb::UnixSignalsSP UnixSignals::Create ( const ArchSpec arch)
static

◆ CreateForHost()

lldb::UnixSignalsSP UnixSignals::CreateForHost ( )
static

◆ GetFilteredSignals()

std::vector< int32_t > UnixSignals::GetFilteredSignals ( llvm::Optional< bool should_suppress,
llvm::Optional< bool should_stop,
llvm::Optional< bool should_notify 
)

◆ GetFirstSignalNumber()

int32_t UnixSignals::GetFirstSignalNumber ( ) const

Definition at line 167 of file UnixSignals.cpp.

References LLDB_INVALID_SIGNAL_NUMBER, and m_signals.

Referenced by GetFilteredSignals().

◆ GetHitCountStatistics()

json::Value UnixSignals::GetHitCountStatistics ( ) const

Get the hit count statistics for signals.

Gettings statistics on the hit counts of signals can help explain why some debug sessions are slow since each stop takes a few hundred ms and some software use signals a lot and can cause slow debugging performance if they are used too often. Even if a signal is not stopped at, it will auto continue the process and a delay will happen.

Definition at line 324 of file UnixSignals.cpp.

References m_signals.

◆ GetNextSignalNumber()

int32_t UnixSignals::GetNextSignalNumber ( int32_t  current_signal) const

Definition at line 174 of file UnixSignals.cpp.

References LLDB_INVALID_SIGNAL_NUMBER, and m_signals.

Referenced by GetFilteredSignals().

◆ GetNumSignals()

int32_t UnixSignals::GetNumSignals ( ) const

Definition at line 275 of file UnixSignals.cpp.

References m_signals.

◆ GetShortName()

ConstString UnixSignals::GetShortName ( ConstString  name) const

Definition at line 143 of file UnixSignals.cpp.

References lldb_private::ConstString::GetStringRef().

Referenced by GetSignalNumberFromName().

◆ GetShouldNotify()

bool UnixSignals::GetShouldNotify ( int32_t  signo) const

Definition at line 251 of file UnixSignals.cpp.

References m_signals.

◆ GetShouldStop()

bool UnixSignals::GetShouldStop ( int32_t  signo) const

Definition at line 227 of file UnixSignals.cpp.

References m_signals.

◆ GetShouldSuppress()

bool UnixSignals::GetShouldSuppress ( int32_t  signo) const

Definition at line 203 of file UnixSignals.cpp.

References m_signals.

◆ GetSignalAsCString()

const char * UnixSignals::GetSignalAsCString ( int32_t  signo) const

Definition at line 131 of file UnixSignals.cpp.

References m_signals.

◆ GetSignalAtIndex()

int32_t UnixSignals::GetSignalAtIndex ( int32_t  index) const

Definition at line 277 of file UnixSignals.cpp.

References LLDB_INVALID_SIGNAL_NUMBER, and m_signals.

◆ GetSignalInfo()

const char * UnixSignals::GetSignalInfo ( int32_t  signo,
bool should_suppress,
bool should_stop,
bool should_notify 
) const

◆ GetSignalNumberFromName()

int32_t UnixSignals::GetSignalNumberFromName ( const char *  name) const

◆ GetVersion()

uint64_t UnixSignals::GetVersion ( ) const

Definition at line 285 of file UnixSignals.cpp.

References m_version.

◆ IncrementSignalHitCount()

void UnixSignals::IncrementSignalHitCount ( int  signo)

Track how many times signals are hit as stop reasons.

Definition at line 318 of file UnixSignals.cpp.

References m_signals.

◆ operator=()

const UnixSignals& lldb_private::UnixSignals::operator= ( const UnixSignals rhs)
protecteddelete

◆ RemoveSignal()

void UnixSignals::RemoveSignal ( int  signo)

Definition at line 124 of file UnixSignals.cpp.

References m_signals, and m_version.

◆ Reset()

void UnixSignals::Reset ( )
protectedvirtual

◆ ResetSignal()

bool UnixSignals::ResetSignal ( int32_t  signo,
bool  reset_stop = true,
bool  reset_notify = true,
bool  reset_suppress = true 
)

Definition at line 345 of file UnixSignals.cpp.

References m_signals.

◆ SetShouldNotify() [1/2]

bool UnixSignals::SetShouldNotify ( const char *  signal_name,
bool  value 
)

◆ SetShouldNotify() [2/2]

bool lldb_private::UnixSignals::SetShouldNotify ( int32_t  signo,
bool  value 
)

Referenced by SetShouldNotify().

◆ SetShouldStop() [1/2]

bool UnixSignals::SetShouldStop ( const char *  signal_name,
bool  value 
)

◆ SetShouldStop() [2/2]

bool lldb_private::UnixSignals::SetShouldStop ( int32_t  signo,
bool  value 
)

Referenced by SetShouldStop().

◆ SetShouldSuppress() [1/2]

bool UnixSignals::SetShouldSuppress ( const char *  signal_name,
bool  value 
)

◆ SetShouldSuppress() [2/2]

bool lldb_private::UnixSignals::SetShouldSuppress ( int32_t  signo,
bool  value 
)

Referenced by SetShouldSuppress().

◆ SignalIsValid()

bool UnixSignals::SignalIsValid ( int32_t  signo) const

Definition at line 139 of file UnixSignals.cpp.

References m_signals.

Member Data Documentation

◆ m_signals

collection lldb_private::UnixSignals::m_signals
protected

◆ m_version

uint64_t lldb_private::UnixSignals::m_version = 0
protected

Definition at line 139 of file UnixSignals.h.

Referenced by AddSignal(), GetVersion(), and RemoveSignal().


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