|
LLDB mainline
|
#include <UnixSignals.h>
Classes | |
| struct | Signal |
| struct | SignalCode |
Public Types | |
| enum | SignalCodePrintOption { None , Address , Bounds , Sender } |
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, std::optional< uint32_t > pid=std::nullopt, std::optional< uint32_t > uid=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 175 of file UnixSignals.h.
| Enumerator | |
|---|---|
| None | |
| Address | |
| Bounds | |
| Sender | |
Definition at line 110 of file UnixSignals.h.
| UnixSignals::UnixSignals | ( | ) |
Definition at line 53 of file UnixSignals.cpp.
References Reset().
Referenced by lldb_private::FreeBSDSignals::FreeBSDSignals(), lldb_private::GDBRemoteSignals::GDBRemoteSignals(), lldb_private::GDBRemoteSignals::GDBRemoteSignals(), lldb_private::LinuxSignals::LinuxSignals(), lldb_private::NetBSDSignals::NetBSDSignals(), lldb_private::OpenBSDSignals::OpenBSDSignals(), operator=(), and UnixSignals().
|
virtualdefault |
|
protected |
Definition at line 55 of file UnixSignals.cpp.
References m_signals, and UnixSignals().
| 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 105 of file UnixSignals.cpp.
References m_signals, and m_version.
Referenced by lldb_private::FreeBSDSignals::Reset(), lldb_private::GDBRemoteSignals::Reset(), lldb_private::NetBSDSignals::Reset(), lldb_private::OpenBSDSignals::Reset(), and Reset().
| void UnixSignals::AddSignalCode | ( | int | signo, |
| int | code, | ||
| const llvm::StringLiteral | description, | ||
| SignalCodePrintOption | print_option = SignalCodePrintOption::None ) |
Definition at line 115 of file UnixSignals.cpp.
|
static |
Definition at line 30 of file UnixSignals.cpp.
References lldb_private::ArchSpec::GetTriple().
Referenced by CreateForHost(), lldb_private::process_gdb_remote::ProcessGDBRemote::DidLaunchOrAttach(), lldb_private::minidump::ProcessMinidump::DoLoadCore(), ProcessElfCore::DoLoadCore(), lldb_private::platform_gdb_server::PlatformRemoteGDBServer::GetRemoteUnixSignals(), and lldb_private::wasm::ProcessWasm::ProcessWasm().
|
static |
Definition at line 46 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 340 of file UnixSignals.cpp.
References GetFirstSignalNumber(), GetNextSignalNumber(), GetSignalInfo(), and LLDB_INVALID_SIGNAL_NUMBER.
| int32_t UnixSignals::GetFirstSignalNumber | ( | ) | const |
Definition at line 221 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 376 of file UnixSignals.cpp.
References m_signals.
| int32_t UnixSignals::GetNextSignalNumber | ( | int32_t | current_signal | ) | const |
Definition at line 228 of file UnixSignals.cpp.
References LLDB_INVALID_SIGNAL_NUMBER, and m_signals.
Referenced by GetFilteredSignals().
| int32_t UnixSignals::GetNumSignals | ( | ) | const |
Definition at line 327 of file UnixSignals.cpp.
References m_signals.
|
protected |
Definition at line 200 of file UnixSignals.cpp.
Referenced by GetSignalNumberFromName().
| bool UnixSignals::GetShouldNotify | ( | int32_t | signo | ) | const |
Definition at line 303 of file UnixSignals.cpp.
References m_signals.
| bool UnixSignals::GetShouldStop | ( | int32_t | signo | ) | const |
Definition at line 279 of file UnixSignals.cpp.
References m_signals.
| bool UnixSignals::GetShouldSuppress | ( | int32_t | signo | ) | const |
Definition at line 255 of file UnixSignals.cpp.
References m_signals.
| llvm::StringRef UnixSignals::GetSignalAsStringRef | ( | int32_t | signo | ) | const |
Definition at line 133 of file UnixSignals.cpp.
References m_signals.
| int32_t UnixSignals::GetSignalAtIndex | ( | int32_t | index | ) | const |
Definition at line 329 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, | ||
| std::optional< uint32_t > | pid = std::nullopt, | ||
| std::optional< uint32_t > | uid = std::nullopt ) const |
Definition at line 140 of file UnixSignals.cpp.
References Address, Bounds, lldb_private::UnixSignals::SignalCode::m_description, lldb_private::UnixSignals::SignalCode::m_print_option, m_signals, None, and Sender.
Referenced by GetDescriptionFromSiginfo().
| 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 242 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 204 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 337 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 370 of file UnixSignals.cpp.
References m_signals.
|
protecteddelete |
References UnixSignals().
| void UnixSignals::RemoveSignal | ( | int | signo | ) |
Definition at line 126 of file UnixSignals.cpp.
|
protectedvirtual |
Reimplemented in lldb_private::FreeBSDSignals, lldb_private::GDBRemoteSignals, lldb_private::LinuxSignals, lldb_private::NetBSDSignals, and lldb_private::OpenBSDSignals.
Definition at line 59 of file UnixSignals.cpp.
References AddSignal(), and m_signals.
Referenced by lldb_private::FreeBSDSignals::Reset(), lldb_private::NetBSDSignals::Reset(), lldb_private::OpenBSDSignals::Reset(), and UnixSignals().
| bool UnixSignals::ResetSignal | ( | int32_t | signo, |
| bool | reset_stop = true, | ||
| bool | reset_notify = true, | ||
| bool | reset_suppress = true ) |
Definition at line 396 of file UnixSignals.cpp.
References m_signals.
Definition at line 320 of file UnixSignals.cpp.
References GetSignalNumberFromName(), LLDB_INVALID_SIGNAL_NUMBER, and SetShouldNotify().
Referenced by SetShouldNotify().
Definition at line 296 of file UnixSignals.cpp.
References GetSignalNumberFromName(), LLDB_INVALID_SIGNAL_NUMBER, and SetShouldStop().
Referenced by SetShouldStop().
Definition at line 272 of file UnixSignals.cpp.
References GetSignalNumberFromName(), LLDB_INVALID_SIGNAL_NUMBER, and SetShouldSuppress().
Referenced by SetShouldSuppress().
| bool UnixSignals::SignalIsValid | ( | int32_t | signo | ) | const |
Definition at line 196 of file UnixSignals.cpp.
References m_signals.
|
protected |
Definition at line 177 of file UnixSignals.h.
Referenced by AddSignal(), AddSignalCode(), GetFirstSignalNumber(), GetHitCountStatistics(), GetNextSignalNumber(), GetNumSignals(), GetShouldNotify(), GetShouldStop(), GetShouldSuppress(), GetSignalAsStringRef(), GetSignalAtIndex(), GetSignalDescription(), GetSignalInfo(), GetSignalNumberFromName(), IncrementSignalHitCount(), RemoveSignal(), lldb_private::GDBRemoteSignals::Reset(), lldb_private::LinuxSignals::Reset(), Reset(), ResetSignal(), SignalIsValid(), and UnixSignals().
|
protected |
Definition at line 183 of file UnixSignals.h.
Referenced by AddSignal(), AddSignalCode(), GetVersion(), and RemoveSignal().