LLDB  mainline
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Attributes | Private Member Functions | List of all members
lldb_private::EmulateInstruction Class Referenceabstract

#include <EmulateInstruction.h>

Inheritance diagram for lldb_private::EmulateInstruction:
Inheritance graph
[legend]
Collaboration diagram for lldb_private::EmulateInstruction:
Collaboration graph
[legend]

Classes

struct  Context
 

Public Types

enum  ContextType {
  eContextInvalid = 0, eContextReadOpcode, eContextImmediate, eContextPushRegisterOnStack,
  eContextPopRegisterOffStack, eContextAdjustStackPointer, eContextSetFramePointer, eContextRestoreStackPointer,
  eContextAdjustBaseRegister, eContextAdjustPC, eContextRegisterPlusOffset, eContextRegisterStore,
  eContextRegisterLoad, eContextRelativeBranchImmediate, eContextAbsoluteBranchRegister, eContextSupervisorCall,
  eContextTableBranchReadMemory, eContextWriteRegisterRandomBits, eContextWriteMemoryRandomBits, eContextArithmetic,
  eContextAdvancePC, eContextReturnFromException
}
 
enum  InfoType {
  eInfoTypeRegisterPlusOffset, eInfoTypeRegisterPlusIndirectOffset, eInfoTypeRegisterToRegisterPlusOffset, eInfoTypeRegisterToRegisterPlusIndirectOffset,
  eInfoTypeRegisterRegisterOperands, eInfoTypeOffset, eInfoTypeRegister, eInfoTypeImmediate,
  eInfoTypeImmediateSigned, eInfoTypeAddress, eInfoTypeISAAndImmediate, eInfoTypeISAAndImmediateSigned,
  eInfoTypeISA, eInfoTypeNoArgs
}
 
typedef size_t(* ReadMemoryCallback) (EmulateInstruction *instruction, void *baton, const Context &context, lldb::addr_t addr, void *dst, size_t length)
 
typedef size_t(* WriteMemoryCallback) (EmulateInstruction *instruction, void *baton, const Context &context, lldb::addr_t addr, const void *dst, size_t length)
 
typedef bool(* ReadRegisterCallback) (EmulateInstruction *instruction, void *baton, const RegisterInfo *reg_info, RegisterValue &reg_value)
 
typedef bool(* WriteRegisterCallback) (EmulateInstruction *instruction, void *baton, const Context &context, const RegisterInfo *reg_info, const RegisterValue &reg_value)
 
typedef uint32_t InstructionCondition
 

Public Member Functions

 EmulateInstruction (const ArchSpec &arch)
 
 ~EmulateInstruction () override=default
 
virtual bool SupportsEmulatingInstructionsOfType (InstructionType inst_type)=0
 
virtual bool SetTargetTriple (const ArchSpec &arch)=0
 
virtual bool ReadInstruction ()=0
 
virtual bool EvaluateInstruction (uint32_t evaluate_options)=0
 
virtual InstructionCondition GetInstructionCondition ()
 
virtual bool TestEmulation (Stream *out_stream, ArchSpec &arch, OptionValueDictionary *test_data)=0
 
virtual bool GetRegisterInfo (lldb::RegisterKind reg_kind, uint32_t reg_num, RegisterInfo &reg_info)=0
 
virtual bool SetInstruction (const Opcode &insn_opcode, const Address &inst_addr, Target *target)
 
virtual bool CreateFunctionEntryUnwind (UnwindPlan &unwind_plan)
 
bool ReadRegister (const RegisterInfo *reg_info, RegisterValue &reg_value)
 
uint64_t ReadRegisterUnsigned (const RegisterInfo *reg_info, uint64_t fail_value, bool *success_ptr)
 
bool WriteRegister (const Context &context, const RegisterInfo *ref_info, const RegisterValue &reg_value)
 
bool WriteRegisterUnsigned (const Context &context, const RegisterInfo *reg_info, uint64_t reg_value)
 
bool ReadRegister (lldb::RegisterKind reg_kind, uint32_t reg_num, RegisterValue &reg_value)
 
bool WriteRegister (const Context &context, lldb::RegisterKind reg_kind, uint32_t reg_num, const RegisterValue &reg_value)
 
uint64_t ReadRegisterUnsigned (lldb::RegisterKind reg_kind, uint32_t reg_num, uint64_t fail_value, bool *success_ptr)
 
bool WriteRegisterUnsigned (const Context &context, lldb::RegisterKind reg_kind, uint32_t reg_num, uint64_t reg_value)
 
size_t ReadMemory (const Context &context, lldb::addr_t addr, void *dst, size_t dst_len)
 
uint64_t ReadMemoryUnsigned (const Context &context, lldb::addr_t addr, size_t byte_size, uint64_t fail_value, bool *success_ptr)
 
bool WriteMemory (const Context &context, lldb::addr_t addr, const void *src, size_t src_len)
 
bool WriteMemoryUnsigned (const Context &context, lldb::addr_t addr, uint64_t uval, size_t uval_byte_size)
 
uint32_t GetAddressByteSize () const
 
lldb::ByteOrder GetByteOrder () const
 
const OpcodeGetOpcode () const
 
lldb::addr_t GetAddress () const
 
const ArchSpecGetArchitecture () const
 
void SetBaton (void *baton)
 
void SetCallbacks (ReadMemoryCallback read_mem_callback, WriteMemoryCallback write_mem_callback, ReadRegisterCallback read_reg_callback, WriteRegisterCallback write_reg_callback)
 
void SetReadMemCallback (ReadMemoryCallback read_mem_callback)
 
void SetWriteMemCallback (WriteMemoryCallback write_mem_callback)
 
void SetReadRegCallback (ReadRegisterCallback read_reg_callback)
 
void SetWriteRegCallback (WriteRegisterCallback write_reg_callback)
 
- Public Member Functions inherited from lldb_private::PluginInterface
 PluginInterface ()=default
 
virtual ~PluginInterface ()=default
 
virtual llvm::StringRef GetPluginName ()=0
 
 PluginInterface (const PluginInterface &)=delete
 
PluginInterfaceoperator= (const PluginInterface &)=delete
 

Static Public Member Functions

static EmulateInstructionFindPlugin (const ArchSpec &arch, InstructionType supported_inst_type, const char *plugin_name)
 
static const char * TranslateRegister (lldb::RegisterKind reg_kind, uint32_t reg_num, std::string &reg_name)
 
static size_t ReadMemoryFrame (EmulateInstruction *instruction, void *baton, const Context &context, lldb::addr_t addr, void *dst, size_t length)
 
static size_t WriteMemoryFrame (EmulateInstruction *instruction, void *baton, const Context &context, lldb::addr_t addr, const void *dst, size_t length)
 
static bool ReadRegisterFrame (EmulateInstruction *instruction, void *baton, const RegisterInfo *reg_info, RegisterValue &reg_value)
 
static bool WriteRegisterFrame (EmulateInstruction *instruction, void *baton, const Context &context, const RegisterInfo *reg_info, const RegisterValue &reg_value)
 
static size_t ReadMemoryDefault (EmulateInstruction *instruction, void *baton, const Context &context, lldb::addr_t addr, void *dst, size_t length)
 
static size_t WriteMemoryDefault (EmulateInstruction *instruction, void *baton, const Context &context, lldb::addr_t addr, const void *dst, size_t length)
 
static bool ReadRegisterDefault (EmulateInstruction *instruction, void *baton, const RegisterInfo *reg_info, RegisterValue &reg_value)
 
static bool WriteRegisterDefault (EmulateInstruction *instruction, void *baton, const Context &context, const RegisterInfo *reg_info, const RegisterValue &reg_value)
 
static bool GetBestRegisterKindAndNumber (const RegisterInfo *reg_info, lldb::RegisterKind &reg_kind, uint32_t &reg_num)
 
static uint32_t GetInternalRegisterNumber (RegisterContext *reg_ctx, const RegisterInfo &reg_info)
 

Public Attributes

enum lldb_private::EmulateInstruction::InfoType InfoType
 

Static Public Attributes

static const InstructionCondition UnconditionalCondition = UINT32_MAX
 

Protected Attributes

ArchSpec m_arch
 
void * m_baton = nullptr
 
ReadMemoryCallback m_read_mem_callback = &ReadMemoryDefault
 
WriteMemoryCallback m_write_mem_callback = &WriteMemoryDefault
 
ReadRegisterCallback m_read_reg_callback = &ReadRegisterDefault
 
WriteRegisterCallback m_write_reg_callback = &WriteRegisterDefault
 
lldb::addr_t m_addr = LLDB_INVALID_ADDRESS
 
Opcode m_opcode
 

Private Member Functions

 EmulateInstruction (const EmulateInstruction &)=delete
 
const EmulateInstructionoperator= (const EmulateInstruction &)=delete
 

Detailed Description

"lldb/Core/EmulateInstruction.h" A class that allows emulation of CPU opcodes.

This class is a plug-in interface that is accessed through the standard static FindPlugin function call in the EmulateInstruction class. The FindPlugin takes a target triple and returns a new object if there is a plug-in that supports the architecture and OS. Four callbacks and a baton are provided. The four callbacks are read register, write register, read memory and write memory.

This class is currently designed for these main use cases: - Auto generation of Call Frame Information (CFI) from assembly code - Predicting single step breakpoint locations - Emulating instructions for breakpoint traps

Objects can be asked to read an instruction which will cause a call to the read register callback to get the PC, followed by a read memory call to read the opcode. If ReadInstruction () returns true, then a call to EmulateInstruction::EvaluateInstruction () can be made. At this point the EmulateInstruction subclass will use all of the callbacks to emulate an instruction.

Clients that provide the callbacks can either do the read/write registers/memory to actually emulate the instruction on a real or virtual CPU, or watch for the EmulateInstruction::Context which is context for the read/write register/memory which explains why the callback is being called. Examples of a context are: "pushing register 3 onto the stack at offset -12", or "adjusting stack pointer by -16". This extra context allows the generation of CFI information from assembly code without having to actually do the read/write register/memory.

Clients must be prepared that not all instructions for an Instruction Set Architecture (ISA) will be emulated.

Subclasses at the very least should implement the instructions that save and restore registers onto the stack and adjustment to the stack pointer. By just implementing a few instructions for an ISA that are the typical prologue opcodes, you can then generate CFI using a class that will soon be available.

Implementing all of the instructions that affect the PC can then allow single step prediction support.

Implementing all of the instructions allows for emulation of opcodes for breakpoint traps and will pave the way for "thread centric" debugging. The current debugging model is "process centric" where all threads must be stopped when any thread is stopped; when hitting software breakpoints we must disable the breakpoint by restoring the original breakpoint opcode, single stepping and restoring the breakpoint trap. If all threads were allowed to run then other threads could miss the breakpoint.

This class centralizes the code that usually is done in separate code paths in a debugger (single step prediction, finding save restore locations of registers for unwinding stack frame variables) and emulating the instruction is just a bonus.

Definition at line 93 of file EmulateInstruction.h.

Member Typedef Documentation

◆ InstructionCondition

Definition at line 349 of file EmulateInstruction.h.

◆ ReadMemoryCallback

typedef size_t(* lldb_private::EmulateInstruction::ReadMemoryCallback) (EmulateInstruction *instruction, void *baton, const Context &context, lldb::addr_t addr, void *dst, size_t length)

Definition at line 326 of file EmulateInstruction.h.

◆ ReadRegisterCallback

typedef bool(* lldb_private::EmulateInstruction::ReadRegisterCallback) (EmulateInstruction *instruction, void *baton, const RegisterInfo *reg_info, RegisterValue &reg_value)

Definition at line 336 of file EmulateInstruction.h.

◆ WriteMemoryCallback

typedef size_t(* lldb_private::EmulateInstruction::WriteMemoryCallback) (EmulateInstruction *instruction, void *baton, const Context &context, lldb::addr_t addr, const void *dst, size_t length)

Definition at line 331 of file EmulateInstruction.h.

◆ WriteRegisterCallback

typedef bool(* lldb_private::EmulateInstruction::WriteRegisterCallback) (EmulateInstruction *instruction, void *baton, const Context &context, const RegisterInfo *reg_info, const RegisterValue &reg_value)

Definition at line 341 of file EmulateInstruction.h.

Member Enumeration Documentation

◆ ContextType

Enumerator
eContextInvalid 
eContextReadOpcode 
eContextImmediate 
eContextPushRegisterOnStack 
eContextPopRegisterOffStack 
eContextAdjustStackPointer 
eContextSetFramePointer 
eContextRestoreStackPointer 
eContextAdjustBaseRegister 
eContextAdjustPC 
eContextRegisterPlusOffset 
eContextRegisterStore 
eContextRegisterLoad 
eContextRelativeBranchImmediate 
eContextAbsoluteBranchRegister 
eContextSupervisorCall 
eContextTableBranchReadMemory 
eContextWriteRegisterRandomBits 
eContextWriteMemoryRandomBits 
eContextArithmetic 
eContextAdvancePC 
eContextReturnFromException 

Definition at line 99 of file EmulateInstruction.h.

◆ InfoType

Enumerator
eInfoTypeRegisterPlusOffset 
eInfoTypeRegisterPlusIndirectOffset 
eInfoTypeRegisterToRegisterPlusOffset 
eInfoTypeRegisterToRegisterPlusIndirectOffset 
eInfoTypeRegisterRegisterOperands 
eInfoTypeOffset 
eInfoTypeRegister 
eInfoTypeImmediate 
eInfoTypeImmediateSigned 
eInfoTypeAddress 
eInfoTypeISAAndImmediate 
eInfoTypeISAAndImmediateSigned 
eInfoTypeISA 
eInfoTypeNoArgs 

Definition at line 167 of file EmulateInstruction.h.

Constructor & Destructor Documentation

◆ EmulateInstruction() [1/2]

EmulateInstruction::EmulateInstruction ( const ArchSpec arch)

Definition at line 73 of file EmulateInstruction.cpp.

◆ ~EmulateInstruction()

lldb_private::EmulateInstruction::~EmulateInstruction ( )
overridedefault

◆ EmulateInstruction() [2/2]

lldb_private::EmulateInstruction::EmulateInstruction ( const EmulateInstruction )
privatedelete

Member Function Documentation

◆ CreateFunctionEntryUnwind()

bool EmulateInstruction::CreateFunctionEntryUnwind ( UnwindPlan unwind_plan)
virtual

◆ EvaluateInstruction()

virtual bool lldb_private::EmulateInstruction::EvaluateInstruction ( uint32_t  evaluate_options)
pure virtual

◆ FindPlugin()

EmulateInstruction * EmulateInstruction::FindPlugin ( const ArchSpec arch,
InstructionType  supported_inst_type,
const char *  plugin_name 
)
static

◆ GetAddress()

lldb::addr_t lldb_private::EmulateInstruction::GetAddress ( ) const
inline

Definition at line 430 of file EmulateInstruction.h.

References m_addr.

◆ GetAddressByteSize()

uint32_t lldb_private::EmulateInstruction::GetAddressByteSize ( ) const
inline

◆ GetArchitecture()

const ArchSpec& lldb_private::EmulateInstruction::GetArchitecture ( ) const
inline

Definition at line 432 of file EmulateInstruction.h.

References m_arch.

Referenced by UnwindAssemblyInstEmulation::WriteMemory().

◆ GetBestRegisterKindAndNumber()

bool EmulateInstruction::GetBestRegisterKindAndNumber ( const RegisterInfo *  reg_info,
lldb::RegisterKind reg_kind,
uint32_t reg_num 
)
static

◆ GetByteOrder()

lldb::ByteOrder lldb_private::EmulateInstruction::GetByteOrder ( ) const
inline

◆ GetInstructionCondition()

virtual InstructionCondition lldb_private::EmulateInstruction::GetInstructionCondition ( )
inlinevirtual

Reimplemented in lldb_private::EmulateInstructionARM.

Definition at line 366 of file EmulateInstruction.h.

References UnconditionalCondition.

◆ GetInternalRegisterNumber()

uint32_t EmulateInstruction::GetInternalRegisterNumber ( RegisterContext reg_ctx,
const RegisterInfo &  reg_info 
)
static

◆ GetOpcode()

const Opcode& lldb_private::EmulateInstruction::GetOpcode ( ) const
inline

Definition at line 428 of file EmulateInstruction.h.

References m_opcode.

◆ GetRegisterInfo()

virtual bool lldb_private::EmulateInstruction::GetRegisterInfo ( lldb::RegisterKind  reg_kind,
uint32_t  reg_num,
RegisterInfo &  reg_info 
)
pure virtual

◆ operator=()

const EmulateInstruction& lldb_private::EmulateInstruction::operator= ( const EmulateInstruction )
privatedelete

◆ ReadInstruction()

virtual bool lldb_private::EmulateInstruction::ReadInstruction ( )
pure virtual

◆ ReadMemory()

size_t EmulateInstruction::ReadMemory ( const Context context,
lldb::addr_t  addr,
void *  dst,
size_t  dst_len 
)

Definition at line 156 of file EmulateInstruction.cpp.

References m_baton, and m_read_mem_callback.

◆ ReadMemoryDefault()

size_t EmulateInstruction::ReadMemoryDefault ( EmulateInstruction instruction,
void *  baton,
const Context context,
lldb::addr_t  addr,
void *  dst,
size_t  length 
)
static

◆ ReadMemoryFrame()

size_t EmulateInstruction::ReadMemoryFrame ( EmulateInstruction instruction,
void *  baton,
const Context context,
lldb::addr_t  addr,
void *  dst,
size_t  length 
)
static

◆ ReadMemoryUnsigned()

uint64_t EmulateInstruction::ReadMemoryUnsigned ( const Context context,
lldb::addr_t  addr,
size_t  byte_size,
uint64_t  fail_value,
bool *  success_ptr 
)

◆ ReadRegister() [1/2]

bool EmulateInstruction::ReadRegister ( const RegisterInfo *  reg_info,
RegisterValue reg_value 
)

◆ ReadRegister() [2/2]

bool EmulateInstruction::ReadRegister ( lldb::RegisterKind  reg_kind,
uint32_t  reg_num,
RegisterValue reg_value 
)

Definition at line 82 of file EmulateInstruction.cpp.

References GetRegisterInfo(), and ReadRegister().

◆ ReadRegisterDefault()

bool EmulateInstruction::ReadRegisterDefault ( EmulateInstruction instruction,
void *  baton,
const RegisterInfo *  reg_info,
RegisterValue reg_value 
)
static

◆ ReadRegisterFrame()

bool EmulateInstruction::ReadRegisterFrame ( EmulateInstruction instruction,
void *  baton,
const RegisterInfo *  reg_info,
RegisterValue reg_value 
)
static

◆ ReadRegisterUnsigned() [1/2]

uint64_t EmulateInstruction::ReadRegisterUnsigned ( const RegisterInfo *  reg_info,
uint64_t  fail_value,
bool *  success_ptr 
)

Definition at line 103 of file EmulateInstruction.cpp.

References lldb_private::RegisterValue::GetAsUInt64(), and ReadRegister().

Referenced by EmulateInstructionMIPS64::Emulate_3D_branch(), EmulateInstructionMIPS::Emulate_3D_branch(), EmulateInstructionMIPS::Emulate_ADDiu(), EmulateInstructionMIPS::Emulate_ADDIUS5(), EmulateInstructionMIPS::Emulate_ADDIUSP(), EmulateInstructionMIPS::Emulate_B16_MM(), EmulateInstructionMIPS64::Emulate_BAL(), EmulateInstructionMIPS::Emulate_BAL(), EmulateInstructionMIPS64::Emulate_BALC(), EmulateInstructionMIPS::Emulate_BALC(), EmulateInstructionMIPS64::Emulate_BC(), EmulateInstructionMIPS::Emulate_BC(), EmulateInstructionMIPS64::Emulate_BC1EQZ(), EmulateInstructionMIPS::Emulate_BC1EQZ(), EmulateInstructionMIPS64::Emulate_BC1NEZ(), EmulateInstructionMIPS::Emulate_BC1NEZ(), EmulateInstructionMIPS64::Emulate_Bcond_Link(), EmulateInstructionMIPS::Emulate_Bcond_Link(), EmulateInstructionMIPS64::Emulate_Bcond_Link_C(), EmulateInstructionMIPS::Emulate_Bcond_Link_C(), EmulateInstructionMIPS::Emulate_Branch_MM(), EmulateInstructionMIPS64::Emulate_BXX_2ops(), EmulateInstructionMIPS::Emulate_BXX_2ops(), EmulateInstructionMIPS64::Emulate_BXX_2ops_C(), EmulateInstructionMIPS::Emulate_BXX_2ops_C(), EmulateInstructionMIPS64::Emulate_BXX_3ops(), EmulateInstructionMIPS::Emulate_BXX_3ops(), EmulateInstructionMIPS64::Emulate_BXX_3ops_C(), EmulateInstructionMIPS::Emulate_BXX_3ops_C(), EmulateInstructionMIPS64::Emulate_DADDiu(), EmulateInstructionMIPS64::Emulate_DSUBU_DADDU(), EmulateInstructionMIPS64::Emulate_FP_branch(), EmulateInstructionMIPS::Emulate_FP_branch(), EmulateInstructionMIPS64::Emulate_J(), EmulateInstructionMIPS::Emulate_J(), EmulateInstructionMIPS64::Emulate_JAL(), EmulateInstructionMIPS::Emulate_JAL(), EmulateInstructionMIPS64::Emulate_JALR(), EmulateInstructionMIPS::Emulate_JALR(), EmulateInstructionMIPS::Emulate_JALRS(), EmulateInstructionMIPS::Emulate_JALRx16_MM(), EmulateInstructionMIPS::Emulate_JALx(), EmulateInstructionMIPS64::Emulate_JIALC(), EmulateInstructionMIPS::Emulate_JIALC(), EmulateInstructionMIPS64::Emulate_JIC(), EmulateInstructionMIPS::Emulate_JIC(), EmulateInstructionMIPS64::Emulate_JR(), EmulateInstructionMIPS::Emulate_JR(), EmulateInstructionMIPS::Emulate_JRADDIUSP(), EmulateInstructionMIPS64::Emulate_LD(), EmulateInstructionMIPS64::Emulate_LDST_Imm(), EmulateInstructionMIPS::Emulate_LDST_Imm(), EmulateInstructionMIPS64::Emulate_LDST_Reg(), EmulateInstructionMIPS::Emulate_LDST_Reg(), EmulateInstructionMIPS::Emulate_LW(), EmulateInstructionMIPS::Emulate_LWM16_32(), EmulateInstructionMIPS::Emulate_LWSP(), EmulateInstructionMIPS64::Emulate_MSA_Branch_DF(), EmulateInstructionMIPS::Emulate_MSA_Branch_DF(), EmulateInstructionMIPS64::Emulate_MSA_Branch_V(), EmulateInstructionMIPS::Emulate_MSA_Branch_V(), EmulateInstructionMIPS64::Emulate_SD(), EmulateInstructionMIPS::Emulate_SUBU_ADDU(), EmulateInstructionMIPS::Emulate_SW(), EmulateInstructionMIPS::Emulate_SWM16_32(), EmulateInstructionMIPS::Emulate_SWSP(), EmulateInstructionMIPS64::EvaluateInstruction(), EmulateInstructionMIPS::EvaluateInstruction(), EmulateInstructionMIPS64::ReadInstruction(), and EmulateInstructionMIPS::ReadInstruction().

◆ ReadRegisterUnsigned() [2/2]

uint64_t EmulateInstruction::ReadRegisterUnsigned ( lldb::RegisterKind  reg_kind,
uint32_t  reg_num,
uint64_t  fail_value,
bool *  success_ptr 
)

◆ SetBaton()

void EmulateInstruction::SetBaton ( void *  baton)

Definition at line 210 of file EmulateInstruction.cpp.

References m_baton.

◆ SetCallbacks()

void EmulateInstruction::SetCallbacks ( ReadMemoryCallback  read_mem_callback,
WriteMemoryCallback  write_mem_callback,
ReadRegisterCallback  read_reg_callback,
WriteRegisterCallback  write_reg_callback 
)

◆ SetInstruction()

bool EmulateInstruction::SetInstruction ( const Opcode insn_opcode,
const Address inst_addr,
Target target 
)
virtual

◆ SetReadMemCallback()

void EmulateInstruction::SetReadMemCallback ( ReadMemoryCallback  read_mem_callback)

Definition at line 223 of file EmulateInstruction.cpp.

References m_read_mem_callback.

◆ SetReadRegCallback()

void EmulateInstruction::SetReadRegCallback ( ReadRegisterCallback  read_reg_callback)

Definition at line 233 of file EmulateInstruction.cpp.

References m_read_reg_callback.

◆ SetTargetTriple()

virtual bool lldb_private::EmulateInstruction::SetTargetTriple ( const ArchSpec arch)
pure virtual

◆ SetWriteMemCallback()

void EmulateInstruction::SetWriteMemCallback ( WriteMemoryCallback  write_mem_callback)

Definition at line 228 of file EmulateInstruction.cpp.

References m_write_mem_callback.

◆ SetWriteRegCallback()

void EmulateInstruction::SetWriteRegCallback ( WriteRegisterCallback  write_reg_callback)

Definition at line 238 of file EmulateInstruction.cpp.

References m_write_reg_callback.

◆ SupportsEmulatingInstructionsOfType()

virtual bool lldb_private::EmulateInstruction::SupportsEmulatingInstructionsOfType ( InstructionType  inst_type)
pure virtual

◆ TestEmulation()

virtual bool lldb_private::EmulateInstruction::TestEmulation ( Stream out_stream,
ArchSpec arch,
OptionValueDictionary test_data 
)
pure virtual

◆ TranslateRegister()

static const char* lldb_private::EmulateInstruction::TranslateRegister ( lldb::RegisterKind  reg_kind,
uint32_t  reg_num,
std::string reg_name 
)
static

◆ WriteMemory()

bool EmulateInstruction::WriteMemory ( const Context context,
lldb::addr_t  addr,
const void *  src,
size_t  src_len 
)

◆ WriteMemoryDefault()

size_t EmulateInstruction::WriteMemoryDefault ( EmulateInstruction instruction,
void *  baton,
const Context context,
lldb::addr_t  addr,
const void *  dst,
size_t  length 
)
static

◆ WriteMemoryFrame()

size_t EmulateInstruction::WriteMemoryFrame ( EmulateInstruction instruction,
void *  baton,
const Context context,
lldb::addr_t  addr,
const void *  dst,
size_t  length 
)
static

◆ WriteMemoryUnsigned()

bool EmulateInstruction::WriteMemoryUnsigned ( const Context context,
lldb::addr_t  addr,
uint64_t  uval,
size_t  uval_byte_size 
)

◆ WriteRegister() [1/2]

bool EmulateInstruction::WriteRegister ( const Context context,
const RegisterInfo *  ref_info,
const RegisterValue reg_value 
)

◆ WriteRegister() [2/2]

bool EmulateInstruction::WriteRegister ( const Context context,
lldb::RegisterKind  reg_kind,
uint32_t  reg_num,
const RegisterValue reg_value 
)

Definition at line 122 of file EmulateInstruction.cpp.

References GetRegisterInfo(), and WriteRegister().

◆ WriteRegisterDefault()

bool EmulateInstruction::WriteRegisterDefault ( EmulateInstruction instruction,
void *  baton,
const Context context,
const RegisterInfo *  reg_info,
const RegisterValue reg_value 
)
static

◆ WriteRegisterFrame()

bool EmulateInstruction::WriteRegisterFrame ( EmulateInstruction instruction,
void *  baton,
const Context context,
const RegisterInfo *  reg_info,
const RegisterValue reg_value 
)
static

◆ WriteRegisterUnsigned() [1/2]

bool EmulateInstruction::WriteRegisterUnsigned ( const Context context,
const RegisterInfo *  reg_info,
uint64_t  reg_value 
)

Definition at line 145 of file EmulateInstruction.cpp.

References lldb_private::RegisterValue::SetUInt(), and WriteRegister().

Referenced by EmulateInstructionMIPS64::Emulate_3D_branch(), EmulateInstructionMIPS::Emulate_3D_branch(), EmulateInstructionMIPS::Emulate_ADDiu(), EmulateInstructionMIPS::Emulate_ADDIUS5(), EmulateInstructionMIPS::Emulate_ADDIUSP(), EmulateInstructionMIPS::Emulate_B16_MM(), EmulateInstructionMIPS64::Emulate_BAL(), EmulateInstructionMIPS::Emulate_BAL(), EmulateInstructionMIPS64::Emulate_BALC(), EmulateInstructionMIPS::Emulate_BALC(), EmulateInstructionMIPS64::Emulate_BC(), EmulateInstructionMIPS::Emulate_BC(), EmulateInstructionMIPS64::Emulate_BC1EQZ(), EmulateInstructionMIPS::Emulate_BC1EQZ(), EmulateInstructionMIPS64::Emulate_BC1NEZ(), EmulateInstructionMIPS::Emulate_BC1NEZ(), EmulateInstructionMIPS64::Emulate_Bcond_Link(), EmulateInstructionMIPS::Emulate_Bcond_Link(), EmulateInstructionMIPS64::Emulate_Bcond_Link_C(), EmulateInstructionMIPS::Emulate_Bcond_Link_C(), EmulateInstructionMIPS::Emulate_Branch_MM(), EmulateInstructionMIPS64::Emulate_BXX_2ops(), EmulateInstructionMIPS::Emulate_BXX_2ops(), EmulateInstructionMIPS64::Emulate_BXX_2ops_C(), EmulateInstructionMIPS::Emulate_BXX_2ops_C(), EmulateInstructionMIPS64::Emulate_BXX_3ops(), EmulateInstructionMIPS::Emulate_BXX_3ops(), EmulateInstructionMIPS64::Emulate_BXX_3ops_C(), EmulateInstructionMIPS::Emulate_BXX_3ops_C(), EmulateInstructionMIPS64::Emulate_DADDiu(), EmulateInstructionMIPS64::Emulate_DSUBU_DADDU(), EmulateInstructionMIPS64::Emulate_FP_branch(), EmulateInstructionMIPS::Emulate_FP_branch(), EmulateInstructionMIPS64::Emulate_J(), EmulateInstructionMIPS::Emulate_J(), EmulateInstructionMIPS64::Emulate_JAL(), EmulateInstructionMIPS::Emulate_JAL(), EmulateInstructionMIPS64::Emulate_JALR(), EmulateInstructionMIPS::Emulate_JALR(), EmulateInstructionMIPS::Emulate_JALRS(), EmulateInstructionMIPS::Emulate_JALRx16_MM(), EmulateInstructionMIPS::Emulate_JALx(), EmulateInstructionMIPS64::Emulate_JIALC(), EmulateInstructionMIPS::Emulate_JIALC(), EmulateInstructionMIPS64::Emulate_JIC(), EmulateInstructionMIPS::Emulate_JIC(), EmulateInstructionMIPS64::Emulate_JR(), EmulateInstructionMIPS::Emulate_JR(), EmulateInstructionMIPS::Emulate_JRADDIUSP(), EmulateInstructionMIPS64::Emulate_LD(), EmulateInstructionMIPS64::Emulate_LDST_Imm(), EmulateInstructionMIPS::Emulate_LDST_Imm(), EmulateInstructionMIPS64::Emulate_LDST_Reg(), EmulateInstructionMIPS::Emulate_LDST_Reg(), EmulateInstructionMIPS64::Emulate_LUI(), EmulateInstructionMIPS::Emulate_LUI(), EmulateInstructionMIPS::Emulate_LW(), EmulateInstructionMIPS::Emulate_LWSP(), EmulateInstructionMIPS64::Emulate_MSA_Branch_DF(), EmulateInstructionMIPS::Emulate_MSA_Branch_DF(), EmulateInstructionMIPS64::Emulate_MSA_Branch_V(), EmulateInstructionMIPS::Emulate_MSA_Branch_V(), EmulateInstructionMIPS64::Emulate_SD(), EmulateInstructionMIPS::Emulate_SUBU_ADDU(), EmulateInstructionMIPS::Emulate_SW(), EmulateInstructionMIPS::Emulate_SWSP(), EmulateInstructionMIPS64::EvaluateInstruction(), and EmulateInstructionMIPS::EvaluateInstruction().

◆ WriteRegisterUnsigned() [2/2]

bool EmulateInstruction::WriteRegisterUnsigned ( const Context context,
lldb::RegisterKind  reg_kind,
uint32_t  reg_num,
uint64_t  reg_value 
)

Member Data Documentation

◆ InfoType

◆ m_addr

lldb::addr_t lldb_private::EmulateInstruction::m_addr = LLDB_INVALID_ADDRESS
protected

◆ m_arch

ArchSpec lldb_private::EmulateInstruction::m_arch
protected

Definition at line 491 of file EmulateInstruction.h.

Referenced by GetAddressByteSize(), GetArchitecture(), and GetByteOrder().

◆ m_baton

void* lldb_private::EmulateInstruction::m_baton = nullptr
protected

◆ m_opcode

Opcode lldb_private::EmulateInstruction::m_opcode
protected

◆ m_read_mem_callback

ReadMemoryCallback lldb_private::EmulateInstruction::m_read_mem_callback = &ReadMemoryDefault
protected

◆ m_read_reg_callback

ReadRegisterCallback lldb_private::EmulateInstruction::m_read_reg_callback = &ReadRegisterDefault
protected

Definition at line 495 of file EmulateInstruction.h.

Referenced by ReadRegister(), SetCallbacks(), and SetReadRegCallback().

◆ m_write_mem_callback

WriteMemoryCallback lldb_private::EmulateInstruction::m_write_mem_callback = &WriteMemoryDefault
protected

◆ m_write_reg_callback

WriteRegisterCallback lldb_private::EmulateInstruction::m_write_reg_callback = &WriteRegisterDefault
protected

Definition at line 496 of file EmulateInstruction.h.

Referenced by SetCallbacks(), SetWriteRegCallback(), and WriteRegister().

◆ UnconditionalCondition

const InstructionCondition lldb_private::EmulateInstruction::UnconditionalCondition = UINT32_MAX
static

Definition at line 350 of file EmulateInstruction.h.

Referenced by GetInstructionCondition().


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