LLDB mainline
|
#include <UnixSignals.h>
Classes | |
struct | Signal |
struct | SignalCode |
Public Types | |
enum | SignalCodePrintOption { None , Address , Bounds } |
Public Member Functions | |
UnixSignals () | |
virtual | ~UnixSignals () |
llvm::StringRef | GetSignalAsStringRef (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 |
bool | GetSignalInfo (int32_t signo, bool &should_suppress, bool &should_stop, bool &should_notify) const |
Gets the information for a particular signal. | |
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 |
void | AddSignal (int signo, llvm::StringRef name, bool default_suppress, bool default_stop, bool default_notify, llvm::StringRef description, llvm::StringRef alias=llvm::StringRef()) |
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, Signal > | collection |
Protected Member Functions | |
llvm::StringRef | GetShortName (llvm::StringRef name) const |
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 22 of file UnixSignals.h.
|
protected |
Definition at line 173 of file UnixSignals.h.
Enumerator | |
---|---|
None | |
Address | |
Bounds |
Definition at line 108 of file UnixSignals.h.
UnixSignals::UnixSignals | ( | ) |
Definition at line 51 of file UnixSignals.cpp.
References Reset().
|
virtualdefault |
|
protected |
Definition at line 53 of file UnixSignals.cpp.
void UnixSignals::AddSignal | ( | int | signo, |
llvm::StringRef | name, | ||
bool | default_suppress, | ||
bool | default_stop, | ||
bool | default_notify, | ||
llvm::StringRef | description, | ||
llvm::StringRef | alias = llvm::StringRef() |
||
) |
Definition at line 103 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(), and lldb_private::NetBSDSignals::Reset().
void UnixSignals::AddSignalCode | ( | int | signo, |
int | code, | ||
const llvm::StringLiteral | description, | ||
SignalCodePrintOption | print_option = SignalCodePrintOption::None |
||
) |
Definition at line 113 of file UnixSignals.cpp.
|
static |
Definition at line 29 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 44 of file UnixSignals.cpp.
References Create().
Referenced by GetCrashReasonString(), 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 334 of file UnixSignals.cpp.
References GetFirstSignalNumber(), GetNextSignalNumber(), GetSignalInfo(), and LLDB_INVALID_SIGNAL_NUMBER.
int32_t UnixSignals::GetFirstSignalNumber | ( | ) | const |
Definition at line 215 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 370 of file UnixSignals.cpp.
References m_signals.
int32_t UnixSignals::GetNextSignalNumber | ( | int32_t | current_signal | ) | const |
Definition at line 222 of file UnixSignals.cpp.
References LLDB_INVALID_SIGNAL_NUMBER, and m_signals.
Referenced by GetFilteredSignals().
int32_t UnixSignals::GetNumSignals | ( | ) | const |
Definition at line 321 of file UnixSignals.cpp.
References m_signals.
|
protected |
Definition at line 194 of file UnixSignals.cpp.
Referenced by GetSignalNumberFromName().
bool UnixSignals::GetShouldNotify | ( | int32_t | signo | ) | const |
Definition at line 297 of file UnixSignals.cpp.
References m_signals.
bool UnixSignals::GetShouldStop | ( | int32_t | signo | ) | const |
Definition at line 273 of file UnixSignals.cpp.
References m_signals.
bool UnixSignals::GetShouldSuppress | ( | int32_t | signo | ) | const |
Definition at line 249 of file UnixSignals.cpp.
References m_signals.
llvm::StringRef UnixSignals::GetSignalAsStringRef | ( | int32_t | signo | ) | const |
Definition at line 131 of file UnixSignals.cpp.
References m_signals.
int32_t UnixSignals::GetSignalAtIndex | ( | int32_t | index | ) | const |
Definition at line 323 of file UnixSignals.cpp.
References LLDB_INVALID_SIGNAL_NUMBER, and m_signals.
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 |
Definition at line 139 of file UnixSignals.cpp.
References Address, Bounds, lldb_private::UnixSignals::SignalCode::m_description, lldb_private::UnixSignals::SignalCode::m_print_option, m_signals, and None.
bool UnixSignals::GetSignalInfo | ( | int32_t | signo, |
bool & | should_suppress, | ||
bool & | should_stop, | ||
bool & | should_notify | ||
) | const |
Gets the information for a particular signal.
GetSignalInfo takes a signal number and populates 3 out parameters describing how lldb should react when a particular signal is received in the inferior.
[in] | signo | The signal number to get information about. |
[out] | should_suppress | Should we suppress this signal? |
[out] | should_stop | Should we stop if this signal is received? |
[out] | should_notify | Should we notify the user if this signal is received? |
Definition at line 236 of file UnixSignals.cpp.
References 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 198 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 331 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 364 of file UnixSignals.cpp.
References m_signals.
|
protecteddelete |
void UnixSignals::RemoveSignal | ( | int | signo | ) |
Definition at line 124 of file UnixSignals.cpp.
|
protectedvirtual |
Reimplemented in lldb_private::FreeBSDSignals, lldb_private::GDBRemoteSignals, lldb_private::LinuxSignals, and lldb_private::NetBSDSignals.
Definition at line 57 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 390 of file UnixSignals.cpp.
References m_signals.
bool UnixSignals::SetShouldNotify | ( | const char * | signal_name, |
bool | value | ||
) |
Definition at line 314 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 290 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 266 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 190 of file UnixSignals.cpp.
References m_signals.
|
protected |
Definition at line 175 of file UnixSignals.h.
Referenced by AddSignal(), AddSignalCode(), GetFirstSignalNumber(), GetHitCountStatistics(), GetNextSignalNumber(), GetNumSignals(), GetShouldNotify(), GetShouldStop(), GetShouldSuppress(), GetSignalAsStringRef(), GetSignalAtIndex(), GetSignalDescription(), GetSignalInfo(), GetSignalNumberFromName(), IncrementSignalHitCount(), RemoveSignal(), Reset(), lldb_private::GDBRemoteSignals::Reset(), lldb_private::LinuxSignals::Reset(), ResetSignal(), and SignalIsValid().
|
protected |
Definition at line 181 of file UnixSignals.h.
Referenced by AddSignal(), AddSignalCode(), GetVersion(), and RemoveSignal().