LLDB mainline
Classes | Public Types | 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]

Classes

struct  Signal
 
struct  SignalCode
 

Public Types

enum  SignalCodePrintOption { None , Address , Bounds }
 

Public Member Functions

 UnixSignals ()
 
virtual ~UnixSignals ()
 
const char * GetSignalAsCString (int32_t signo) const
 
std::string GetSignalDescription (int32_t signo, std::optional< int32_t > code=std::nullopt, std::optional< lldb::addr_t > addr=std::nullopt, std::optional< lldb::addr_t > lower=std::nullopt, std::optional< lldb::addr_t > upper=std::nullopt) 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 AddSignalCode (int signo, int code, const llvm::StringLiteral description, SignalCodePrintOption print_option=SignalCodePrintOption::None)
 
void RemoveSignal (int signo)
 
void IncrementSignalHitCount (int signo)
 Track how many times signals are hit as stop reasons.
 
llvm::json::Value GetHitCountStatistics () const
 Get the hit count statistics for signals.
 
uint64_t GetVersion () const
 
std::vector< int32_t > GetFilteredSignals (std::optional< bool > should_suppress, std::optional< bool > should_stop, std::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 152 of file UnixSignals.h.

Member Enumeration Documentation

◆ SignalCodePrintOption

Enumerator
None 
Address 
Bounds 

Definition at line 92 of file UnixSignals.h.

Constructor & Destructor Documentation

◆ UnixSignals() [1/2]

UnixSignals::UnixSignals ( )

Definition at line 55 of file UnixSignals.cpp.

References Reset().

◆ ~UnixSignals()

UnixSignals::~UnixSignals ( )
virtualdefault

◆ UnixSignals() [2/2]

UnixSignals::UnixSignals ( const UnixSignals rhs)
protected

Definition at line 57 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 
)

◆ AddSignalCode()

void UnixSignals::AddSignalCode ( int  signo,
int  code,
const llvm::StringLiteral  description,
SignalCodePrintOption  print_option = SignalCodePrintOption::None 
)

Definition at line 116 of file UnixSignals.cpp.

References m_signals, and m_version.

◆ Create()

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

◆ CreateForHost()

lldb::UnixSignalsSP UnixSignals::CreateForHost ( )
static

◆ GetFilteredSignals()

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

◆ GetFirstSignalNumber()

int32_t UnixSignals::GetFirstSignalNumber ( ) const

Definition at line 222 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 379 of file UnixSignals.cpp.

References m_signals.

◆ GetNextSignalNumber()

int32_t UnixSignals::GetNextSignalNumber ( int32_t  current_signal) const

Definition at line 229 of file UnixSignals.cpp.

References LLDB_INVALID_SIGNAL_NUMBER, and m_signals.

Referenced by GetFilteredSignals().

◆ GetNumSignals()

int32_t UnixSignals::GetNumSignals ( ) const

Definition at line 330 of file UnixSignals.cpp.

References m_signals.

◆ GetShortName()

ConstString UnixSignals::GetShortName ( ConstString  name) const

Definition at line 198 of file UnixSignals.cpp.

References lldb_private::ConstString::GetStringRef().

Referenced by GetSignalNumberFromName().

◆ GetShouldNotify()

bool UnixSignals::GetShouldNotify ( int32_t  signo) const

Definition at line 306 of file UnixSignals.cpp.

References m_signals.

◆ GetShouldStop()

bool UnixSignals::GetShouldStop ( int32_t  signo) const

Definition at line 282 of file UnixSignals.cpp.

References m_signals.

◆ GetShouldSuppress()

bool UnixSignals::GetShouldSuppress ( int32_t  signo) const

Definition at line 258 of file UnixSignals.cpp.

References m_signals.

◆ GetSignalAsCString()

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

Definition at line 134 of file UnixSignals.cpp.

References m_signals.

◆ GetSignalAtIndex()

int32_t UnixSignals::GetSignalAtIndex ( int32_t  index) const

Definition at line 332 of file UnixSignals.cpp.

References LLDB_INVALID_SIGNAL_NUMBER, and m_signals.

◆ GetSignalDescription()

std::string UnixSignals::GetSignalDescription ( int32_t  signo,
std::optional< int32_t >  code = std::nullopt,
std::optional< lldb::addr_t addr = std::nullopt,
std::optional< lldb::addr_t lower = std::nullopt,
std::optional< lldb::addr_t upper = std::nullopt 
) const

◆ 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 340 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 373 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 127 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 400 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 194 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 160 of file UnixSignals.h.

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


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