LLDB  mainline
Classes | Namespaces | Functions | Variables
EmulateInstructionRISCV.cpp File Reference
#include <cstdlib>
#include "EmulateInstructionRISCV.h"
#include "Plugins/Process/Utility/RegisterInfoPOSIX_riscv64.h"
#include "Plugins/Process/Utility/lldb-riscv-register-enums.h"
#include "lldb/Core/Address.h"
#include "lldb/Core/PluginManager.h"
#include "lldb/Interpreter/OptionValueArray.h"
#include "lldb/Interpreter/OptionValueDictionary.h"
#include "lldb/Symbol/UnwindPlan.h"
#include "lldb/Utility/ArchSpec.h"
#include "lldb/Utility/LLDBLog.h"
#include "lldb/Utility/Stream.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/Support/MathExtras.h"
Include dependency graph for EmulateInstructionRISCV.cpp:

Go to the source code of this file.

Classes

struct  lldb_private::Wrapped
 
struct  lldb_private::RSRegs< hasRS2 >
 
struct  lldb_private::RSRegs< true >
 

Namespaces

 lldb_private
 A class that represents a running process on the host machine.
 

Functions

constexpr uint32_t lldb_private::DecodeSHAMT5 (uint32_t inst)
 
constexpr uint32_t lldb_private::DecodeSHAMT7 (uint32_t inst)
 
constexpr uint32_t lldb_private::DecodeFunct3 (uint32_t inst)
 
constexpr int32_t lldb_private::SignExt (uint32_t imm)
 
constexpr uint32_t lldb_private::DecodeBImm (uint32_t inst)
 
constexpr uint32_t lldb_private::DecodeSImm (uint32_t inst)
 
constexpr uint32_t lldb_private::DecodeUImm (uint32_t inst)
 
static uint32_t lldb_private::GPREncodingToLLDB (uint32_t reg_encode)
 
static bool lldb_private::ReadRegister (EmulateInstructionRISCV &emulator, uint32_t reg_encode, RegisterValue &value)
 
static bool lldb_private::WriteRegister (EmulateInstructionRISCV &emulator, uint32_t reg_encode, const RegisterValue &value)
 
static bool lldb_private::ExecJAL (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::ExecJALR (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::CompareB (uint64_t rs1, uint64_t rs2, uint32_t funct3)
 
RSRegs< true > lldb_private::readRS1RS2 (EmulateInstructionRISCV &emulator, uint32_t inst)
 
RSRegs< false > lldb_private::readRS1 (EmulateInstructionRISCV &emulator, uint32_t inst)
 
static bool lldb_private::ExecB (EmulateInstructionRISCV &emulator, uint32_t inst, bool ignore_cond)
 
static bool lldb_private::ExecLUI (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::ExecAUIPC (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
template<typename T >
static std::enable_if_t< std::is_integral_v< T >, llvm::Optional< T > > lldb_private::ReadMem (EmulateInstructionRISCV &emulator, uint64_t addr)
 
template<typename T >
static bool lldb_private::WriteMem (EmulateInstructionRISCV &emulator, uint64_t addr, RegisterValue value)
 
static uint64_t lldb_private::LoadStoreAddr (EmulateInstructionRISCV &emulator, uint32_t inst)
 
template<typename T , typename E >
static bool lldb_private::Load (EmulateInstructionRISCV &emulator, uint32_t inst, uint64_t(*extend)(E))
 
template<typename T >
static bool lldb_private::Store (EmulateInstructionRISCV &emulator, uint32_t inst)
 
static bool lldb_private::ExecLB (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::ExecLH (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::ExecLW (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::ExecLD (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::ExecLBU (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::ExecLHU (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::ExecLWU (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::ExecSB (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::ExecSH (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::ExecSW (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::ExecSD (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::ExecADDI (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::ExecSLTI (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::ExecSLTIU (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::ExecXORI (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::ExecORI (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::ExecANDI (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::ExecSLLI (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::ExecSRLI (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::ExecSRAI (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::ExecADD (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::ExecSUB (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::ExecSLL (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::ExecSLT (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::ExecSLTU (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::ExecXOR (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::ExecSRL (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::ExecSRA (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::ExecOR (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::ExecAND (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::ExecADDIW (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::ExecSLLIW (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::ExecSRLIW (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::ExecSRAIW (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::ExecADDW (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::ExecSUBW (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::ExecSLLW (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::ExecSRLW (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::ExecSRAW (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::ExecMUL (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::ExecMULH (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::ExecMULHSU (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::ExecMULHU (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::ExecDIV (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::ExecDIVU (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::ExecREM (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::ExecREMU (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::ExecMULW (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::ExecDIVW (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::ExecDIVUW (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::ExecREMW (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::ExecREMUW (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static uint64_t lldb_private::AtomicAddr (EmulateInstructionRISCV &emulator, uint32_t reg, unsigned int align)
 
template<typename T >
static bool lldb_private::AtomicSwap (EmulateInstructionRISCV &emulator, uint32_t inst, int align, uint64_t(*extend)(T))
 
template<typename T >
static bool lldb_private::AtomicADD (EmulateInstructionRISCV &emulator, uint32_t inst, int align, uint64_t(*extend)(T))
 
template<typename T >
static bool lldb_private::AtomicBitOperate (EmulateInstructionRISCV &emulator, uint32_t inst, int align, uint64_t(*extend)(T), T(*operate)(T, T))
 
template<typename T >
static bool lldb_private::AtomicCmp (EmulateInstructionRISCV &emulator, uint32_t inst, int align, uint64_t(*extend)(T), T(*cmp)(T, T))
 
static bool lldb_private::IsLR (uint32_t inst)
 
static bool lldb_private::IsSC (uint32_t inst)
 
static bool lldb_private::IsBNE (uint32_t inst)
 
static bool lldb_private::ExecAtomicSequence (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::ExecLR_W (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::ExecAMOSWAP_W (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::ExecAMOADD_W (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::ExecAMOXOR_W (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::ExecAMOAND_W (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::ExecAMOOR_W (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::ExecAMOMIN_W (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::ExecAMOMAX_W (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::ExecAMOMINU_W (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::ExecAMOMAXU_W (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::ExecLR_D (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::ExecAMOSWAP_D (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::ExecAMOADD_D (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::ExecAMOXOR_D (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::ExecAMOAND_D (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::ExecAMOOR_D (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::ExecAMOMIN_D (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::ExecAMOMAX_D (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::ExecAMOMINU_D (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 
static bool lldb_private::ExecAMOMAXU_D (EmulateInstructionRISCV &emulator, uint32_t inst, bool)
 

Variables

constexpr uint32_t lldb_private::BEQ = 0b000
 
constexpr uint32_t lldb_private::BNE = 0b001
 
constexpr uint32_t lldb_private::BLT = 0b100
 
constexpr uint32_t lldb_private::BGE = 0b101
 
constexpr uint32_t lldb_private::BLTU = 0b110
 
constexpr uint32_t lldb_private::BGEU = 0b111
 
static const InstrPattern lldb_private::PATTERNS []