LLDB  mainline
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
lldb_private::EmulateInstructionRISCV Class Reference

#include <EmulateInstructionRISCV.h>

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

Public Member Functions

 EmulateInstructionRISCV (const ArchSpec &arch)
 
llvm::StringRef GetPluginName () override
 
bool SupportsEmulatingInstructionsOfType (InstructionType inst_type) override
 
bool SetTargetTriple (const ArchSpec &arch) override
 
bool ReadInstruction () override
 
bool EvaluateInstruction (uint32_t options) override
 
bool TestEmulation (Stream *out_stream, ArchSpec &arch, OptionValueDictionary *test_data) override
 
llvm::Optional< RegisterInfo > GetRegisterInfo (lldb::RegisterKind reg_kind, uint32_t reg_num) override
 
llvm::Optional< lldb::addr_tReadPC ()
 
bool WritePC (lldb::addr_t pc)
 
llvm::Optional< DecodeResultReadInstructionAt (lldb::addr_t addr)
 
llvm::Optional< DecodeResultDecode (uint32_t inst)
 
bool Execute (DecodeResult inst, bool ignore_cond)
 
template<typename T >
std::enable_if_t< std::is_integral_v< T >, llvm::Optional< T > > ReadMem (uint64_t addr)
 
template<typename T >
bool WriteMem (uint64_t addr, uint64_t value)
 
llvm::RoundingMode GetRoundingMode ()
 
bool SetAccruedExceptions (llvm::APFloatBase::opStatus)
 
- Public Member Functions inherited from lldb_private::EmulateInstruction
 EmulateInstruction (const ArchSpec &arch)
 
 ~EmulateInstruction () override=default
 
virtual InstructionCondition GetInstructionCondition ()
 
virtual bool SetInstruction (const Opcode &insn_opcode, const Address &inst_addr, Target *target)
 
virtual bool CreateFunctionEntryUnwind (UnwindPlan &unwind_plan)
 
llvm::Optional< RegisterValueReadRegister (const RegisterInfo &reg_info)
 
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
 
 PluginInterface (const PluginInterface &)=delete
 
PluginInterfaceoperator= (const PluginInterface &)=delete
 

Static Public Member Functions

static llvm::StringRef GetPluginNameStatic ()
 
static llvm::StringRef GetPluginDescriptionStatic ()
 
static bool SupportsThisInstructionType (InstructionType inst_type)
 
static bool SupportsThisArch (const ArchSpec &arch)
 
static lldb_private::EmulateInstructionCreateInstance (const lldb_private::ArchSpec &arch, InstructionType inst_type)
 
static void Initialize ()
 
static void Terminate ()
 
- Static Public Member Functions inherited from lldb_private::EmulateInstruction
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)
 

Private Attributes

DecodeResult m_decoded
 Last decoded instruction from m_opcode. More...
 

Additional Inherited Members

- Public Types inherited from lldb_private::EmulateInstruction
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
 
- Static Public Attributes inherited from lldb_private::EmulateInstruction
static const InstructionCondition UnconditionalCondition = UINT32_MAX
 
- Protected Attributes inherited from lldb_private::EmulateInstruction
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
 

Detailed Description

Definition at line 22 of file EmulateInstructionRISCV.h.

Constructor & Destructor Documentation

◆ EmulateInstructionRISCV()

lldb_private::EmulateInstructionRISCV::EmulateInstructionRISCV ( const ArchSpec arch)
inline

Definition at line 52 of file EmulateInstructionRISCV.h.

Member Function Documentation

◆ CreateInstance()

lldb_private::EmulateInstruction * lldb_private::EmulateInstructionRISCV::CreateInstance ( const lldb_private::ArchSpec arch,
InstructionType  inst_type 
)
static

Definition at line 1656 of file EmulateInstructionRISCV.cpp.

◆ Decode()

llvm::Optional< DecodeResult > lldb_private::EmulateInstructionRISCV::Decode ( uint32_t  inst)

◆ EvaluateInstruction()

bool lldb_private::EmulateInstructionRISCV::EvaluateInstruction ( uint32_t  options)
overridevirtual

Implements lldb_private::EmulateInstruction.

Definition at line 1480 of file EmulateInstructionRISCV.cpp.

◆ Execute()

bool lldb_private::EmulateInstructionRISCV::Execute ( DecodeResult  inst,
bool  ignore_cond 
)

◆ GetPluginDescriptionStatic()

static llvm::StringRef lldb_private::EmulateInstructionRISCV::GetPluginDescriptionStatic ( )
inlinestatic

Definition at line 26 of file EmulateInstructionRISCV.h.

◆ GetPluginName()

llvm::StringRef lldb_private::EmulateInstructionRISCV::GetPluginName ( )
inlineoverridevirtual

Implements lldb_private::PluginInterface.

Definition at line 54 of file EmulateInstructionRISCV.h.

References GetPluginNameStatic().

◆ GetPluginNameStatic()

static llvm::StringRef lldb_private::EmulateInstructionRISCV::GetPluginNameStatic ( )
inlinestatic

Definition at line 24 of file EmulateInstructionRISCV.h.

Referenced by GetPluginName().

◆ GetRegisterInfo()

llvm::Optional< RegisterInfo > lldb_private::EmulateInstructionRISCV::GetRegisterInfo ( lldb::RegisterKind  reg_kind,
uint32_t  reg_num 
)
overridevirtual

◆ GetRoundingMode()

llvm::RoundingMode lldb_private::EmulateInstructionRISCV::GetRoundingMode ( )

◆ Initialize()

void lldb_private::EmulateInstructionRISCV::Initialize ( )
static

Definition at line 1646 of file EmulateInstructionRISCV.cpp.

◆ ReadInstruction()

bool lldb_private::EmulateInstructionRISCV::ReadInstruction ( )
overridevirtual

Implements lldb_private::EmulateInstruction.

Definition at line 1511 of file EmulateInstructionRISCV.cpp.

References LLDB_INVALID_ADDRESS.

◆ ReadInstructionAt()

llvm::Optional< DecodeResult > lldb_private::EmulateInstructionRISCV::ReadInstructionAt ( lldb::addr_t  addr)

Definition at line 1505 of file EmulateInstructionRISCV.cpp.

Referenced by lldb_private::AtomicSequence().

◆ ReadMem()

template<typename T >
std::enable_if_t<std::is_integral_v<T>, llvm::Optional<T> > lldb_private::EmulateInstructionRISCV::ReadMem ( uint64_t  addr)
inline

◆ ReadPC()

llvm::Optional< lldb::addr_t > lldb_private::EmulateInstructionRISCV::ReadPC ( )

◆ SetAccruedExceptions()

bool lldb_private::EmulateInstructionRISCV::SetAccruedExceptions ( llvm::APFloatBase::opStatus  opStatus)

◆ SetTargetTriple()

bool lldb_private::EmulateInstructionRISCV::SetTargetTriple ( const ArchSpec arch)
overridevirtual

Implements lldb_private::EmulateInstruction.

Definition at line 1637 of file EmulateInstructionRISCV.cpp.

◆ SupportsEmulatingInstructionsOfType()

bool lldb_private::EmulateInstructionRISCV::SupportsEmulatingInstructionsOfType ( InstructionType  inst_type)
inlineoverridevirtual

◆ SupportsThisArch()

bool lldb_private::EmulateInstructionRISCV::SupportsThisArch ( const ArchSpec arch)
static

Definition at line 1666 of file EmulateInstructionRISCV.cpp.

References lldb_private::ArchSpec::GetTriple().

◆ SupportsThisInstructionType()

static bool lldb_private::EmulateInstructionRISCV::SupportsThisInstructionType ( InstructionType  inst_type)
inlinestatic

◆ Terminate()

void lldb_private::EmulateInstructionRISCV::Terminate ( )
static

Definition at line 1651 of file EmulateInstructionRISCV.cpp.

◆ TestEmulation()

bool lldb_private::EmulateInstructionRISCV::TestEmulation ( Stream out_stream,
ArchSpec arch,
OptionValueDictionary test_data 
)
overridevirtual

Implements lldb_private::EmulateInstruction.

Definition at line 1641 of file EmulateInstructionRISCV.cpp.

◆ WriteMem()

template<typename T >
bool lldb_private::EmulateInstructionRISCV::WriteMem ( uint64_t  addr,
uint64_t  value 
)
inline

◆ WritePC()

bool lldb_private::EmulateInstructionRISCV::WritePC ( lldb::addr_t  pc)

Member Data Documentation

◆ m_decoded

DecodeResult lldb_private::EmulateInstructionRISCV::m_decoded
private

Last decoded instruction from m_opcode.

Definition at line 100 of file EmulateInstructionRISCV.h.


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