LLDB  mainline
Classes | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
RegisterContextDarwin_arm Class Referenceabstract

#include <RegisterContextDarwin_arm.h>

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

Classes

struct  DBG
 
struct  EXC
 
struct  FPU
 
struct  GPR
 
struct  QReg
 

Public Member Functions

 RegisterContextDarwin_arm (lldb_private::Thread &thread, uint32_t concrete_frame_idx)
 
 ~RegisterContextDarwin_arm () override
 
void InvalidateAllRegisters () override
 
size_t GetRegisterCount () override
 
const lldb_private::RegisterInfo * GetRegisterInfoAtIndex (size_t reg) override
 
size_t GetRegisterSetCount () override
 
const lldb_private::RegisterSet * GetRegisterSet (size_t set) override
 
bool ReadRegister (const lldb_private::RegisterInfo *reg_info, lldb_private::RegisterValue &reg_value) override
 
bool WriteRegister (const lldb_private::RegisterInfo *reg_info, const lldb_private::RegisterValue &reg_value) override
 
bool ReadAllRegisterValues (lldb::DataBufferSP &data_sp) override
 
bool WriteAllRegisterValues (const lldb::DataBufferSP &data_sp) override
 
uint32_t ConvertRegisterKindToRegisterNumber (lldb::RegisterKind kind, uint32_t num) override
 Convert from a given register numbering scheme to the lldb register numbering scheme. More...
 
uint32_t NumSupportedHardwareBreakpoints () override
 
uint32_t SetHardwareBreakpoint (lldb::addr_t addr, size_t size) override
 
bool ClearHardwareBreakpoint (uint32_t hw_idx) override
 
uint32_t NumSupportedHardwareWatchpoints () override
 
uint32_t SetHardwareWatchpoint (lldb::addr_t addr, size_t size, bool read, bool write) override
 
bool ClearHardwareWatchpoint (uint32_t hw_index) override
 
- Public Member Functions inherited from lldb_private::RegisterContext
 RegisterContext (Thread &thread, uint32_t concrete_frame_idx)
 
 ~RegisterContext () override
 
void InvalidateIfNeeded (bool force)
 
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 bool HardwareSingleStep (bool enable)
 
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 GetPCForSymbolication (Address &address)
 Get an address suitable for symbolication. More...
 
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 ()=default
 

Static Public Member Functions

static void LogDBGRegisters (lldb_private::Log *log, const DBG &dbg)
 

Protected Types

enum  {
  GPRRegSet = 1, GPRAltRegSet = 9, FPURegSet = 2, EXCRegSet = 3,
  DBGRegSet = 4
}
 
enum  { GPRWordCount = sizeof(GPR) / sizeof(uint32_t), FPUWordCount = sizeof(FPU) / sizeof(uint32_t), EXCWordCount = sizeof(EXC) / sizeof(uint32_t), DBGWordCount = sizeof(DBG) / sizeof(uint32_t) }
 
enum  { Read = 0, Write = 1, kNumErrors = 2 }
 

Protected Member Functions

void InvalidateAllRegisterStates ()
 
int GetError (int flavor, uint32_t err_idx) const
 
bool SetError (int flavor, uint32_t err_idx, int err)
 
bool RegisterSetIsCached (int set) const
 
int ReadGPR (bool force)
 
int ReadFPU (bool force)
 
int ReadEXC (bool force)
 
int ReadDBG (bool force)
 
int WriteGPR ()
 
int WriteFPU ()
 
int WriteEXC ()
 
int WriteDBG ()
 
virtual int DoReadGPR (lldb::tid_t tid, int flavor, GPR &gpr)
 
virtual int DoReadFPU (lldb::tid_t tid, int flavor, FPU &fpu)=0
 
virtual int DoReadEXC (lldb::tid_t tid, int flavor, EXC &exc)=0
 
virtual int DoReadDBG (lldb::tid_t tid, int flavor, DBG &dbg)=0
 
virtual int DoWriteGPR (lldb::tid_t tid, int flavor, const GPR &gpr)=0
 
virtual int DoWriteFPU (lldb::tid_t tid, int flavor, const FPU &fpu)=0
 
virtual int DoWriteEXC (lldb::tid_t tid, int flavor, const EXC &exc)=0
 
virtual int DoWriteDBG (lldb::tid_t tid, int flavor, const DBG &dbg)=0
 
int ReadRegisterSet (uint32_t set, bool force)
 
int WriteRegisterSet (uint32_t set)
 
- Protected Member Functions inherited from lldb_private::RegisterContext
virtual bool BehavesLikeZerothFrame () const
 Indicates that this frame is currently executing code, that the PC value is not a return-pc but an actual executing instruction. More...
 

Static Protected Member Functions

static uint32_t GetRegisterNumber (uint32_t reg_kind, uint32_t reg_num)
 
static int GetSetForNativeRegNum (int reg_num)
 
static size_t GetRegisterInfosCount ()
 
static const lldb_private::RegisterInfo * GetRegisterInfos ()
 

Protected Attributes

GPR gpr
 
FPU fpu
 
EXC exc
 
DBG dbg
 
int gpr_errs [2]
 
int fpu_errs [2]
 
int exc_errs [2]
 
int dbg_errs [2]
 
- Protected Attributes inherited from lldb_private::RegisterContext
Threadm_thread
 
uint32_t m_concrete_frame_idx
 
uint32_t m_stop_id
 

Detailed Description

Definition at line 46 of file RegisterContextDarwin_arm.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protected
Enumerator
GPRRegSet 
GPRAltRegSet 
FPURegSet 
EXCRegSet 
DBGRegSet 

Definition at line 138 of file RegisterContextDarwin_arm.h.

◆ anonymous enum

anonymous enum
protected
Enumerator
GPRWordCount 
FPUWordCount 
EXCWordCount 
DBGWordCount 

Definition at line 146 of file RegisterContextDarwin_arm.h.

◆ anonymous enum

anonymous enum
protected
Enumerator
Read 
Write 
kNumErrors 

Definition at line 153 of file RegisterContextDarwin_arm.h.

Constructor & Destructor Documentation

◆ RegisterContextDarwin_arm()

RegisterContextDarwin_arm::RegisterContextDarwin_arm ( lldb_private::Thread thread,
uint32_t  concrete_frame_idx 
)

Definition at line 861 of file RegisterContextDarwin_arm.cpp.

References exc_errs, fpu_errs, gpr_errs, and kNumErrors.

◆ ~RegisterContextDarwin_arm()

RegisterContextDarwin_arm::~RegisterContextDarwin_arm ( )
overridedefault

Member Function Documentation

◆ ClearHardwareBreakpoint()

bool RegisterContextDarwin_arm::ClearHardwareBreakpoint ( uint32_t  hw_idx)
overridevirtual

◆ ClearHardwareWatchpoint()

bool RegisterContextDarwin_arm::ClearHardwareWatchpoint ( uint32_t  hw_index)
overridevirtual

◆ ConvertRegisterKindToRegisterNumber()

uint32_t RegisterContextDarwin_arm::ConvertRegisterKindToRegisterNumber ( lldb::RegisterKind  kind,
uint32_t  num 
)
overridevirtual

Convert from a given register numbering scheme to the lldb register numbering scheme.

There may be multiple ways to enumerate the registers for a given architecture. ABI references will specify one to be used with DWARF, the register numberings from process plugin, there may be a variation used for eh_frame unwind instructions (e.g. on Darwin), and so on. Register 5 by itself is meaningless - RegisterKind enumeration tells you what context that number should be translated as.

Inside lldb, register numbers are in the eRegisterKindLLDB scheme; arguments which take a register number should take one in that scheme.

eRegisterKindGeneric is a special numbering scheme which gives us constant values for the pc, frame register, stack register, etc., for use within lldb. They may not be defined for all architectures but it allows generic code to translate these common registers into the lldb numbering scheme.

This method translates a given register kind + register number into the eRegisterKindLLDB register numbering.

Parameters
[in]kindThe register numbering scheme (RegisterKind) that the following register number is in.
[in]numA register number in the 'kind' register numbering scheme.
Returns
The equivalent register number in the eRegisterKindLLDB numbering scheme, if possible, else LLDB_INVALID_REGNUM.

Reimplemented from lldb_private::RegisterContext.

Definition at line 1279 of file RegisterContextDarwin_arm.cpp.

References dwarf_lr, dwarf_pc, dwarf_r0, dwarf_r1, dwarf_r10, dwarf_r11, dwarf_r12, dwarf_r2, dwarf_r3, dwarf_r4, dwarf_r5, dwarf_r6, dwarf_r7, dwarf_r8, dwarf_r9, dwarf_s0, dwarf_s1, dwarf_s10, dwarf_s11, dwarf_s12, dwarf_s13, dwarf_s14, dwarf_s15, dwarf_s16, dwarf_s17, dwarf_s18, dwarf_s19, dwarf_s2, dwarf_s20, dwarf_s21, dwarf_s22, dwarf_s23, dwarf_s24, dwarf_s25, dwarf_s26, dwarf_s27, dwarf_s28, dwarf_s29, dwarf_s3, dwarf_s30, dwarf_s31, dwarf_s4, dwarf_s5, dwarf_s6, dwarf_s7, dwarf_s8, dwarf_s9, dwarf_sp, dwarf_spsr, ehframe_cpsr, ehframe_lr, ehframe_pc, ehframe_r0, ehframe_r1, ehframe_r10, ehframe_r11, ehframe_r12, ehframe_r2, ehframe_r3, ehframe_r4, ehframe_r5, ehframe_r6, ehframe_r7, ehframe_r8, ehframe_r9, ehframe_sp, lldb::eRegisterKindDWARF, lldb::eRegisterKindEHFrame, lldb::eRegisterKindGeneric, lldb::eRegisterKindLLDB, fpu_s0, fpu_s1, fpu_s10, fpu_s11, fpu_s12, fpu_s13, fpu_s14, fpu_s15, fpu_s16, fpu_s17, fpu_s18, fpu_s19, fpu_s2, fpu_s20, fpu_s21, fpu_s22, fpu_s23, fpu_s24, fpu_s25, fpu_s26, fpu_s27, fpu_s28, fpu_s29, fpu_s3, fpu_s30, fpu_s31, fpu_s4, fpu_s5, fpu_s6, fpu_s7, fpu_s8, fpu_s9, gpr_cpsr, gpr_lr, gpr_pc, gpr_r0, gpr_r1, gpr_r10, gpr_r11, gpr_r12, gpr_r2, gpr_r3, gpr_r4, gpr_r5, gpr_r6, gpr_r7, gpr_r8, gpr_r9, gpr_sp, LLDB_INVALID_REGNUM, LLDB_REGNUM_GENERIC_FLAGS, LLDB_REGNUM_GENERIC_FP, LLDB_REGNUM_GENERIC_PC, LLDB_REGNUM_GENERIC_RA, and LLDB_REGNUM_GENERIC_SP.

◆ DoReadDBG()

virtual int RegisterContextDarwin_arm::DoReadDBG ( lldb::tid_t  tid,
int  flavor,
DBG dbg 
)
protectedpure virtual

◆ DoReadEXC()

virtual int RegisterContextDarwin_arm::DoReadEXC ( lldb::tid_t  tid,
int  flavor,
EXC exc 
)
protectedpure virtual

◆ DoReadFPU()

virtual int RegisterContextDarwin_arm::DoReadFPU ( lldb::tid_t  tid,
int  flavor,
FPU fpu 
)
protectedpure virtual

◆ DoReadGPR()

virtual int RegisterContextDarwin_arm::DoReadGPR ( lldb::tid_t  tid,
int  flavor,
GPR gpr 
)
inlineprotectedvirtual

◆ DoWriteDBG()

virtual int RegisterContextDarwin_arm::DoWriteDBG ( lldb::tid_t  tid,
int  flavor,
const DBG dbg 
)
protectedpure virtual

◆ DoWriteEXC()

virtual int RegisterContextDarwin_arm::DoWriteEXC ( lldb::tid_t  tid,
int  flavor,
const EXC exc 
)
protectedpure virtual

◆ DoWriteFPU()

virtual int RegisterContextDarwin_arm::DoWriteFPU ( lldb::tid_t  tid,
int  flavor,
const FPU fpu 
)
protectedpure virtual

◆ DoWriteGPR()

virtual int RegisterContextDarwin_arm::DoWriteGPR ( lldb::tid_t  tid,
int  flavor,
const GPR gpr 
)
protectedpure virtual

◆ GetError()

int RegisterContextDarwin_arm::GetError ( int  flavor,
uint32_t  err_idx 
) const
inlineprotected

◆ GetRegisterCount()

size_t RegisterContextDarwin_arm::GetRegisterCount ( )
overridevirtual

◆ GetRegisterInfoAtIndex()

const RegisterInfo * RegisterContextDarwin_arm::GetRegisterInfoAtIndex ( size_t  reg)
overridevirtual

◆ GetRegisterInfos()

const RegisterInfo * RegisterContextDarwin_arm::GetRegisterInfos ( )
staticprotected

Definition at line 895 of file RegisterContextDarwin_arm.cpp.

References g_register_infos.

◆ GetRegisterInfosCount()

size_t RegisterContextDarwin_arm::GetRegisterInfosCount ( )
staticprotected

Definition at line 891 of file RegisterContextDarwin_arm.cpp.

References k_num_register_infos.

◆ GetRegisterNumber()

static uint32_t RegisterContextDarwin_arm::GetRegisterNumber ( uint32_t  reg_kind,
uint32_t  reg_num 
)
staticprotected

◆ GetRegisterSet()

const RegisterSet * RegisterContextDarwin_arm::GetRegisterSet ( size_t  set)
overridevirtual

Implements lldb_private::RegisterContext.

Definition at line 920 of file RegisterContextDarwin_arm.cpp.

References g_reg_sets, and k_num_regsets.

◆ GetRegisterSetCount()

size_t RegisterContextDarwin_arm::GetRegisterSetCount ( )
overridevirtual

Implements lldb_private::RegisterContext.

Definition at line 916 of file RegisterContextDarwin_arm.cpp.

References k_num_regsets.

◆ GetSetForNativeRegNum()

int RegisterContextDarwin_arm::GetSetForNativeRegNum ( int  reg_num)
staticprotected

◆ InvalidateAllRegisters()

void RegisterContextDarwin_arm::InvalidateAllRegisters ( )
overridevirtual

◆ InvalidateAllRegisterStates()

void RegisterContextDarwin_arm::InvalidateAllRegisterStates ( )
inlineprotected

Definition at line 164 of file RegisterContextDarwin_arm.h.

References EXCRegSet, FPURegSet, GPRRegSet, Read, and SetError().

Referenced by InvalidateAllRegisters().

◆ LogDBGRegisters()

void RegisterContextDarwin_arm::LogDBGRegisters ( lldb_private::Log log,
const DBG dbg 
)
static

◆ NumSupportedHardwareBreakpoints()

uint32_t RegisterContextDarwin_arm::NumSupportedHardwareBreakpoints ( )
overridevirtual

◆ NumSupportedHardwareWatchpoints()

uint32_t RegisterContextDarwin_arm::NumSupportedHardwareWatchpoints ( )
overridevirtual

◆ ReadAllRegisterValues()

bool RegisterContextDarwin_arm::ReadAllRegisterValues ( lldb::DataBufferSP &  data_sp)
overridevirtual

◆ ReadDBG()

int RegisterContextDarwin_arm::ReadDBG ( bool  force)
protected

◆ ReadEXC()

int RegisterContextDarwin_arm::ReadEXC ( bool  force)
protected

◆ ReadFPU()

int RegisterContextDarwin_arm::ReadFPU ( bool  force)
protected

◆ ReadGPR()

int RegisterContextDarwin_arm::ReadGPR ( bool  force)
protected

◆ ReadRegister()

bool RegisterContextDarwin_arm::ReadRegister ( const lldb_private::RegisterInfo *  reg_info,
lldb_private::RegisterValue reg_value 
)
override

◆ ReadRegisterSet()

int RegisterContextDarwin_arm::ReadRegisterSet ( uint32_t  set,
bool  force 
)
protected

◆ RegisterSetIsCached()

bool RegisterContextDarwin_arm::RegisterSetIsCached ( int  set) const
inlineprotected

◆ SetError()

bool RegisterContextDarwin_arm::SetError ( int  flavor,
uint32_t  err_idx,
int  err 
)
inlineprotected

◆ SetHardwareBreakpoint()

uint32_t RegisterContextDarwin_arm::SetHardwareBreakpoint ( lldb::addr_t  addr,
size_t  size 
)
overridevirtual

◆ SetHardwareWatchpoint()

uint32_t RegisterContextDarwin_arm::SetHardwareWatchpoint ( lldb::addr_t  addr,
size_t  size,
bool  read,
bool  write 
)
overridevirtual

◆ WriteAllRegisterValues()

bool RegisterContextDarwin_arm::WriteAllRegisterValues ( const lldb::DataBufferSP &  data_sp)
overridevirtual

◆ WriteDBG()

int RegisterContextDarwin_arm::WriteDBG ( )
protected

◆ WriteEXC()

int RegisterContextDarwin_arm::WriteEXC ( )
protected

◆ WriteFPU()

int RegisterContextDarwin_arm::WriteFPU ( )
protected

◆ WriteGPR()

int RegisterContextDarwin_arm::WriteGPR ( )
protected

◆ WriteRegister()

bool RegisterContextDarwin_arm::WriteRegister ( const lldb_private::RegisterInfo *  reg_info,
const lldb_private::RegisterValue reg_value 
)
override

◆ WriteRegisterSet()

int RegisterContextDarwin_arm::WriteRegisterSet ( uint32_t  set)
protected

Member Data Documentation

◆ dbg

DBG RegisterContextDarwin_arm::dbg
protected

◆ dbg_errs

int RegisterContextDarwin_arm::dbg_errs[2]
protected

Definition at line 162 of file RegisterContextDarwin_arm.h.

Referenced by GetError().

◆ exc

EXC RegisterContextDarwin_arm::exc
protected

◆ exc_errs

int RegisterContextDarwin_arm::exc_errs[2]
protected

Definition at line 161 of file RegisterContextDarwin_arm.h.

Referenced by GetError(), RegisterContextDarwin_arm(), and SetError().

◆ fpu

FPU RegisterContextDarwin_arm::fpu
protected

◆ fpu_errs

int RegisterContextDarwin_arm::fpu_errs[2]
protected

Definition at line 160 of file RegisterContextDarwin_arm.h.

Referenced by GetError(), RegisterContextDarwin_arm(), and SetError().

◆ gpr

GPR RegisterContextDarwin_arm::gpr
protected

◆ gpr_errs

int RegisterContextDarwin_arm::gpr_errs[2]
protected

Definition at line 159 of file RegisterContextDarwin_arm.h.

Referenced by GetError(), RegisterContextDarwin_arm(), and SetError().


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