LLDB  mainline
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
RegisterContextPOSIXProcessMonitor_x86_64 Class Reference

#include <RegisterContextPOSIXProcessMonitor_x86.h>

Inheritance diagram for RegisterContextPOSIXProcessMonitor_x86_64:
Inheritance graph
[legend]
Collaboration diagram for RegisterContextPOSIXProcessMonitor_x86_64:
Collaboration graph
[legend]

Public Member Functions

 RegisterContextPOSIXProcessMonitor_x86_64 (lldb_private::Thread &thread, uint32_t concrete_frame_idx, lldb_private::RegisterInfoInterface *register_info)
 
- Public Member Functions inherited from RegisterContextPOSIX_x86
 RegisterContextPOSIX_x86 (lldb_private::Thread &thread, uint32_t concrete_frame_idx, lldb_private::RegisterInfoInterface *register_info)
 
 ~RegisterContextPOSIX_x86 () override
 
void Invalidate ()
 
void InvalidateAllRegisters () override
 
size_t GetRegisterCount () override
 
virtual size_t GetGPRSize ()
 
virtual size_t GetFXSAVEOffset ()
 
virtual unsigned GetRegisterSize (unsigned reg)
 
virtual unsigned GetRegisterOffset (unsigned reg)
 
const lldb_private::RegisterInfo * GetRegisterInfoAtIndex (size_t reg) override
 
size_t GetRegisterSetCount () override
 
const lldb_private::RegisterSet * GetRegisterSet (size_t set) override
 
const char * GetRegisterName (unsigned reg)
 
- Public Member Functions inherited from lldb_private::RegisterContext
 RegisterContext (Thread &thread, uint32_t concrete_frame_idx)
 
 ~RegisterContext () override
 
void InvalidateIfNeeded (bool force)
 
uint32_t UpdateDynamicRegisterSize (const lldb_private::ArchSpec &arch, RegisterInfo *reg_info)
 
virtual lldb::ByteOrder GetByteOrder ()
 
virtual bool ReadRegister (const RegisterInfo *reg_info, RegisterValue &reg_value)=0
 
virtual bool WriteRegister (const RegisterInfo *reg_info, const RegisterValue &reg_value)=0
 
virtual bool ReadAllRegisterValues (lldb_private::RegisterCheckpoint &reg_checkpoint)
 
virtual bool WriteAllRegisterValues (const lldb_private::RegisterCheckpoint &reg_checkpoint)
 
bool CopyFromRegisterContext (lldb::RegisterContextSP context)
 
virtual uint32_t ConvertRegisterKindToRegisterNumber (lldb::RegisterKind kind, uint32_t num)
 Convert from a given register numbering scheme to the lldb register numbering scheme. More...
 
virtual uint32_t NumSupportedHardwareBreakpoints ()
 
virtual uint32_t SetHardwareBreakpoint (lldb::addr_t addr, size_t size)
 
virtual bool ClearHardwareBreakpoint (uint32_t hw_idx)
 
virtual Status ReadRegisterValueFromMemory (const lldb_private::RegisterInfo *reg_info, lldb::addr_t src_addr, uint32_t src_len, RegisterValue &reg_value)
 
virtual Status WriteRegisterValueToMemory (const lldb_private::RegisterInfo *reg_info, lldb::addr_t dst_addr, uint32_t dst_len, const RegisterValue &reg_value)
 
virtual lldb::tid_t GetThreadID () const
 
virtual ThreadGetThread ()
 
const RegisterInfo * GetRegisterInfoByName (llvm::StringRef reg_name, uint32_t start_idx=0)
 
const RegisterInfo * GetRegisterInfo (lldb::RegisterKind reg_kind, uint32_t reg_num)
 
uint64_t GetPC (uint64_t fail_value=LLDB_INVALID_ADDRESS)
 
bool SetPC (uint64_t pc)
 
bool SetPC (Address addr)
 
uint64_t GetSP (uint64_t fail_value=LLDB_INVALID_ADDRESS)
 
bool SetSP (uint64_t sp)
 
uint64_t GetFP (uint64_t fail_value=LLDB_INVALID_ADDRESS)
 
bool SetFP (uint64_t fp)
 
const char * GetRegisterName (uint32_t reg)
 
uint64_t GetReturnAddress (uint64_t fail_value=LLDB_INVALID_ADDRESS)
 
uint64_t GetFlags (uint64_t fail_value=0)
 
uint64_t ReadRegisterAsUnsigned (uint32_t reg, uint64_t fail_value)
 
uint64_t ReadRegisterAsUnsigned (const RegisterInfo *reg_info, uint64_t fail_value)
 
bool WriteRegisterFromUnsigned (uint32_t reg, uint64_t uval)
 
bool WriteRegisterFromUnsigned (const RegisterInfo *reg_info, uint64_t uval)
 
bool ConvertBetweenRegisterKinds (lldb::RegisterKind source_rk, uint32_t source_regnum, lldb::RegisterKind target_rk, uint32_t &target_regnum)
 
lldb::TargetSP CalculateTarget () override
 
lldb::ProcessSP CalculateProcess () override
 
lldb::ThreadSP CalculateThread () override
 
lldb::StackFrameSP CalculateStackFrame () override
 
void CalculateExecutionContext (ExecutionContext &exe_ctx) override
 Reconstruct the object's execution context into sc. More...
 
uint32_t GetStopID () const
 
void SetStopID (uint32_t stop_id)
 
- Public Member Functions inherited from lldb_private::ExecutionContextScope
virtual ~ExecutionContextScope ()
 
- Public Member Functions inherited from POSIXBreakpointProtocol
 POSIXBreakpointProtocol ()
 
virtual ~POSIXBreakpointProtocol ()
 
void ForceWatchpointsInitialized ()
 

Protected Member Functions

bool ReadGPR () override
 
bool ReadFPR () override
 
bool WriteGPR () override
 
bool WriteFPR () override
 
bool ReadRegister (const unsigned reg, lldb_private::RegisterValue &value)
 
bool WriteRegister (const unsigned reg, const lldb_private::RegisterValue &value)
 
bool ReadRegister (const lldb_private::RegisterInfo *reg_info, lldb_private::RegisterValue &value) override
 
bool WriteRegister (const lldb_private::RegisterInfo *reg_info, const lldb_private::RegisterValue &value) override
 
bool ReadAllRegisterValues (lldb::DataBufferSP &data_sp) override
 
bool WriteAllRegisterValues (const lldb::DataBufferSP &data_sp) override
 
uint32_t SetHardwareWatchpoint (lldb::addr_t addr, size_t size, bool read, bool write) override
 
bool ClearHardwareWatchpoint (uint32_t hw_index) override
 
bool HardwareSingleStep (bool enable) override
 
bool UpdateAfterBreakpoint () override
 Updates the register state of the associated thread after hitting a breakpoint (if that make sense for the architecture). More...
 
unsigned GetRegisterIndexFromOffset (unsigned offset) override
 Determines the index in lldb's register file given a kernel byte offset. More...
 
bool IsWatchpointHit (uint32_t hw_index) override
 
bool ClearWatchpointHits () override
 
lldb::addr_t GetWatchpointAddress (uint32_t hw_index) override
 
bool IsWatchpointVacant (uint32_t hw_index) override
 
bool SetHardwareWatchpointWithIndex (lldb::addr_t addr, size_t size, bool read, bool write, uint32_t hw_index) override
 
uint32_t NumSupportedHardwareWatchpoints () override
 
- Protected Member Functions inherited from RegisterContextPOSIX_x86
virtual bool IsRegisterSetAvailable (size_t set_index)
 
virtual const lldb_private::RegisterInfo * GetRegisterInfo ()
 
bool IsGPR (unsigned reg)
 
bool IsFPR (unsigned reg)
 
bool IsAVX (unsigned reg)
 
bool CopyXSTATEtoYMM (uint32_t reg, lldb::ByteOrder byte_order)
 
bool CopyYMMtoXSTATE (uint32_t reg, lldb::ByteOrder byte_order)
 
bool IsFPR (unsigned reg, FPRType fpr_type)
 
FPRType GetFPRType ()
 

Private Member Functions

ProcessMonitorGetMonitor ()
 

Private Attributes

uint32_t m_fctrl_offset_in_userarea
 
struct iovec m_iovec
 

Additional Inherited Members

- Public Types inherited from RegisterContextPOSIX_x86
enum  FPRType {
  eNotValid = 0, eFSAVE, eFXSAVE, eSOFT,
  eXSAVE
}
 
- Static Public Attributes inherited from RegisterContextPOSIX_x86
static uint32_t g_contained_eax []
 
static uint32_t g_contained_ebx []
 
static uint32_t g_contained_ecx []
 
static uint32_t g_contained_edx []
 
static uint32_t g_contained_edi []
 
static uint32_t g_contained_esi []
 
static uint32_t g_contained_ebp []
 
static uint32_t g_contained_esp []
 
static uint32_t g_invalidate_eax []
 
static uint32_t g_invalidate_ebx []
 
static uint32_t g_invalidate_ecx []
 
static uint32_t g_invalidate_edx []
 
static uint32_t g_invalidate_edi []
 
static uint32_t g_invalidate_esi []
 
static uint32_t g_invalidate_ebp []
 
static uint32_t g_invalidate_esp []
 
static uint32_t g_contained_rax []
 
static uint32_t g_contained_rbx []
 
static uint32_t g_contained_rcx []
 
static uint32_t g_contained_rdx []
 
static uint32_t g_contained_rdi []
 
static uint32_t g_contained_rsi []
 
static uint32_t g_contained_rbp []
 
static uint32_t g_contained_rsp []
 
static uint32_t g_contained_r8 []
 
static uint32_t g_contained_r9 []
 
static uint32_t g_contained_r10 []
 
static uint32_t g_contained_r11 []
 
static uint32_t g_contained_r12 []
 
static uint32_t g_contained_r13 []
 
static uint32_t g_contained_r14 []
 
static uint32_t g_contained_r15 []
 
static uint32_t g_invalidate_rax []
 
static uint32_t g_invalidate_rbx []
 
static uint32_t g_invalidate_rcx []
 
static uint32_t g_invalidate_rdx []
 
static uint32_t g_invalidate_rdi []
 
static uint32_t g_invalidate_rsi []
 
static uint32_t g_invalidate_rbp []
 
static uint32_t g_invalidate_rsp []
 
static uint32_t g_invalidate_r8 []
 
static uint32_t g_invalidate_r9 []
 
static uint32_t g_invalidate_r10 []
 
static uint32_t g_invalidate_r11 []
 
static uint32_t g_invalidate_r12 []
 
static uint32_t g_invalidate_r13 []
 
static uint32_t g_invalidate_r14 []
 
static uint32_t g_invalidate_r15 []
 
static uint32_t g_contained_fip []
 
static uint32_t g_contained_fdp []
 
static uint32_t g_invalidate_fip []
 
static uint32_t g_invalidate_fdp []
 
- Protected Attributes inherited from RegisterContextPOSIX_x86
uint64_t m_gpr_x86_64 [lldb_private::k_num_gpr_registers_x86_64]
 
RegInfo m_reg_info
 
FPRType m_fpr_type
 
lldb_private::FPR m_fpr
 
lldb_private::YMM m_ymm_set
 
std::unique_ptr< lldb_private::RegisterInfoInterfacem_register_info_up
 
- Protected Attributes inherited from lldb_private::RegisterContext
Threadm_thread
 
uint32_t m_concrete_frame_idx
 
uint32_t m_stop_id
 
- Protected Attributes inherited from POSIXBreakpointProtocol
bool m_watchpoints_initialized
 

Detailed Description

Definition at line 16 of file RegisterContextPOSIXProcessMonitor_x86.h.

Constructor & Destructor Documentation

◆ RegisterContextPOSIXProcessMonitor_x86_64()

RegisterContextPOSIXProcessMonitor_x86_64::RegisterContextPOSIXProcessMonitor_x86_64 ( lldb_private::Thread thread,
uint32_t  concrete_frame_idx,
lldb_private::RegisterInfoInterface register_info 
)

Member Function Documentation

◆ ClearHardwareWatchpoint()

bool RegisterContextPOSIXProcessMonitor_x86_64::ClearHardwareWatchpoint ( uint32_t  hw_index)
overrideprotectedvirtual

◆ ClearWatchpointHits()

bool RegisterContextPOSIXProcessMonitor_x86_64::ClearWatchpointHits ( )
overrideprotectedvirtual

◆ GetMonitor()

ProcessMonitor & RegisterContextPOSIXProcessMonitor_x86_64::GetMonitor ( )
private

◆ GetRegisterIndexFromOffset()

unsigned RegisterContextPOSIXProcessMonitor_x86_64::GetRegisterIndexFromOffset ( unsigned  offset)
overrideprotectedvirtual

Determines the index in lldb's register file given a kernel byte offset.

Implements POSIXBreakpointProtocol.

Definition at line 472 of file RegisterContextPOSIXProcessMonitor_x86.cpp.

References RegisterContextPOSIX_x86::GetRegisterInfo(), RegisterContextPOSIX_x86::m_reg_info, and RegisterContextPOSIX_x86::RegInfo::num_registers.

◆ GetWatchpointAddress()

addr_t RegisterContextPOSIXProcessMonitor_x86_64::GetWatchpointAddress ( uint32_t  hw_index)
overrideprotectedvirtual

◆ HardwareSingleStep()

bool RegisterContextPOSIXProcessMonitor_x86_64::HardwareSingleStep ( bool  enable)
overrideprotectedvirtual

◆ IsWatchpointHit()

bool RegisterContextPOSIXProcessMonitor_x86_64::IsWatchpointHit ( uint32_t  hw_index)
overrideprotectedvirtual

◆ IsWatchpointVacant()

bool RegisterContextPOSIXProcessMonitor_x86_64::IsWatchpointVacant ( uint32_t  hw_index)
overrideprotectedvirtual

◆ NumSupportedHardwareWatchpoints()

uint32_t RegisterContextPOSIXProcessMonitor_x86_64::NumSupportedHardwareWatchpoints ( )
overrideprotectedvirtual

◆ ReadAllRegisterValues()

bool RegisterContextPOSIXProcessMonitor_x86_64::ReadAllRegisterValues ( lldb::DataBufferSP &  data_sp)
overrideprotectedvirtual

◆ ReadFPR()

bool RegisterContextPOSIXProcessMonitor_x86_64::ReadFPR ( )
overrideprotectedvirtual

◆ ReadGPR()

bool RegisterContextPOSIXProcessMonitor_x86_64::ReadGPR ( )
overrideprotectedvirtual

◆ ReadRegister() [1/2]

bool RegisterContextPOSIXProcessMonitor_x86_64::ReadRegister ( const unsigned  reg,
lldb_private::RegisterValue value 
)
protected

◆ ReadRegister() [2/2]

bool RegisterContextPOSIXProcessMonitor_x86_64::ReadRegister ( const lldb_private::RegisterInfo *  reg_info,
lldb_private::RegisterValue value 
)
overrideprotected

◆ SetHardwareWatchpoint()

uint32_t RegisterContextPOSIXProcessMonitor_x86_64::SetHardwareWatchpoint ( lldb::addr_t  addr,
size_t  size,
bool  read,
bool  write 
)
overrideprotectedvirtual

◆ SetHardwareWatchpointWithIndex()

bool RegisterContextPOSIXProcessMonitor_x86_64::SetHardwareWatchpointWithIndex ( lldb::addr_t  addr,
size_t  size,
bool  read,
bool  write,
uint32_t  hw_index 
)
overrideprotectedvirtual

◆ UpdateAfterBreakpoint()

bool RegisterContextPOSIXProcessMonitor_x86_64::UpdateAfterBreakpoint ( )
overrideprotectedvirtual

Updates the register state of the associated thread after hitting a breakpoint (if that make sense for the architecture).

Default implementation simply returns true for architectures which do not require any update.

Returns
True if the operation succeeded and false otherwise.

Implements POSIXBreakpointProtocol.

Definition at line 461 of file RegisterContextPOSIXProcessMonitor_x86.cpp.

References lldb_private::RegisterContext::GetPC(), LLDB_INVALID_ADDRESS, pc, and lldb_private::RegisterContext::SetPC().

◆ WriteAllRegisterValues()

bool RegisterContextPOSIXProcessMonitor_x86_64::WriteAllRegisterValues ( const lldb::DataBufferSP &  data_sp)
overrideprotectedvirtual

◆ WriteFPR()

bool RegisterContextPOSIXProcessMonitor_x86_64::WriteFPR ( )
overrideprotectedvirtual

◆ WriteGPR()

bool RegisterContextPOSIXProcessMonitor_x86_64::WriteGPR ( )
overrideprotectedvirtual

◆ WriteRegister() [1/2]

bool RegisterContextPOSIXProcessMonitor_x86_64::WriteRegister ( const unsigned  reg,
const lldb_private::RegisterValue value 
)
protected

Definition at line 120 of file RegisterContextPOSIXProcessMonitor_x86.cpp.

References lldb_private::MMSReg::bytes, lldb_private::XMMReg::bytes, lldb_private::YMMReg::bytes, RegisterContextPOSIX_x86::CopyXSTATEtoYMM(), RegisterContextPOSIX_x86::CopyYMMtoXSTATE(), lldb::eByteOrderInvalid, lldb::eEncodingVector, lldb::eRegisterKindLLDB, error(), RegisterContextPOSIX_x86::eXSAVE, RegisterContextPOSIX_x86::RegInfo::first_dr, RegisterContextPOSIX_x86::RegInfo::first_mm, RegisterContextPOSIX_x86::RegInfo::first_st, RegisterContextPOSIX_x86::RegInfo::first_xmm, RegisterContextPOSIX_x86::RegInfo::first_ymm, lldb_private::FPR::fxsave, lldb_private::RegisterValue::GetAsMemoryData(), lldb_private::RegisterValue::GetAsUInt16(), lldb_private::RegisterValue::GetAsUInt32(), lldb_private::RegisterValue::GetAsUInt64(), lldb_private::RegisterValue::GetAsUInt8(), lldb_private::RegisterContext::GetByteOrder(), lldb_private::RegisterValue::GetBytes(), lldb_private::RegisterValue::GetByteSize(), RegisterContextPOSIX_x86::GetFPRType(), lldb_private::UserID::GetID(), GetMonitor(), RegisterContextPOSIX_x86::GetRegisterInfoAtIndex(), RegisterContextPOSIX_x86::GetRegisterName(), RegisterContextPOSIX_x86::GetRegisterOffset(), lldb_private::RegisterValue::GetType(), RegisterContextPOSIX_x86::IsAVX(), RegisterContextPOSIX_x86::IsFPR(), RegisterContextPOSIX_x86::IsGPR(), RegisterContextPOSIX_x86::RegInfo::last_mm, RegisterContextPOSIX_x86::RegInfo::last_st, RegisterContextPOSIX_x86::RegInfo::last_xmm, RegisterContextPOSIX_x86::RegInfo::last_ymm, LLDB_INVALID_REGNUM, m_fctrl_offset_in_userarea, RegisterContextPOSIX_x86::m_fpr, RegisterContextPOSIX_x86::m_reg_info, lldb_private::RegisterContext::m_thread, RegisterContextPOSIX_x86::m_ymm_set, ReadFPR(), ReadRegister(), lldb_private::RegisterValue::SetBytes(), lldb_private::RegisterValue::SetType(), lldb_private::RegisterValue::SetUInt16(), lldb_private::RegisterValue::SetUInt32(), lldb_private::RegisterValue::SetUInt64(), lldb_private::RegisterValue::SetUInt8(), lldb_private::FXSAVE::stmm, lldb_private::Status::Success(), ProcessMonitor::WriteDebugRegisterValue(), WriteFPR(), ProcessMonitor::WriteRegisterValue(), arm64_dwarf::x1, lldb_private::FXSAVE::xmm, and lldb_private::YMM::ymm.

Referenced by ClearHardwareWatchpoint(), ClearWatchpointHits(), IsWatchpointHit(), IsWatchpointVacant(), and SetHardwareWatchpointWithIndex().

◆ WriteRegister() [2/2]

bool RegisterContextPOSIXProcessMonitor_x86_64::WriteRegister ( const lldb_private::RegisterInfo *  reg_info,
const lldb_private::RegisterValue value 
)
overrideprotected

Member Data Documentation

◆ m_fctrl_offset_in_userarea

uint32_t RegisterContextPOSIXProcessMonitor_x86_64::m_fctrl_offset_in_userarea
private

◆ m_iovec

struct iovec RegisterContextPOSIXProcessMonitor_x86_64::m_iovec
private

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