LLDB mainline
lldb_private::EmulateInstructionLoongArch Class Reference

#include <EmulateInstructionLoongArch.h>

Inheritance diagram for lldb_private::EmulateInstructionLoongArch:
[legend]

Classes

struct  Opcode

Public Member Functions

 EmulateInstructionLoongArch (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
std::optional< RegisterInfoGetRegisterInfo (lldb::RegisterKind reg_kind, uint32_t reg_num) override
bool IsLoongArch64 ()
bool TestExecute (uint32_t inst)
Public Member Functions inherited from lldb_private::EmulateInstruction
 EmulateInstruction (const ArchSpec &arch)
 ~EmulateInstruction () override=default
virtual std::optional< uint32_t > GetLastInstrSize ()
virtual InstructionCondition GetInstructionCondition ()
virtual bool SetInstruction (const Opcode &insn_opcode, const Address &inst_addr, Target *target)
virtual bool CreateFunctionEntryUnwind (UnwindPlan &unwind_plan)
std::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)
std::optional< lldb::addr_tReadPC ()
bool WritePC (lldb::addr_t addr)
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)
static std::unique_ptr< SingleStepBreakpointLocationsPredictorCreateBreakpointLocationPredictor (std::unique_ptr< EmulateInstruction > emulator_up)

Private Member Functions

OpcodeGetOpcodeForInstruction (uint32_t inst)
bool EmulateBEQZ (uint32_t inst)
bool EmulateBNEZ (uint32_t inst)
bool EmulateBCEQZ (uint32_t inst)
bool EmulateBCNEZ (uint32_t inst)
bool EmulateJIRL (uint32_t inst)
bool EmulateB (uint32_t inst)
bool EmulateBL (uint32_t inst)
bool EmulateBEQ (uint32_t inst)
bool EmulateBNE (uint32_t inst)
bool EmulateBLT (uint32_t inst)
bool EmulateBGE (uint32_t inst)
bool EmulateBLTU (uint32_t inst)
bool EmulateBGEU (uint32_t inst)
bool EmulateNonJMP (uint32_t inst)
bool EmulateBEQZ64 (uint32_t inst)
bool EmulateBNEZ64 (uint32_t inst)
bool EmulateBCEQZ64 (uint32_t inst)
bool EmulateBCNEZ64 (uint32_t inst)
bool EmulateJIRL64 (uint32_t inst)
bool EmulateB64 (uint32_t inst)
bool EmulateBL64 (uint32_t inst)
bool EmulateBEQ64 (uint32_t inst)
bool EmulateBNE64 (uint32_t inst)
bool EmulateBLT64 (uint32_t inst)
bool EmulateBGE64 (uint32_t inst)
bool EmulateBLTU64 (uint32_t inst)
bool EmulateBGEU64 (uint32_t inst)

Private Attributes

llvm::Triple::ArchType m_arch_subtype

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 Types inherited from lldb_private::EmulateInstruction
using BreakpointLocationsPredictorCreator
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 20 of file EmulateInstructionLoongArch.h.

Constructor & Destructor Documentation

◆ EmulateInstructionLoongArch()

lldb_private::EmulateInstructionLoongArch::EmulateInstructionLoongArch ( const ArchSpec & arch)
inline

Member Function Documentation

◆ CreateInstance()

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

◆ EmulateB()

bool lldb_private::EmulateInstructionLoongArch::EmulateB ( uint32_t inst)
private

Definition at line 225 of file EmulateInstructionLoongArch.cpp.

References EmulateB64(), and IsLoongArch64().

Referenced by GetOpcodeForInstruction().

◆ EmulateB64()

bool lldb_private::EmulateInstructionLoongArch::EmulateB64 ( uint32_t inst)
private

◆ EmulateBCEQZ()

bool lldb_private::EmulateInstructionLoongArch::EmulateBCEQZ ( uint32_t inst)
private

Definition at line 213 of file EmulateInstructionLoongArch.cpp.

References EmulateBCEQZ64(), and IsLoongArch64().

Referenced by GetOpcodeForInstruction().

◆ EmulateBCEQZ64()

◆ EmulateBCNEZ()

bool lldb_private::EmulateInstructionLoongArch::EmulateBCNEZ ( uint32_t inst)
private

Definition at line 217 of file EmulateInstructionLoongArch.cpp.

References EmulateBCNEZ64(), and IsLoongArch64().

Referenced by GetOpcodeForInstruction().

◆ EmulateBCNEZ64()

◆ EmulateBEQ()

bool lldb_private::EmulateInstructionLoongArch::EmulateBEQ ( uint32_t inst)
private

Definition at line 233 of file EmulateInstructionLoongArch.cpp.

References EmulateBEQ64(), and IsLoongArch64().

Referenced by GetOpcodeForInstruction().

◆ EmulateBEQ64()

◆ EmulateBEQZ()

bool lldb_private::EmulateInstructionLoongArch::EmulateBEQZ ( uint32_t inst)
private

Definition at line 205 of file EmulateInstructionLoongArch.cpp.

References EmulateBEQZ64(), and IsLoongArch64().

Referenced by GetOpcodeForInstruction().

◆ EmulateBEQZ64()

◆ EmulateBGE()

bool lldb_private::EmulateInstructionLoongArch::EmulateBGE ( uint32_t inst)
private

Definition at line 245 of file EmulateInstructionLoongArch.cpp.

References EmulateBGE64(), and IsLoongArch64().

Referenced by GetOpcodeForInstruction().

◆ EmulateBGE64()

◆ EmulateBGEU()

bool lldb_private::EmulateInstructionLoongArch::EmulateBGEU ( uint32_t inst)
private

Definition at line 253 of file EmulateInstructionLoongArch.cpp.

References EmulateBGEU64(), and IsLoongArch64().

Referenced by GetOpcodeForInstruction().

◆ EmulateBGEU64()

◆ EmulateBL()

bool lldb_private::EmulateInstructionLoongArch::EmulateBL ( uint32_t inst)
private

Definition at line 229 of file EmulateInstructionLoongArch.cpp.

References EmulateBL64(), and IsLoongArch64().

Referenced by GetOpcodeForInstruction().

◆ EmulateBL64()

◆ EmulateBLT()

bool lldb_private::EmulateInstructionLoongArch::EmulateBLT ( uint32_t inst)
private

Definition at line 241 of file EmulateInstructionLoongArch.cpp.

References EmulateBLT64(), and IsLoongArch64().

Referenced by GetOpcodeForInstruction().

◆ EmulateBLT64()

◆ EmulateBLTU()

bool lldb_private::EmulateInstructionLoongArch::EmulateBLTU ( uint32_t inst)
private

Definition at line 249 of file EmulateInstructionLoongArch.cpp.

References EmulateBLTU64(), and IsLoongArch64().

Referenced by GetOpcodeForInstruction().

◆ EmulateBLTU64()

◆ EmulateBNE()

bool lldb_private::EmulateInstructionLoongArch::EmulateBNE ( uint32_t inst)
private

Definition at line 237 of file EmulateInstructionLoongArch.cpp.

References EmulateBNE64(), and IsLoongArch64().

Referenced by GetOpcodeForInstruction().

◆ EmulateBNE64()

◆ EmulateBNEZ()

bool lldb_private::EmulateInstructionLoongArch::EmulateBNEZ ( uint32_t inst)
private

Definition at line 209 of file EmulateInstructionLoongArch.cpp.

References EmulateBNEZ64(), and IsLoongArch64().

Referenced by GetOpcodeForInstruction().

◆ EmulateBNEZ64()

◆ EmulateJIRL()

bool lldb_private::EmulateInstructionLoongArch::EmulateJIRL ( uint32_t inst)
private

Definition at line 221 of file EmulateInstructionLoongArch.cpp.

References EmulateJIRL64(), and IsLoongArch64().

Referenced by GetOpcodeForInstruction().

◆ EmulateJIRL64()

◆ EmulateNonJMP()

bool lldb_private::EmulateInstructionLoongArch::EmulateNonJMP ( uint32_t inst)
private

Definition at line 257 of file EmulateInstructionLoongArch.cpp.

Referenced by GetOpcodeForInstruction().

◆ EvaluateInstruction()

◆ GetOpcodeForInstruction()

EmulateInstructionLoongArch::Opcode * lldb_private::EmulateInstructionLoongArch::GetOpcodeForInstruction ( uint32_t inst)
private

◆ GetPluginDescriptionStatic()

llvm::StringRef lldb_private::EmulateInstructionLoongArch::GetPluginDescriptionStatic ( )
inlinestatic

Definition at line 24 of file EmulateInstructionLoongArch.h.

Referenced by Initialize().

◆ GetPluginName()

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

Implements lldb_private::PluginInterface.

Definition at line 46 of file EmulateInstructionLoongArch.h.

References GetPluginNameStatic().

◆ GetPluginNameStatic()

llvm::StringRef lldb_private::EmulateInstructionLoongArch::GetPluginNameStatic ( )
inlinestatic

Definition at line 22 of file EmulateInstructionLoongArch.h.

Referenced by GetPluginName(), and Initialize().

◆ GetRegisterInfo()

◆ Initialize()

void lldb_private::EmulateInstructionLoongArch::Initialize ( )
static

◆ IsLoongArch64()

bool lldb_private::EmulateInstructionLoongArch::IsLoongArch64 ( )
inline

◆ ReadInstruction()

◆ SetTargetTriple()

bool lldb_private::EmulateInstructionLoongArch::SetTargetTriple ( const ArchSpec & arch)
overridevirtual

Implements lldb_private::EmulateInstruction.

Definition at line 174 of file EmulateInstructionLoongArch.cpp.

References SupportsThisArch().

◆ SupportsEmulatingInstructionsOfType()

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

◆ SupportsThisArch()

bool lldb_private::EmulateInstructionLoongArch::SupportsThisArch ( const ArchSpec & arch)
static

◆ SupportsThisInstructionType()

bool lldb_private::EmulateInstructionLoongArch::SupportsThisInstructionType ( InstructionType inst_type)
inlinestatic

◆ Terminate()

void lldb_private::EmulateInstructionLoongArch::Terminate ( )
static

◆ TestEmulation()

bool lldb_private::EmulateInstructionLoongArch::TestEmulation ( Stream & out_stream,
ArchSpec & arch,
OptionValueDictionary * test_data )
overridevirtual

Implements lldb_private::EmulateInstruction.

Definition at line 178 of file EmulateInstructionLoongArch.cpp.

◆ TestExecute()

bool lldb_private::EmulateInstructionLoongArch::TestExecute ( uint32_t inst)

Member Data Documentation

◆ m_arch_subtype

llvm::Triple::ArchType lldb_private::EmulateInstructionLoongArch::m_arch_subtype
private

Definition at line 71 of file EmulateInstructionLoongArch.h.

Referenced by EmulateInstructionLoongArch(), and IsLoongArch64().


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