LLDB mainline
Public Member Functions | Private Types | Private Member Functions | Private Attributes | Friends | List of all members
lldb_private::process_linux::NativeThreadLinux Class Reference

#include <NativeThreadLinux.h>

Inheritance diagram for lldb_private::process_linux::NativeThreadLinux:
Inheritance graph
[legend]

Public Member Functions

 NativeThreadLinux (NativeProcessLinux &process, lldb::tid_t tid)
 
std::string GetName () override
 
lldb::StateType GetState () override
 
bool GetStopReason (ThreadStopInfo &stop_info, std::string &description) override
 
NativeRegisterContextLinuxGetRegisterContext () override
 
Status SetWatchpoint (lldb::addr_t addr, size_t size, uint32_t watch_flags, bool hardware) override
 
Status RemoveWatchpoint (lldb::addr_t addr) override
 
Status SetHardwareBreakpoint (lldb::addr_t addr, size_t size) override
 
Status RemoveHardwareBreakpoint (lldb::addr_t addr) override
 
NativeProcessLinuxGetProcess ()
 
const NativeProcessLinuxGetProcess () const
 
llvm::Expected< std::unique_ptr< llvm::MemoryBuffer > > GetSiginfo () const override
 
- Public Member Functions inherited from lldb_private::NativeThreadProtocol
 NativeThreadProtocol (NativeProcessProtocol &process, lldb::tid_t tid)
 
virtual ~NativeThreadProtocol ()=default
 
virtual std::string GetName ()=0
 
virtual lldb::StateType GetState ()=0
 
virtual NativeRegisterContextGetRegisterContext ()=0
 
virtual bool GetStopReason (ThreadStopInfo &stop_info, std::string &description)=0
 
lldb::tid_t GetID () const
 
NativeProcessProtocolGetProcess ()
 
virtual Status SetWatchpoint (lldb::addr_t addr, size_t size, uint32_t watch_flags, bool hardware)=0
 
virtual Status RemoveWatchpoint (lldb::addr_t addr)=0
 
virtual Status SetHardwareBreakpoint (lldb::addr_t addr, size_t size)=0
 
virtual Status RemoveHardwareBreakpoint (lldb::addr_t addr)=0
 
virtual llvm::Expected< std::unique_ptr< llvm::MemoryBuffer > > GetSiginfo () const
 

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< NativeRegisterContextLinuxm_reg_context_up
 
std::string m_stop_description
 
WatchpointIndexMap m_watchpoint_index_map
 
WatchpointIndexMap m_hw_break_index_map
 
std::unique_ptr< SingleStepWorkaroundm_step_workaround
 

Friends

class NativeProcessLinux
 

Additional Inherited Members

- Protected Attributes inherited from lldb_private::NativeThreadProtocol
NativeProcessProtocolm_process
 
lldb::tid_t m_tid
 

Detailed Description

Definition at line 29 of file NativeThreadLinux.h.

Member Typedef Documentation

◆ WatchpointIndexMap

Definition at line 120 of file NativeThreadLinux.h.

Constructor & Destructor Documentation

◆ NativeThreadLinux()

NativeThreadLinux::NativeThreadLinux ( NativeProcessLinux process,
lldb::tid_t  tid 
)

Definition at line 92 of file NativeThreadLinux.cpp.

Member Function Documentation

◆ AnnotateSyncTagCheckFault()

void NativeThreadLinux::AnnotateSyncTagCheckFault ( lldb::addr_t  fault_addr)
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 309 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().

◆ GetName()

std::string NativeThreadLinux::GetName ( )
overridevirtual

◆ GetProcess() [1/2]

NativeProcessLinux & NativeThreadLinux::GetProcess ( )

◆ GetProcess() [2/2]

const NativeProcessLinux & NativeThreadLinux::GetProcess ( ) const

◆ GetRegisterContext()

NativeRegisterContextLinux & lldb_private::process_linux::NativeThreadLinux::GetRegisterContext ( )
inlineoverridevirtual

◆ GetSiginfo()

llvm::Expected< std::unique_ptr< llvm::MemoryBuffer > > NativeThreadLinux::GetSiginfo ( ) const
overridevirtual

◆ GetState()

lldb::StateType NativeThreadLinux::GetState ( )
overridevirtual

◆ GetStopReason()

bool NativeThreadLinux::GetStopReason ( ThreadStopInfo stop_info,
std::string &  description 
)
overridevirtual

◆ IsStopped()

bool NativeThreadLinux::IsStopped ( int *  signo)
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 361 of file NativeThreadLinux.cpp.

References m_state, m_stop_info, lldb_private::ThreadStopInfo::reason, lldb_private::ThreadStopInfo::signo, and lldb_private::StateIsStoppedState().

◆ IsStoppedAtBreakpoint()

bool NativeThreadLinux::IsStoppedAtBreakpoint ( )
private

◆ IsStoppedAtWatchpoint()

bool NativeThreadLinux::IsStoppedAtWatchpoint ( )
private

◆ MaybeLogStateChange()

void NativeThreadLinux::MaybeLogStateChange ( lldb::StateType  new_state)
private

◆ RemoveHardwareBreakpoint()

Status NativeThreadLinux::RemoveHardwareBreakpoint ( lldb::addr_t  addr)
overridevirtual

Implements lldb_private::NativeThreadProtocol.

Definition at line 197 of file NativeThreadLinux.cpp.

References m_hw_break_index_map, and m_reg_context_up.

Referenced by SetHardwareBreakpoint().

◆ RemoveWatchpoint()

Status NativeThreadLinux::RemoveWatchpoint ( lldb::addr_t  addr)
overridevirtual

Implements lldb_private::NativeThreadProtocol.

Definition at line 168 of file NativeThreadLinux.cpp.

References m_reg_context_up, and m_watchpoint_index_map.

Referenced by SetWatchpoint().

◆ RequestStop()

Status NativeThreadLinux::RequestStop ( )
private

◆ Resume()

Status NativeThreadLinux::Resume ( uint32_t  signo)
private

◆ SetExited()

void NativeThreadLinux::SetExited ( )
private

◆ SetHardwareBreakpoint()

Status NativeThreadLinux::SetHardwareBreakpoint ( lldb::addr_t  addr,
size_t  size 
)
overridevirtual

◆ SetStopped()

void NativeThreadLinux::SetStopped ( )
private

◆ SetStoppedByBreakpoint()

void NativeThreadLinux::SetStoppedByBreakpoint ( )
private

◆ SetStoppedByExec()

void NativeThreadLinux::SetStoppedByExec ( )
private

◆ SetStoppedByFork()

void NativeThreadLinux::SetStoppedByFork ( bool  is_vfork,
lldb::pid_t  child_pid 
)
private

◆ SetStoppedByProcessorTrace()

void NativeThreadLinux::SetStoppedByProcessorTrace ( llvm::StringRef  description)
private

◆ SetStoppedBySignal()

void NativeThreadLinux::SetStoppedBySignal ( uint32_t  signo,
const siginfo_t *  info = nullptr 
)
private

◆ SetStoppedByTrace()

void NativeThreadLinux::SetStoppedByTrace ( )
private

◆ SetStoppedByVForkDone()

void NativeThreadLinux::SetStoppedByVForkDone ( )
private

◆ SetStoppedByWatchpoint()

void NativeThreadLinux::SetStoppedByWatchpoint ( uint32_t  wp_index)
private

◆ SetStoppedWithNoReason()

void NativeThreadLinux::SetStoppedWithNoReason ( )
private

◆ SetWatchpoint()

Status NativeThreadLinux::SetWatchpoint ( lldb::addr_t  addr,
size_t  size,
uint32_t  watch_flags,
bool  hardware 
)
overridevirtual

◆ SingleStep()

Status NativeThreadLinux::SingleStep ( uint32_t  signo)
private

Friends And Related Function Documentation

◆ NativeProcessLinux

friend class NativeProcessLinux
friend

Definition at line 30 of file NativeThreadLinux.h.

Member Data Documentation

◆ m_hw_break_index_map

WatchpointIndexMap lldb_private::process_linux::NativeThreadLinux::m_hw_break_index_map
private

Definition at line 122 of file NativeThreadLinux.h.

Referenced by RemoveHardwareBreakpoint(), Resume(), and SetHardwareBreakpoint().

◆ m_reg_context_up

std::unique_ptr<NativeRegisterContextLinux> lldb_private::process_linux::NativeThreadLinux::m_reg_context_up
private

◆ m_state

lldb::StateType lldb_private::process_linux::NativeThreadLinux::m_state
private

◆ m_step_workaround

std::unique_ptr<SingleStepWorkaround> lldb_private::process_linux::NativeThreadLinux::m_step_workaround
private

Definition at line 123 of file NativeThreadLinux.h.

Referenced by SetStopped(), and SingleStep().

◆ m_stop_description

std::string lldb_private::process_linux::NativeThreadLinux::m_stop_description
private

◆ m_stop_info

ThreadStopInfo lldb_private::process_linux::NativeThreadLinux::m_stop_info
private

◆ m_watchpoint_index_map

WatchpointIndexMap lldb_private::process_linux::NativeThreadLinux::m_watchpoint_index_map
private

Definition at line 121 of file NativeThreadLinux.h.

Referenced by RemoveWatchpoint(), Resume(), and SetWatchpoint().


The documentation for this class was generated from the following files: