LLDB mainline
|
#include <EmulateInstructionPPC64.h>
Classes | |
struct | Opcode |
Public Member Functions | |
EmulateInstructionPPC64 (const ArchSpec &arch) | |
llvm::StringRef | GetPluginName () override |
bool | SetTargetTriple (const ArchSpec &arch) override |
bool | SupportsEmulatingInstructionsOfType (InstructionType inst_type) override |
bool | ReadInstruction () override |
bool | EvaluateInstruction (uint32_t evaluate_options) override |
bool | TestEmulation (Stream &out_stream, ArchSpec &arch, OptionValueDictionary *test_data) override |
std::optional< RegisterInfo > | GetRegisterInfo (lldb::RegisterKind reg_kind, uint32_t reg_num) override |
bool | CreateFunctionEntryUnwind (UnwindPlan &unwind_plan) override |
Public Member Functions inherited from lldb_private::EmulateInstruction | |
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 std::optional< uint32_t > | GetLastInstrSize () |
virtual bool | EvaluateInstruction (uint32_t evaluate_options)=0 |
virtual InstructionCondition | GetInstructionCondition () |
virtual bool | TestEmulation (Stream &out_stream, ArchSpec &arch, OptionValueDictionary *test_data)=0 |
virtual std::optional< RegisterInfo > | GetRegisterInfo (lldb::RegisterKind reg_kind, uint32_t reg_num)=0 |
virtual bool | SetInstruction (const Opcode &insn_opcode, const Address &inst_addr, Target *target) |
virtual bool | CreateFunctionEntryUnwind (UnwindPlan &unwind_plan) |
std::optional< RegisterValue > | ReadRegister (const RegisterInfo ®_info) |
uint64_t | ReadRegisterUnsigned (const RegisterInfo ®_info, uint64_t fail_value, bool *success_ptr) |
bool | WriteRegister (const Context &context, const RegisterInfo &ref_info, const RegisterValue ®_value) |
bool | WriteRegisterUnsigned (const Context &context, const RegisterInfo ®_info, uint64_t reg_value) |
bool | ReadRegister (lldb::RegisterKind reg_kind, uint32_t reg_num, RegisterValue ®_value) |
bool | WriteRegister (const Context &context, lldb::RegisterKind reg_kind, uint32_t reg_num, const RegisterValue ®_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 Opcode & | GetOpcode () const |
lldb::addr_t | GetAddress () const |
const ArchSpec & | GetArchitecture () 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 | |
PluginInterface & | operator= (const PluginInterface &)=delete |
Static Public Member Functions | |
static void | Initialize () |
static void | Terminate () |
static llvm::StringRef | GetPluginNameStatic () |
static llvm::StringRef | GetPluginDescriptionStatic () |
static EmulateInstruction * | CreateInstance (const ArchSpec &arch, InstructionType inst_type) |
static bool | SupportsEmulatingInstructionsOfTypeStatic (InstructionType inst_type) |
Static Public Member Functions inherited from lldb_private::EmulateInstruction | |
static EmulateInstruction * | FindPlugin (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 ®_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 ®_value) |
static bool | WriteRegisterFrame (EmulateInstruction *instruction, void *baton, const Context &context, const RegisterInfo *reg_info, const RegisterValue ®_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 ®_value) |
static bool | WriteRegisterDefault (EmulateInstruction *instruction, void *baton, const Context &context, const RegisterInfo *reg_info, const RegisterValue ®_value) |
static bool | GetBestRegisterKindAndNumber (const RegisterInfo *reg_info, lldb::RegisterKind ®_kind, uint32_t ®_num) |
static uint32_t | GetInternalRegisterNumber (RegisterContext *reg_ctx, const RegisterInfo ®_info) |
Private Member Functions | |
Opcode * | GetOpcodeForInstruction (uint32_t opcode) |
bool | EmulateMFSPR (uint32_t opcode) |
bool | EmulateLD (uint32_t opcode) |
bool | EmulateSTD (uint32_t opcode) |
bool | EmulateOR (uint32_t opcode) |
bool | EmulateADDI (uint32_t opcode) |
Private Attributes | |
uint32_t | m_fp = LLDB_INVALID_REGNUM |
Definition at line 19 of file EmulateInstructionPPC64.h.
EmulateInstructionPPC64::EmulateInstructionPPC64 | ( | const ArchSpec & | arch | ) |
Definition at line 31 of file EmulateInstructionPPC64.cpp.
|
overridevirtual |
Reimplemented from lldb_private::EmulateInstruction.
Definition at line 116 of file EmulateInstructionPPC64.cpp.
References lldb_private::UnwindPlan::AppendRow(), lldb_private::UnwindPlan::Clear(), lldb_private::eLazyBoolNo, lldb_private::eLazyBoolYes, lldb::eRegisterKindLLDB, gpr_lr_ppc64le, gpr_r1_ppc64le, lldb_private::UnwindPlan::SetRegisterKind(), lldb_private::UnwindPlan::SetReturnAddressRegister(), lldb_private::UnwindPlan::SetSourcedFromCompiler(), lldb_private::UnwindPlan::SetSourceName(), lldb_private::UnwindPlan::SetUnwindPlanForSignalTrap(), and lldb_private::UnwindPlan::SetUnwindPlanValidAtAllInstructions().
|
static |
Definition at line 48 of file EmulateInstructionPPC64.cpp.
References lldb_private::ArchSpec::GetTriple(), and SupportsEmulatingInstructionsOfTypeStatic().
Referenced by Initialize(), and Terminate().
|
private |
Definition at line 359 of file EmulateInstructionPPC64.cpp.
References lldb_private::Bits32(), lldb_private::EmulateInstruction::eContextRestoreStackPointer, lldb::eRegisterKindLLDB, lldb_private::GetLog(), GetRegisterInfo(), gpr_r1_ppc64le, LLDB_LOG, lldb_private::EmulateInstruction::m_addr, ra, lldb_private::EmulateInstruction::ReadRegisterUnsigned(), lldb_private::EmulateInstruction::Context::SetRegisterToRegisterPlusOffset(), lldb_private::EmulateInstruction::Context::type, lldb_private::Unwind, and lldb_private::EmulateInstruction::WriteRegisterUnsigned().
Referenced by GetOpcodeForInstruction().
|
private |
Definition at line 228 of file EmulateInstructionPPC64.cpp.
References lldb_private::Bits32(), lldb_private::EmulateInstruction::eContextRestoreStackPointer, lldb::eRegisterKindLLDB, lldb_private::GetLog(), GetRegisterInfo(), gpr_r1_ppc64le, LLDB_LOG, lldb_private::EmulateInstruction::m_addr, ra, lldb_private::EmulateInstruction::Context::SetRegisterToRegisterPlusOffset(), lldb_private::EmulateInstruction::Context::type, lldb_private::Unwind, and lldb_private::EmulateInstruction::WriteRegisterUnsigned().
Referenced by GetOpcodeForInstruction().
|
private |
Definition at line 203 of file EmulateInstructionPPC64.cpp.
References lldb_private::Bits32(), lldb_private::EmulateInstruction::eContextWriteRegisterRandomBits, lldb::eRegisterKindLLDB, lldb_private::GetLog(), gpr_lr_ppc64le, gpr_r0_ppc64le, LLDB_LOG, lldb_private::EmulateInstruction::m_addr, lldb_private::EmulateInstruction::ReadRegisterUnsigned(), lldb_private::EmulateInstruction::Context::type, lldb_private::Unwind, and lldb_private::EmulateInstruction::WriteRegisterUnsigned().
Referenced by GetOpcodeForInstruction().
|
private |
Definition at line 326 of file EmulateInstructionPPC64.cpp.
References lldb_private::Bits32(), lldb_private::EmulateInstruction::eContextSetFramePointer, lldb::eRegisterKindLLDB, lldb_private::GetLog(), GetRegisterInfo(), gpr_r1_ppc64le, gpr_r30_ppc64le, gpr_r31_ppc64le, LLDB_INVALID_REGNUM, LLDB_LOG, lldb_private::EmulateInstruction::m_addr, m_fp, ra, lldb_private::EmulateInstruction::ReadRegisterUnsigned(), lldb_private::EmulateInstruction::Context::SetRegister(), lldb_private::EmulateInstruction::Context::type, lldb_private::Unwind, and lldb_private::EmulateInstruction::WriteRegisterUnsigned().
Referenced by GetOpcodeForInstruction().
|
private |
Definition at line 258 of file EmulateInstructionPPC64.cpp.
References lldb_private::Bits32(), lldb_private::EmulateInstruction::eContextAdjustStackPointer, lldb_private::EmulateInstruction::eContextPushRegisterOnStack, lldb::eRegisterKindLLDB, lldb_private::GetLog(), GetRegisterInfo(), gpr_lr_ppc64le, gpr_r0_ppc64le, gpr_r1_ppc64le, gpr_r30_ppc64le, gpr_r31_ppc64le, LLDB_LOG, lldb_private::EmulateInstruction::m_addr, ra, lldb_private::EmulateInstruction::ReadRegisterUnsigned(), lldb_private::EmulateInstruction::Context::SetRegisterToRegisterPlusOffset(), lldb_private::EmulateInstruction::Context::type, lldb_private::Unwind, lldb_private::EmulateInstruction::WriteMemory(), and lldb_private::EmulateInstruction::WriteRegisterUnsigned().
Referenced by GetOpcodeForInstruction().
|
overridevirtual |
Implements lldb_private::EmulateInstruction.
Definition at line 159 of file EmulateInstructionPPC64.cpp.
References lldb_private::EmulateInstructionPPC64::Opcode::callback, lldb_private::EmulateInstruction::eContextAdvancePC, lldb::eRegisterKindLLDB, GetOpcodeForInstruction(), gpr_pc_ppc64le, lldb_private::EmulateInstruction::m_opcode, lldb_private::EmulateInstruction::ReadRegisterUnsigned(), lldb_private::EmulateInstruction::Context::SetNoArgs(), lldb_private::EmulateInstruction::Context::type, and lldb_private::EmulateInstruction::WriteRegisterUnsigned().
|
private |
Definition at line 136 of file EmulateInstructionPPC64.cpp.
References EmulateADDI(), EmulateLD(), EmulateMFSPR(), EmulateOR(), and EmulateSTD().
Referenced by EvaluateInstruction().
|
static |
Definition at line 43 of file EmulateInstructionPPC64.cpp.
Referenced by Initialize().
|
inlineoverridevirtual |
Implements lldb_private::PluginInterface.
Definition at line 48 of file EmulateInstructionPPC64.h.
References GetPluginNameStatic().
|
inlinestatic |
Definition at line 27 of file EmulateInstructionPPC64.h.
Referenced by GetPluginName(), and Initialize().
|
overridevirtual |
Implements lldb_private::EmulateInstruction.
Definition at line 69 of file EmulateInstructionPPC64.cpp.
References lldb::eRegisterKindGeneric, lldb::eRegisterKindLLDB, gpr_cr_ppc64le, gpr_lr_ppc64le, gpr_pc_ppc64le, gpr_r1_ppc64le, LLDB_REGNUM_GENERIC_FLAGS, LLDB_REGNUM_GENERIC_PC, LLDB_REGNUM_GENERIC_RA, LLDB_REGNUM_GENERIC_SP, and LLDBTableGetRegisterInfo().
Referenced by EmulateADDI(), EmulateLD(), EmulateOR(), and EmulateSTD().
|
static |
Definition at line 34 of file EmulateInstructionPPC64.cpp.
References CreateInstance(), GetPluginDescriptionStatic(), GetPluginNameStatic(), and lldb_private::PluginManager::RegisterPlugin().
|
overridevirtual |
Implements lldb_private::EmulateInstruction.
Definition at line 100 of file EmulateInstructionPPC64.cpp.
References lldb_private::EmulateInstruction::eContextReadOpcode, lldb::eRegisterKindGeneric, lldb_private::EmulateInstruction::GetByteOrder(), LLDB_INVALID_ADDRESS, LLDB_REGNUM_GENERIC_PC, lldb_private::EmulateInstruction::m_addr, lldb_private::EmulateInstruction::m_opcode, lldb_private::EmulateInstruction::ReadMemoryUnsigned(), lldb_private::EmulateInstruction::ReadRegisterUnsigned(), lldb_private::EmulateInstruction::Context::SetNoArgs(), and lldb_private::EmulateInstruction::Context::type.
|
overridevirtual |
Implements lldb_private::EmulateInstruction.
Definition at line 58 of file EmulateInstructionPPC64.cpp.
References lldb_private::ArchSpec::GetTriple().
|
inlineoverridevirtual |
Implements lldb_private::EmulateInstruction.
Definition at line 52 of file EmulateInstructionPPC64.h.
References SupportsEmulatingInstructionsOfTypeStatic().
|
inlinestatic |
Definition at line 35 of file EmulateInstructionPPC64.h.
References lldb_private::eInstructionTypeAll, lldb_private::eInstructionTypeAny, lldb_private::eInstructionTypePCModifying, and lldb_private::eInstructionTypePrologueEpilogue.
Referenced by CreateInstance(), and SupportsEmulatingInstructionsOfType().
|
static |
Definition at line 39 of file EmulateInstructionPPC64.cpp.
References CreateInstance(), and lldb_private::PluginManager::UnregisterPlugin().
|
inlineoverridevirtual |
Implements lldb_private::EmulateInstruction.
Definition at line 60 of file EmulateInstructionPPC64.h.
|
private |
Definition at line 78 of file EmulateInstructionPPC64.h.
Referenced by EmulateOR().