LLDB mainline
UnwindAssemblyInstEmulation Class Reference

#include <UnwindAssemblyInstEmulation.h>

Inheritance diagram for UnwindAssemblyInstEmulation:
[legend]

Classes

struct  UnwindState

Public Member Functions

 ~UnwindAssemblyInstEmulation () override=default
bool GetNonCallSiteUnwindPlanFromAssembly (lldb_private::AddressRange &func, lldb_private::Thread &thread, lldb_private::UnwindPlan &unwind_plan) override
bool GetNonCallSiteUnwindPlanFromAssembly (lldb_private::AddressRange &func, uint8_t *opcode_data, size_t opcode_size, lldb_private::UnwindPlan &unwind_plan)
bool AugmentUnwindPlanFromCallSite (lldb_private::AddressRange &func, lldb_private::Thread &thread, lldb_private::UnwindPlan &unwind_plan) override
bool GetFastUnwindPlan (lldb_private::AddressRange &func, lldb_private::Thread &thread, lldb_private::UnwindPlan &unwind_plan) override
bool FirstNonPrologueInsn (lldb_private::AddressRange &func, const lldb_private::ExecutionContext &exe_ctx, lldb_private::Address &first_non_prologue_insn) override
llvm::StringRef GetPluginName () override
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 lldb_private::UnwindAssemblyCreateInstance (const lldb_private::ArchSpec &arch)
static void Initialize ()
static void Terminate ()
static llvm::StringRef GetPluginNameStatic ()
static llvm::StringRef GetPluginDescriptionStatic ()
Static Public Member Functions inherited from lldb_private::UnwindAssembly
static lldb::UnwindAssemblySP FindPlugin (const ArchSpec &arch)

Private Types

typedef std::map< uint64_t, lldb_private::RegisterValueRegisterValueMap
typedef std::map< uint64_t, uint64_t > PushedRegisterToAddrMap

Private Member Functions

 UnwindAssemblyInstEmulation (const lldb_private::ArchSpec &arch, lldb_private::EmulateInstruction *inst_emulator)
size_t WriteMemory (lldb_private::EmulateInstruction *instruction, const lldb_private::EmulateInstruction::Context &context, lldb::addr_t addr, const void *dst, size_t length)
bool ReadRegister (lldb_private::EmulateInstruction *instruction, const lldb_private::RegisterInfo *reg_info, lldb_private::RegisterValue &reg_value)
bool WriteRegister (lldb_private::EmulateInstruction *instruction, const lldb_private::EmulateInstruction::Context &context, const lldb_private::RegisterInfo *reg_info, const lldb_private::RegisterValue &reg_value)
void SetRegisterValue (const lldb_private::RegisterInfo &reg_info, const lldb_private::RegisterValue &reg_value)
bool GetRegisterValue (const lldb_private::RegisterInfo &reg_info, lldb_private::RegisterValue &reg_value)

Static Private Member Functions

static size_t ReadMemory (lldb_private::EmulateInstruction *instruction, void *baton, const lldb_private::EmulateInstruction::Context &context, lldb::addr_t addr, void *dst, size_t length)
static size_t WriteMemory (lldb_private::EmulateInstruction *instruction, void *baton, const lldb_private::EmulateInstruction::Context &context, lldb::addr_t addr, const void *dst, size_t length)
static bool ReadRegister (lldb_private::EmulateInstruction *instruction, void *baton, const lldb_private::RegisterInfo *reg_info, lldb_private::RegisterValue &reg_value)
static bool WriteRegister (lldb_private::EmulateInstruction *instruction, void *baton, const lldb_private::EmulateInstruction::Context &context, const lldb_private::RegisterInfo *reg_info, const lldb_private::RegisterValue &reg_value)
static uint64_t MakeRegisterKindValuePair (const lldb_private::RegisterInfo &reg_info)

Private Attributes

std::unique_ptr< lldb_private::EmulateInstructionm_inst_emulator_up
lldb_private::AddressRangem_range_ptr
lldb_private::UnwindPlanm_unwind_plan_ptr
UnwindState m_state
uint64_t m_initial_sp
PushedRegisterToAddrMap m_pushed_regs
bool m_curr_row_modified
uint32_t m_forward_branch_offset

Additional Inherited Members

Protected Member Functions inherited from lldb_private::UnwindAssembly
 UnwindAssembly (const ArchSpec &arch)
Protected Attributes inherited from lldb_private::UnwindAssembly
ArchSpec m_arch

Detailed Description

Definition at line 18 of file UnwindAssemblyInstEmulation.h.

Member Typedef Documentation

◆ PushedRegisterToAddrMap

typedef std::map<uint64_t, uint64_t> UnwindAssemblyInstEmulation::PushedRegisterToAddrMap
private

Definition at line 137 of file UnwindAssemblyInstEmulation.h.

◆ RegisterValueMap

Constructor & Destructor Documentation

◆ ~UnwindAssemblyInstEmulation()

UnwindAssemblyInstEmulation::~UnwindAssemblyInstEmulation ( )
overridedefault

◆ UnwindAssemblyInstEmulation()

Member Function Documentation

◆ AugmentUnwindPlanFromCallSite()

bool UnwindAssemblyInstEmulation::AugmentUnwindPlanFromCallSite ( lldb_private::AddressRange & func,
lldb_private::Thread & thread,
lldb_private::UnwindPlan & unwind_plan )
overridevirtual

Implements lldb_private::UnwindAssembly.

Definition at line 228 of file UnwindAssemblyInstEmulation.cpp.

◆ CreateInstance()

UnwindAssembly * UnwindAssemblyInstEmulation::CreateInstance ( const lldb_private::ArchSpec & arch)
static

◆ FirstNonPrologueInsn()

bool UnwindAssemblyInstEmulation::FirstNonPrologueInsn ( lldb_private::AddressRange & func,
const lldb_private::ExecutionContext & exe_ctx,
lldb_private::Address & first_non_prologue_insn )
overridevirtual

Implements lldb_private::UnwindAssembly.

Definition at line 239 of file UnwindAssemblyInstEmulation.cpp.

◆ GetFastUnwindPlan()

bool UnwindAssemblyInstEmulation::GetFastUnwindPlan ( lldb_private::AddressRange & func,
lldb_private::Thread & thread,
lldb_private::UnwindPlan & unwind_plan )
overridevirtual

Implements lldb_private::UnwindAssembly.

Definition at line 233 of file UnwindAssemblyInstEmulation.cpp.

◆ GetNonCallSiteUnwindPlanFromAssembly() [1/2]

bool UnwindAssemblyInstEmulation::GetNonCallSiteUnwindPlanFromAssembly ( lldb_private::AddressRange & func,
lldb_private::Thread & thread,
lldb_private::UnwindPlan & unwind_plan )
overridevirtual

◆ GetNonCallSiteUnwindPlanFromAssembly() [2/2]

bool UnwindAssemblyInstEmulation::GetNonCallSiteUnwindPlanFromAssembly ( lldb_private::AddressRange & func,
uint8_t * opcode_data,
size_t opcode_size,
lldb_private::UnwindPlan & unwind_plan )

◆ GetPluginDescriptionStatic()

llvm::StringRef UnwindAssemblyInstEmulation::GetPluginDescriptionStatic ( )
static

Definition at line 265 of file UnwindAssemblyInstEmulation.cpp.

Referenced by Initialize().

◆ GetPluginName()

llvm::StringRef UnwindAssemblyInstEmulation::GetPluginName ( )
inlineoverridevirtual

Implements lldb_private::PluginInterface.

Definition at line 59 of file UnwindAssemblyInstEmulation.h.

References GetPluginNameStatic().

◆ GetPluginNameStatic()

llvm::StringRef UnwindAssemblyInstEmulation::GetPluginNameStatic ( )
inlinestatic

Definition at line 55 of file UnwindAssemblyInstEmulation.h.

Referenced by GetPluginName(), and Initialize().

◆ GetRegisterValue()

bool UnwindAssemblyInstEmulation::GetRegisterValue ( const lldb_private::RegisterInfo & reg_info,
lldb_private::RegisterValue & reg_value )
private

◆ Initialize()

void UnwindAssemblyInstEmulation::Initialize ( )
static

◆ MakeRegisterKindValuePair()

uint64_t UnwindAssemblyInstEmulation::MakeRegisterKindValuePair ( const lldb_private::RegisterInfo & reg_info)
staticprivate

◆ ReadMemory()

◆ ReadRegister() [1/2]

◆ ReadRegister() [2/2]

bool UnwindAssemblyInstEmulation::ReadRegister ( lldb_private::EmulateInstruction * instruction,
void * baton,
const lldb_private::RegisterInfo * reg_info,
lldb_private::RegisterValue & reg_value )
staticprivate

◆ SetRegisterValue()

void UnwindAssemblyInstEmulation::SetRegisterValue ( const lldb_private::RegisterInfo & reg_info,
const lldb_private::RegisterValue & reg_value )
private

◆ Terminate()

void UnwindAssemblyInstEmulation::Terminate ( )
static

◆ WriteMemory() [1/2]

size_t UnwindAssemblyInstEmulation::WriteMemory ( lldb_private::EmulateInstruction * instruction,
const lldb_private::EmulateInstruction::Context & context,
lldb::addr_t addr,
const void * dst,
size_t length )
private

Definition at line 327 of file UnwindAssemblyInstEmulation.cpp.

References lldb_private::EmulateInstruction::Context::ContextInfo::RegisterToRegisterPlusOffset::data_reg, lldb_private::EmulateInstruction::Context::Dump(), lldb_private::DumpDataExtractor(), lldb_private::EmulateInstruction::eContextAbsoluteBranchRegister, lldb_private::EmulateInstruction::eContextAdjustBaseRegister, lldb_private::EmulateInstruction::eContextAdjustPC, lldb_private::EmulateInstruction::eContextAdjustStackPointer, lldb_private::EmulateInstruction::eContextAdvancePC, lldb_private::EmulateInstruction::eContextArithmetic, lldb_private::EmulateInstruction::eContextImmediate, lldb_private::EmulateInstruction::eContextInvalid, lldb_private::EmulateInstruction::eContextPopRegisterOffStack, lldb_private::EmulateInstruction::eContextPushRegisterOnStack, lldb_private::EmulateInstruction::eContextReadOpcode, lldb_private::EmulateInstruction::eContextRegisterLoad, lldb_private::EmulateInstruction::eContextRegisterPlusOffset, lldb_private::EmulateInstruction::eContextRegisterStore, lldb_private::EmulateInstruction::eContextRelativeBranchImmediate, lldb_private::EmulateInstruction::eContextReturnFromException, lldb_private::EmulateInstruction::eContextSupervisorCall, lldb_private::EmulateInstruction::eContextTableBranchReadMemory, lldb_private::EmulateInstruction::eContextWriteMemoryRandomBits, lldb_private::EmulateInstruction::eContextWriteRegisterRandomBits, lldb::eFormatBytes, lldb_private::EmulateInstruction::eInfoTypeRegisterToRegisterPlusOffset, lldb::eRegisterKindGeneric, lldb_private::ArchSpec::GetAddressByteSize(), lldb_private::EmulateInstruction::GetArchitecture(), lldb_private::ArchSpec::GetByteOrder(), lldb_private::EmulateInstruction::Context::GetInfoType(), lldb_private::GetLog(), lldb_private::StreamString::GetString(), lldb_private::Log::GetVerbose(), lldb_private::EmulateInstruction::Context::info, lldb_private::RegisterInfo::kinds, LLDB_INVALID_REGNUM, LLDB_REGNUM_GENERIC_SP, m_curr_row_modified, m_initial_sp, m_pushed_regs, m_state, m_unwind_plan_ptr, lldb_private::Stream::PutCString(), lldb_private::Log::PutString(), lldb_private::EmulateInstruction::Context::ContextInfo::RegisterToRegisterPlusOffset, lldb_private::EmulateInstruction::Context::type, UINT32_MAX, and lldb_private::Unwind.

◆ WriteMemory() [2/2]

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

◆ WriteRegister() [1/2]

bool UnwindAssemblyInstEmulation::WriteRegister ( lldb_private::EmulateInstruction * instruction,
const lldb_private::EmulateInstruction::Context & context,
const lldb_private::RegisterInfo * reg_info,
const lldb_private::RegisterValue & reg_value )
private

Definition at line 435 of file UnwindAssemblyInstEmulation.cpp.

References lldb_private::EmulateInstruction::Context::ContextInfo::address, lldb_private::EmulateInstruction::Context::Dump(), lldb_private::DumpRegisterValue(), lldb_private::EmulateInstruction::eContextAbsoluteBranchRegister, lldb_private::EmulateInstruction::eContextAdjustBaseRegister, lldb_private::EmulateInstruction::eContextAdjustPC, lldb_private::EmulateInstruction::eContextAdjustStackPointer, lldb_private::EmulateInstruction::eContextAdvancePC, lldb_private::EmulateInstruction::eContextArithmetic, lldb_private::EmulateInstruction::eContextImmediate, lldb_private::EmulateInstruction::eContextInvalid, lldb_private::EmulateInstruction::eContextPopRegisterOffStack, lldb_private::EmulateInstruction::eContextPushRegisterOnStack, lldb_private::EmulateInstruction::eContextReadOpcode, lldb_private::EmulateInstruction::eContextRegisterLoad, lldb_private::EmulateInstruction::eContextRegisterPlusOffset, lldb_private::EmulateInstruction::eContextRegisterStore, lldb_private::EmulateInstruction::eContextRelativeBranchImmediate, lldb_private::EmulateInstruction::eContextRestoreStackPointer, lldb_private::EmulateInstruction::eContextReturnFromException, lldb_private::EmulateInstruction::eContextSetFramePointer, lldb_private::EmulateInstruction::eContextSupervisorCall, lldb_private::EmulateInstruction::eContextTableBranchReadMemory, lldb_private::EmulateInstruction::eContextWriteMemoryRandomBits, lldb_private::EmulateInstruction::eContextWriteRegisterRandomBits, lldb::eFormatDefault, lldb_private::EmulateInstruction::eInfoTypeAddress, lldb_private::EmulateInstruction::eInfoTypeImmediate, lldb_private::EmulateInstruction::eInfoTypeImmediateSigned, lldb_private::EmulateInstruction::eInfoTypeISA, lldb_private::EmulateInstruction::eInfoTypeISAAndImmediate, lldb_private::EmulateInstruction::eInfoTypeISAAndImmediateSigned, lldb_private::EmulateInstruction::eInfoTypeRegisterPlusOffset, lldb::eRegisterKindGeneric, lldb_private::RegisterValue::GetAsUInt64(), lldb_private::EmulateInstruction::Context::GetInfoType(), lldb_private::GetLog(), GetRegisterValue(), lldb_private::StreamString::GetString(), lldb_private::Log::GetVerbose(), lldb_private::EmulateInstruction::Context::info, lldb_private::EmulateInstruction::Context::ContextInfo::ISAAndImmediate, lldb_private::EmulateInstruction::Context::ContextInfo::ISAAndImmediateSigned, lldb_private::RegisterInfo::kinds, LLDB_INVALID_REGNUM, LLDB_REGNUM_GENERIC_FLAGS, LLDB_REGNUM_GENERIC_PC, LLDB_REGNUM_GENERIC_SP, m_curr_row_modified, m_forward_branch_offset, m_initial_sp, m_inst_emulator_up, m_pushed_regs, m_state, m_unwind_plan_ptr, lldb_private::RegisterInfo::name, lldb_private::Stream::Printf(), lldb_private::Stream::PutCString(), lldb_private::Log::PutString(), lldb_private::EmulateInstruction::Context::ContextInfo::RegisterPlusOffset::reg, lldb_private::EmulateInstruction::Context::ContextInfo::RegisterPlusOffset, SetRegisterValue(), lldb_private::EmulateInstruction::Context::ContextInfo::ISAAndImmediateSigned::signed_data32, lldb_private::EmulateInstruction::Context::ContextInfo::signed_immediate, lldb_private::EmulateInstruction::Context::ContextInfo::RegisterPlusOffset::signed_offset, lldb_private::EmulateInstruction::Context::type, lldb_private::EmulateInstruction::Context::ContextInfo::ISAAndImmediate::unsigned_data32, lldb_private::EmulateInstruction::Context::ContextInfo::unsigned_immediate, and lldb_private::Unwind.

◆ WriteRegister() [2/2]

bool UnwindAssemblyInstEmulation::WriteRegister ( lldb_private::EmulateInstruction * instruction,
void * baton,
const lldb_private::EmulateInstruction::Context & context,
const lldb_private::RegisterInfo * reg_info,
const lldb_private::RegisterValue & reg_value )
staticprivate

Member Data Documentation

◆ m_curr_row_modified

bool UnwindAssemblyInstEmulation::m_curr_row_modified
private

◆ m_forward_branch_offset

uint32_t UnwindAssemblyInstEmulation::m_forward_branch_offset
private

◆ m_initial_sp

uint64_t UnwindAssemblyInstEmulation::m_initial_sp
private

◆ m_inst_emulator_up

std::unique_ptr<lldb_private::EmulateInstruction> UnwindAssemblyInstEmulation::m_inst_emulator_up
private

◆ m_pushed_regs

PushedRegisterToAddrMap UnwindAssemblyInstEmulation::m_pushed_regs
private

◆ m_range_ptr

lldb_private::AddressRange* UnwindAssemblyInstEmulation::m_range_ptr
private

◆ m_state

UnwindState UnwindAssemblyInstEmulation::m_state
private

◆ m_unwind_plan_ptr

lldb_private::UnwindPlan* UnwindAssemblyInstEmulation::m_unwind_plan_ptr
private

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