LLDB mainline
|
#include <UnixSignals.h>
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. | |
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, Signal > | collection |
Protected Member Functions | |
virtual void | Reset () |
UnixSignals (const UnixSignals &rhs) | |
const UnixSignals & | operator= (const UnixSignals &rhs)=delete |
Protected Attributes | |
collection | m_signals |
uint64_t | m_version = 0 |
Definition at line 23 of file UnixSignals.h.
|
protected |
Definition at line 131 of file UnixSignals.h.
UnixSignals::UnixSignals | ( | ) |
Definition at line 64 of file UnixSignals.cpp.
References Reset().
|
virtualdefault |
|
protected |
Definition at line 66 of file UnixSignals.cpp.
void UnixSignals::AddSignal | ( | int | signo, |
const char * | name, | ||
bool | default_suppress, | ||
bool | default_stop, | ||
bool | default_notify, | ||
const char * | description, | ||
const char * | alias = nullptr |
||
) |
Definition at line 116 of file UnixSignals.cpp.
References m_signals, and m_version.
Referenced by Reset(), lldb_private::FreeBSDSignals::Reset(), lldb_private::GDBRemoteSignals::Reset(), lldb_private::LinuxSignals::Reset(), lldb_private::MipsLinuxSignals::Reset(), and lldb_private::NetBSDSignals::Reset().
|
static |
Definition at line 33 of file UnixSignals.cpp.
References lldb_private::ArchSpec::GetTriple().
Referenced by CreateForHost(), lldb_private::process_gdb_remote::ProcessGDBRemote::DidLaunchOrAttach(), ProcessElfCore::DoLoadCore(), lldb_private::minidump::ProcessMinidump::DoLoadCore(), and lldb_private::platform_gdb_server::PlatformRemoteGDBServer::GetRemoteUnixSignals().
|
static |
Definition at line 57 of file UnixSignals.cpp.
References Create().
Referenced by lldb_private::Platform::GetUnixSignals(), and lldb_private::process_gdb_remote::GDBRemoteCommunicationServerPlatform::Handle_jSignalsInfo().
std::vector< int32_t > UnixSignals::GetFilteredSignals | ( | std::optional< bool > | should_suppress, |
std::optional< bool > | should_stop, | ||
std::optional< bool > | should_notify | ||
) |
Definition at line 289 of file UnixSignals.cpp.
References GetFirstSignalNumber(), GetNextSignalNumber(), GetSignalInfo(), and LLDB_INVALID_SIGNAL_NUMBER.
int32_t UnixSignals::GetFirstSignalNumber | ( | ) | const |
Definition at line 168 of file UnixSignals.cpp.
References LLDB_INVALID_SIGNAL_NUMBER, and m_signals.
Referenced by GetFilteredSignals().
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 325 of file UnixSignals.cpp.
References m_signals.
int32_t UnixSignals::GetNextSignalNumber | ( | int32_t | current_signal | ) | const |
Definition at line 175 of file UnixSignals.cpp.
References LLDB_INVALID_SIGNAL_NUMBER, and m_signals.
Referenced by GetFilteredSignals().
int32_t UnixSignals::GetNumSignals | ( | ) | const |
Definition at line 276 of file UnixSignals.cpp.
References m_signals.
ConstString UnixSignals::GetShortName | ( | ConstString | name | ) | const |
Definition at line 144 of file UnixSignals.cpp.
References lldb_private::ConstString::GetStringRef().
Referenced by GetSignalNumberFromName().
bool UnixSignals::GetShouldNotify | ( | int32_t | signo | ) | const |
Definition at line 252 of file UnixSignals.cpp.
References m_signals.
bool UnixSignals::GetShouldStop | ( | int32_t | signo | ) | const |
Definition at line 228 of file UnixSignals.cpp.
References m_signals.
bool UnixSignals::GetShouldSuppress | ( | int32_t | signo | ) | const |
Definition at line 204 of file UnixSignals.cpp.
References m_signals.
const char * UnixSignals::GetSignalAsCString | ( | int32_t | signo | ) | const |
Definition at line 132 of file UnixSignals.cpp.
References m_signals.
int32_t UnixSignals::GetSignalAtIndex | ( | int32_t | index | ) | const |
Definition at line 278 of file UnixSignals.cpp.
References LLDB_INVALID_SIGNAL_NUMBER, and m_signals.
const char * UnixSignals::GetSignalInfo | ( | int32_t | signo, |
bool & | should_suppress, | ||
bool & | should_stop, | ||
bool & | should_notify | ||
) | const |
Definition at line 189 of file UnixSignals.cpp.
References lldb_private::ConstString::AsCString(), lldb_private::UnixSignals::Signal::m_name, lldb_private::UnixSignals::Signal::m_notify, m_signals, lldb_private::UnixSignals::Signal::m_stop, and lldb_private::UnixSignals::Signal::m_suppress.
Referenced by GetFilteredSignals().
int32_t UnixSignals::GetSignalNumberFromName | ( | const char * | name | ) | const |
Definition at line 150 of file UnixSignals.cpp.
References GetShortName(), LLDB_INVALID_SIGNAL_NUMBER, and m_signals.
Referenced by SetShouldNotify(), SetShouldStop(), SetShouldSuppress(), and lldb_private::process_gdb_remote::GDBRemoteClientBase::ShouldStop().
uint64_t UnixSignals::GetVersion | ( | ) | const |
Definition at line 286 of file UnixSignals.cpp.
References m_version.
void UnixSignals::IncrementSignalHitCount | ( | int | signo | ) |
Track how many times signals are hit as stop reasons.
Definition at line 319 of file UnixSignals.cpp.
References m_signals.
|
protecteddelete |
void UnixSignals::RemoveSignal | ( | int | signo | ) |
Definition at line 125 of file UnixSignals.cpp.
|
protectedvirtual |
Reimplemented in lldb_private::FreeBSDSignals, lldb_private::GDBRemoteSignals, lldb_private::LinuxSignals, lldb_private::MipsLinuxSignals, and lldb_private::NetBSDSignals.
Definition at line 70 of file UnixSignals.cpp.
References AddSignal(), and m_signals.
Referenced by lldb_private::FreeBSDSignals::Reset(), lldb_private::NetBSDSignals::Reset(), and UnixSignals().
bool UnixSignals::ResetSignal | ( | int32_t | signo, |
bool | reset_stop = true , |
||
bool | reset_notify = true , |
||
bool | reset_suppress = true |
||
) |
Definition at line 346 of file UnixSignals.cpp.
References m_signals.
bool UnixSignals::SetShouldNotify | ( | const char * | signal_name, |
bool | value | ||
) |
Definition at line 269 of file UnixSignals.cpp.
References GetSignalNumberFromName(), LLDB_INVALID_SIGNAL_NUMBER, and SetShouldNotify().
bool lldb_private::UnixSignals::SetShouldNotify | ( | int32_t | signo, |
bool | value | ||
) |
Referenced by SetShouldNotify().
bool UnixSignals::SetShouldStop | ( | const char * | signal_name, |
bool | value | ||
) |
Definition at line 245 of file UnixSignals.cpp.
References GetSignalNumberFromName(), LLDB_INVALID_SIGNAL_NUMBER, and SetShouldStop().
bool lldb_private::UnixSignals::SetShouldStop | ( | int32_t | signo, |
bool | value | ||
) |
Referenced by SetShouldStop().
bool UnixSignals::SetShouldSuppress | ( | const char * | signal_name, |
bool | value | ||
) |
Definition at line 221 of file UnixSignals.cpp.
References GetSignalNumberFromName(), LLDB_INVALID_SIGNAL_NUMBER, and SetShouldSuppress().
bool lldb_private::UnixSignals::SetShouldSuppress | ( | int32_t | signo, |
bool | value | ||
) |
Referenced by SetShouldSuppress().
bool UnixSignals::SignalIsValid | ( | int32_t | signo | ) | const |
Definition at line 140 of file UnixSignals.cpp.
References m_signals.
|
protected |
Definition at line 133 of file UnixSignals.h.
Referenced by AddSignal(), GetFirstSignalNumber(), GetHitCountStatistics(), GetNextSignalNumber(), GetNumSignals(), GetShouldNotify(), GetShouldStop(), GetShouldSuppress(), GetSignalAsCString(), GetSignalAtIndex(), GetSignalInfo(), GetSignalNumberFromName(), IncrementSignalHitCount(), RemoveSignal(), Reset(), lldb_private::GDBRemoteSignals::Reset(), lldb_private::LinuxSignals::Reset(), lldb_private::MipsLinuxSignals::Reset(), ResetSignal(), and SignalIsValid().
|
protected |
Definition at line 139 of file UnixSignals.h.
Referenced by AddSignal(), GetVersion(), and RemoveSignal().