|
LLDB mainline
|
#include <NativeThreadLinux.h>
Private Types | |
| using | WatchpointIndexMap = std::map<lldb::addr_t, uint32_t> |
Private Member Functions | |
| Status | Resume (uint32_t signo) |
| Resumes the thread. | |
| Status | SingleStep (uint32_t signo) |
| Single steps the thread. | |
| void | SetStoppedBySignal (uint32_t signo, const siginfo_t *info=nullptr) |
| bool | IsStopped (int *signo) |
| Return true if the thread is stopped. | |
| void | SetStoppedByExec () |
| void | SetStoppedByBreakpoint () |
| void | SetStoppedByWatchpoint (uint32_t wp_index) |
| bool | IsStoppedAtBreakpoint () |
| bool | IsStoppedAtWatchpoint () |
| void | SetStoppedByTrace () |
| void | SetStoppedByFork (bool is_vfork, lldb::pid_t child_pid) |
| void | SetStoppedByVForkDone () |
| void | SetStoppedWithNoReason () |
| void | SetStoppedByProcessorTrace (llvm::StringRef description) |
| void | SetExited () |
| Status | RequestStop () |
| void | MaybeLogStateChange (lldb::StateType new_state) |
| void | SetStopped () |
| void | AnnotateSyncTagCheckFault (lldb::addr_t fault_addr) |
| Extend m_stop_description with logical and allocation tag values. | |
Private Attributes | |
| lldb::StateType | m_state |
| std::unique_ptr< NativeRegisterContextLinux > | m_reg_context_up |
| WatchpointIndexMap | m_watchpoint_index_map |
| WatchpointIndexMap | m_hw_break_index_map |
| std::unique_ptr< SingleStepWorkaround > | m_step_workaround |
Friends | |
| class | NativeProcessLinux |
Additional Inherited Members | |
| Protected Member Functions inherited from lldb_private::NativeThreadProtocol | |
| void | ClearStopInfo () |
| Protected Attributes inherited from lldb_private::NativeThreadProtocol | |
| NativeProcessProtocol & | m_process |
| lldb::tid_t | m_tid |
| ThreadStopInfo | m_stop_info = {} |
| std::string | m_stop_description |
Definition at line 29 of file NativeThreadLinux.h.
|
private |
Definition at line 118 of file NativeThreadLinux.h.
| NativeThreadLinux::NativeThreadLinux | ( | NativeProcessLinux & | process, |
| lldb::tid_t | tid ) |
Definition at line 91 of file NativeThreadLinux.cpp.
References lldb::eStateInvalid, m_reg_context_up, m_state, NativeProcessLinux, and lldb_private::NativeThreadProtocol::NativeThreadProtocol().
|
private |
Extend m_stop_description with logical and allocation tag values.
If there is an error along the way just add the information we were able to get.
Definition at line 303 of file NativeThreadLinux.cpp.
References lldb_private::MemoryTagManagerAArch64MTE::eMTE_allocation, lldb_private::process_linux::NativeRegisterContextLinux::GetMemoryTaggingDetails(), GetProcess(), GetRegisterContext(), lldb_private::NativeThreadProtocol::m_stop_description, lldb_private::process_linux::NativeProcessLinux::ReadMemoryTags(), and lldb_private::Status::Success().
Referenced by SetStoppedBySignal().
|
overridevirtual |
Implements lldb_private::NativeThreadProtocol.
Definition at line 98 of file NativeThreadLinux.cpp.
References lldb_private::NativeProcessProtocol::GetID(), lldb_private::NativeThreadProtocol::GetID(), GetProcess(), lldb_private::getProcFile(), and NativeProcessLinux.
| NativeProcessLinux & NativeThreadLinux::GetProcess | ( | ) |
Definition at line 530 of file NativeThreadLinux.cpp.
References lldb_private::NativeThreadProtocol::m_process, and NativeProcessLinux.
Referenced by AnnotateSyncTagCheckFault(), GetName(), GetSiginfo(), RequestStop(), Resume(), and SingleStep().
| const NativeProcessLinux & NativeThreadLinux::GetProcess | ( | ) | const |
Definition at line 534 of file NativeThreadLinux.cpp.
References lldb_private::NativeThreadProtocol::m_process, and NativeProcessLinux.
|
inlineoverridevirtual |
Implements lldb_private::NativeThreadProtocol.
Definition at line 43 of file NativeThreadLinux.h.
References m_reg_context_up.
Referenced by lldb_private::process_linux::NativeProcessLinux::AllocateMemory(), AnnotateSyncTagCheckFault(), lldb_private::process_linux::NativeProcessLinux::DeallocateMemory(), lldb_private::process_linux::NativeProcessLinux::ReadMemoryTags(), SetStopped(), and lldb_private::process_linux::NativeProcessLinux::WriteMemoryTags().
|
overridevirtual |
Reimplemented from lldb_private::NativeThreadProtocol.
Definition at line 539 of file NativeThreadLinux.cpp.
References error(), lldb_private::NativeThreadProtocol::GetID(), GetProcess(), and lldb_private::process_linux::NativeProcessLinux::GetSignalInfo().
|
overridevirtual |
Implements lldb_private::NativeThreadProtocol.
Definition at line 107 of file NativeThreadLinux.cpp.
References m_state.
Referenced by IsStoppedAtBreakpoint(), IsStoppedAtWatchpoint(), and lldb_private::process_linux::NativeProcessLinux::MonitorClone().
|
overridevirtual |
Implements lldb_private::NativeThreadProtocol.
Definition at line 109 of file NativeThreadLinux.cpp.
References lldb::eStateAttaching, lldb::eStateConnected, lldb::eStateCrashed, lldb::eStateDetached, lldb::eStateExited, lldb::eStateInvalid, lldb::eStateLaunching, lldb::eStateRunning, lldb::eStateStepping, lldb::eStateStopped, lldb::eStateSuspended, lldb::eStateUnloaded, lldb_private::NativeThreadProtocol::GetID(), lldb_private::GetLog(), LLDB_LOGF, m_state, lldb_private::NativeThreadProtocol::m_stop_description, lldb_private::NativeThreadProtocol::m_stop_info, lldb_private::StateAsCString(), and lldb_private::Thread.
|
private |
Return true if the thread is stopped.
If stopped by a signal, indicate the signo in the signo argument. Otherwise, return LLDB_INVALID_SIGNAL_NUMBER.
Definition at line 355 of file NativeThreadLinux.cpp.
References lldb::eStateStopped, lldb::eStopReasonSignal, m_state, lldb_private::NativeThreadProtocol::m_stop_info, and lldb_private::StateIsStoppedState().
|
private |
Definition at line 428 of file NativeThreadLinux.cpp.
References lldb::eStateStopped, lldb::eStopReasonBreakpoint, GetState(), and lldb_private::NativeThreadProtocol::m_stop_info.
|
private |
Definition at line 433 of file NativeThreadLinux.cpp.
References lldb::eStateStopped, lldb::eStopReasonWatchpoint, GetState(), and lldb_private::NativeThreadProtocol::m_stop_info.
|
private |
Definition at line 515 of file NativeThreadLinux.cpp.
References lldb_private::NativeThreadProtocol::GetID(), lldb_private::GetLog(), LLDB_LOG, lldb_private::NativeThreadProtocol::m_process, m_state, and lldb_private::Thread.
Referenced by Resume(), SetExited(), SetStopped(), and SingleStep().
|
overridevirtual |
Implements lldb_private::NativeThreadProtocol.
Definition at line 192 of file NativeThreadLinux.cpp.
References lldb_private::Status::FromErrorString(), m_hw_break_index_map, m_reg_context_up, and lldb_private::Status.
Referenced by SetHardwareBreakpoint().
|
overridevirtual |
Implements lldb_private::NativeThreadProtocol.
Definition at line 163 of file NativeThreadLinux.cpp.
References lldb_private::Status::FromErrorString(), m_reg_context_up, m_watchpoint_index_map, and lldb_private::Status.
Referenced by SetWatchpoint().
|
private |
Definition at line 489 of file NativeThreadLinux.cpp.
References lldb_private::Status::AsCString(), lldb_private::Status::FromErrno(), lldb_private::NativeProcessProtocol::GetID(), lldb_private::NativeThreadProtocol::GetID(), lldb_private::GetLog(), GetProcess(), LLDB_LOGF, NativeProcessLinux, SIGSTOP, tgkill, and lldb_private::Thread.
Referenced by lldb_private::process_linux::NativeProcessLinux::StopRunningThreads().
|
private |
Resumes the thread.
If signo is anything but LLDB_INVALID_SIGNAL_NUMBER, deliver that signal to the thread.
Definition at line 206 of file NativeThreadLinux.cpp.
References lldb_private::NativeThreadProtocol::ClearStopInfo(), lldb::eStateRunning, lldb_private::NativeProcessProtocol::GetHardwareBreakpointMap(), lldb_private::NativeThreadProtocol::GetID(), GetProcess(), lldb_private::NativeProcessProtocol::GetWatchpointMap(), LLDB_INVALID_SIGNAL_NUMBER, m_hw_break_index_map, m_reg_context_up, m_state, m_watchpoint_index_map, MaybeLogStateChange(), NativeProcessLinux, lldb_private::process_linux::NativeProcessLinux::PtraceWrapper(), SetHardwareBreakpoint(), and SetWatchpoint().
|
private |
Definition at line 481 of file NativeThreadLinux.cpp.
References lldb::eStateExited, lldb::eStopReasonThreadExiting, m_state, lldb_private::NativeThreadProtocol::m_stop_info, and MaybeLogStateChange().
|
overridevirtual |
Implements lldb_private::NativeThreadProtocol.
Definition at line 174 of file NativeThreadLinux.cpp.
References error(), lldb::eStateLaunching, lldb_private::Status::FromErrorString(), LLDB_INVALID_INDEX32, m_hw_break_index_map, m_reg_context_up, m_state, RemoveHardwareBreakpoint(), and lldb_private::Status.
Referenced by Resume().
|
private |
Definition at line 369 of file NativeThreadLinux.cpp.
References lldb::eStateStepping, lldb::eStateStopped, GetRegisterContext(), lldb_private::NativeRegisterContextRegisterInfo::InvalidateAllRegisters(), m_state, m_step_workaround, lldb_private::NativeThreadProtocol::m_stop_description, and MaybeLogStateChange().
Referenced by SetStoppedByBreakpoint(), SetStoppedByExec(), SetStoppedByFork(), SetStoppedByProcessorTrace(), SetStoppedBySignal(), SetStoppedByTrace(), SetStoppedByVForkDone(), SetStoppedByWatchpoint(), and SetStoppedWithNoReason().
|
private |
Definition at line 392 of file NativeThreadLinux.cpp.
References lldb::eStopReasonBreakpoint, lldb_private::NativeThreadProtocol::m_stop_description, lldb_private::NativeThreadProtocol::m_stop_info, SetStopped(), and SIGTRAP.
|
private |
Definition at line 382 of file NativeThreadLinux.cpp.
References lldb::eStopReasonExec, lldb_private::GetLog(), LLDB_LOGF, lldb_private::NativeThreadProtocol::m_stop_info, SetStopped(), SIGSTOP, and lldb_private::Thread.
|
private |
Definition at line 445 of file NativeThreadLinux.cpp.
References lldb::eStopReasonFork, lldb::eStopReasonVFork, lldb_private::NativeThreadProtocol::m_stop_description, lldb_private::NativeThreadProtocol::m_stop_info, SetStopped(), and SIGTRAP.
Referenced by lldb_private::process_linux::NativeProcessLinux::MonitorClone().
|
private |
Definition at line 472 of file NativeThreadLinux.cpp.
References lldb::eStopReasonProcessorTrace, lldb_private::NativeThreadProtocol::m_stop_description, lldb_private::NativeThreadProtocol::m_stop_info, and SetStopped().
|
private |
Definition at line 273 of file NativeThreadLinux.cpp.
References AnnotateSyncTagCheckFault(), lldb::eStopReasonSignal, GetCrashReasonString(), lldb_private::GetLog(), LLDB_LOGF, lldb_private::NativeThreadProtocol::m_stop_description, lldb_private::NativeThreadProtocol::m_stop_info, SEGV_MTESERR, SetStopped(), SIGBUS, SIGFPE, SIGILL, SIGSEGV, and lldb_private::Thread.
|
private |
Definition at line 438 of file NativeThreadLinux.cpp.
References lldb::eStopReasonTrace, lldb_private::NativeThreadProtocol::m_stop_info, SetStopped(), and SIGTRAP.
|
private |
Definition at line 458 of file NativeThreadLinux.cpp.
References lldb::eStopReasonVForkDone, lldb_private::NativeThreadProtocol::m_stop_info, SetStopped(), and SIGTRAP.
|
private |
Definition at line 400 of file NativeThreadLinux.cpp.
References lldb::eStopReasonWatchpoint, LLDB_INVALID_INDEX32, lldbassert, m_reg_context_up, lldb_private::NativeThreadProtocol::m_stop_description, lldb_private::NativeThreadProtocol::m_stop_info, SetStopped(), and SIGTRAP.
|
private |
Definition at line 465 of file NativeThreadLinux.cpp.
References lldb::eStopReasonNone, lldb_private::NativeThreadProtocol::m_stop_info, and SetStopped().
|
overridevirtual |
Implements lldb_private::NativeThreadProtocol.
Definition at line 146 of file NativeThreadLinux.cpp.
References error(), lldb::eStateLaunching, lldb_private::Status::FromErrorString(), LLDB_INVALID_INDEX32, m_reg_context_up, m_state, m_watchpoint_index_map, RemoveWatchpoint(), and lldb_private::Status.
Referenced by Resume().
|
private |
Single steps the thread.
If signo is anything but LLDB_INVALID_SIGNAL_NUMBER, deliver that signal to the thread.
Definition at line 247 of file NativeThreadLinux.cpp.
References lldb_private::NativeThreadProtocol::ClearStopInfo(), lldb::eStateStepping, lldb_private::process_linux::SingleStepWorkaround::Get(), GetProcess(), LLDB_INVALID_SIGNAL_NUMBER, m_state, m_step_workaround, lldb_private::NativeThreadProtocol::m_tid, MaybeLogStateChange(), and lldb_private::process_linux::NativeProcessLinux::PtraceWrapper().
|
friend |
Definition at line 30 of file NativeThreadLinux.h.
References NativeProcessLinux.
Referenced by GetName(), GetProcess(), GetProcess(), NativeProcessLinux, NativeThreadLinux(), RequestStop(), and Resume().
|
private |
Definition at line 120 of file NativeThreadLinux.h.
Referenced by RemoveHardwareBreakpoint(), Resume(), and SetHardwareBreakpoint().
|
private |
Definition at line 117 of file NativeThreadLinux.h.
Referenced by GetRegisterContext(), NativeThreadLinux(), RemoveHardwareBreakpoint(), RemoveWatchpoint(), Resume(), SetHardwareBreakpoint(), SetStoppedByWatchpoint(), and SetWatchpoint().
|
private |
Definition at line 116 of file NativeThreadLinux.h.
Referenced by GetState(), GetStopReason(), IsStopped(), MaybeLogStateChange(), NativeThreadLinux(), Resume(), SetExited(), SetHardwareBreakpoint(), SetStopped(), SetWatchpoint(), and SingleStep().
|
private |
Definition at line 121 of file NativeThreadLinux.h.
Referenced by SetStopped(), and SingleStep().
|
private |
Definition at line 119 of file NativeThreadLinux.h.
Referenced by RemoveWatchpoint(), Resume(), and SetWatchpoint().