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 |
ThreadStopInfo | m_stop_info |
std::unique_ptr< NativeRegisterContextLinux > | m_reg_context_up |
std::string | m_stop_description |
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 Attributes inherited from lldb_private::NativeThreadProtocol | |
NativeProcessProtocol & | m_process |
lldb::tid_t | m_tid |
Definition at line 29 of file NativeThreadLinux.h.
|
private |
Definition at line 120 of file NativeThreadLinux.h.
NativeThreadLinux::NativeThreadLinux | ( | NativeProcessLinux & | process, |
lldb::tid_t | tid ) |
Definition at line 95 of file NativeThreadLinux.cpp.
References lldb::eStateInvalid, m_reg_context_up, m_state, m_stop_description, m_stop_info, 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 312 of file NativeThreadLinux.cpp.
References lldb_private::MemoryTagManagerAArch64MTE::eMTE_allocation, lldb_private::process_linux::NativeRegisterContextLinux::GetMemoryTaggingDetails(), GetProcess(), GetRegisterContext(), 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 104 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 539 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 543 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 548 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 113 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 115 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, m_stop_description, 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 364 of file NativeThreadLinux.cpp.
References lldb::eStateStopped, lldb::eStopReasonSignal, m_state, m_stop_info, and lldb_private::StateIsStoppedState().
|
private |
Definition at line 437 of file NativeThreadLinux.cpp.
References lldb::eStateStopped, lldb::eStopReasonBreakpoint, GetState(), and m_stop_info.
|
private |
Definition at line 442 of file NativeThreadLinux.cpp.
References lldb::eStateStopped, lldb::eStopReasonWatchpoint, GetState(), and m_stop_info.
|
private |
Definition at line 524 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 200 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 171 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 498 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 214 of file NativeThreadLinux.cpp.
References lldb::eStateRunning, lldb::eStopReasonNone, 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_stop_description, m_stop_info, m_watchpoint_index_map, MaybeLogStateChange(), NativeProcessLinux, lldb_private::process_linux::NativeProcessLinux::PtraceWrapper(), SetHardwareBreakpoint(), and SetWatchpoint().
|
private |
Definition at line 490 of file NativeThreadLinux.cpp.
References lldb::eStateExited, lldb::eStopReasonThreadExiting, m_state, m_stop_info, and MaybeLogStateChange().
|
overridevirtual |
Implements lldb_private::NativeThreadProtocol.
Definition at line 182 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 378 of file NativeThreadLinux.cpp.
References lldb::eStateStepping, lldb::eStateStopped, GetRegisterContext(), lldb_private::process_linux::NativeRegisterContextLinux::InvalidateAllRegisters(), m_state, m_step_workaround, m_stop_description, and MaybeLogStateChange().
Referenced by SetStoppedByBreakpoint(), SetStoppedByExec(), SetStoppedByFork(), SetStoppedByProcessorTrace(), SetStoppedBySignal(), SetStoppedByTrace(), SetStoppedByVForkDone(), SetStoppedByWatchpoint(), and SetStoppedWithNoReason().
|
private |
Definition at line 401 of file NativeThreadLinux.cpp.
References lldb::eStopReasonBreakpoint, m_stop_description, m_stop_info, SetStopped(), and SIGTRAP.
|
private |
Definition at line 391 of file NativeThreadLinux.cpp.
References lldb::eStopReasonExec, lldb_private::GetLog(), LLDB_LOGF, m_stop_info, SetStopped(), SIGSTOP, and lldb_private::Thread.
|
private |
Definition at line 454 of file NativeThreadLinux.cpp.
References lldb::eStopReasonFork, lldb::eStopReasonVFork, m_stop_description, m_stop_info, SetStopped(), and SIGTRAP.
Referenced by lldb_private::process_linux::NativeProcessLinux::MonitorClone().
|
private |
Definition at line 481 of file NativeThreadLinux.cpp.
References lldb::eStopReasonProcessorTrace, m_stop_description, m_stop_info, and SetStopped().
|
private |
Definition at line 282 of file NativeThreadLinux.cpp.
References AnnotateSyncTagCheckFault(), lldb::eStopReasonSignal, GetCrashReasonString(), lldb_private::GetLog(), LLDB_LOGF, m_stop_description, m_stop_info, SEGV_MTESERR, SetStopped(), SIGBUS, SIGFPE, SIGILL, SIGSEGV, and lldb_private::Thread.
|
private |
Definition at line 447 of file NativeThreadLinux.cpp.
References lldb::eStopReasonTrace, m_stop_info, SetStopped(), and SIGTRAP.
|
private |
Definition at line 467 of file NativeThreadLinux.cpp.
References lldb::eStopReasonVForkDone, m_stop_info, SetStopped(), and SIGTRAP.
|
private |
Definition at line 409 of file NativeThreadLinux.cpp.
References lldb::eStopReasonWatchpoint, LLDB_INVALID_INDEX32, lldbassert, m_reg_context_up, m_stop_description, m_stop_info, SetStopped(), and SIGTRAP.
|
private |
Definition at line 474 of file NativeThreadLinux.cpp.
References lldb::eStopReasonNone, m_stop_info, and SetStopped().
|
overridevirtual |
Implements lldb_private::NativeThreadProtocol.
Definition at line 154 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 256 of file NativeThreadLinux.cpp.
References lldb::eStateStepping, lldb::eStopReasonNone, lldb_private::process_linux::SingleStepWorkaround::Get(), GetProcess(), LLDB_INVALID_SIGNAL_NUMBER, m_state, m_step_workaround, m_stop_info, 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 122 of file NativeThreadLinux.h.
Referenced by RemoveHardwareBreakpoint(), Resume(), and SetHardwareBreakpoint().
|
private |
Definition at line 118 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 123 of file NativeThreadLinux.h.
Referenced by SetStopped(), and SingleStep().
|
private |
Definition at line 119 of file NativeThreadLinux.h.
Referenced by AnnotateSyncTagCheckFault(), GetStopReason(), NativeThreadLinux(), Resume(), SetStopped(), SetStoppedByBreakpoint(), SetStoppedByFork(), SetStoppedByProcessorTrace(), SetStoppedBySignal(), and SetStoppedByWatchpoint().
|
private |
Definition at line 117 of file NativeThreadLinux.h.
Referenced by GetStopReason(), IsStopped(), IsStoppedAtBreakpoint(), IsStoppedAtWatchpoint(), NativeThreadLinux(), Resume(), SetExited(), SetStoppedByBreakpoint(), SetStoppedByExec(), SetStoppedByFork(), SetStoppedByProcessorTrace(), SetStoppedBySignal(), SetStoppedByTrace(), SetStoppedByVForkDone(), SetStoppedByWatchpoint(), SetStoppedWithNoReason(), and SingleStep().
|
private |
Definition at line 121 of file NativeThreadLinux.h.
Referenced by RemoveWatchpoint(), Resume(), and SetWatchpoint().