LLDB mainline
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Friends | List of all members
DisassemblerLLVMC Class Reference

#include <DisassemblerLLVMC.h>

Inheritance diagram for DisassemblerLLVMC:
Inheritance graph
[legend]

Classes

class  MCDisasmInstance
 

Public Member Functions

 DisassemblerLLVMC (const lldb_private::ArchSpec &arch, const char *flavor, const char *cpu, const char *features)
 
 ~DisassemblerLLVMC () override
 
size_t DecodeInstructions (const lldb_private::Address &base_addr, const lldb_private::DataExtractor &data, lldb::offset_t data_offset, size_t num_instructions, bool append, bool data_from_file) override
 
llvm::StringRef GetPluginName () override
 
- Public Member Functions inherited from lldb_private::Disassembler
 Disassembler (const ArchSpec &arch, const char *flavor)
 
 ~Disassembler () override
 
void PrintInstructions (Debugger &debugger, const ArchSpec &arch, const ExecutionContext &exe_ctx, bool mixed_source_and_assembly, uint32_t num_mixed_context_lines, uint32_t options, Stream &strm)
 
size_t ParseInstructions (Target &target, Address address, Limit limit, Stream *error_strm_ptr, bool force_live_memory=false)
 
virtual size_t DecodeInstructions (const Address &base_addr, const DataExtractor &data, lldb::offset_t data_offset, size_t num_instructions, bool append, bool data_from_file)=0
 
InstructionListGetInstructionList ()
 
const InstructionListGetInstructionList () const
 
const ArchSpecGetArchitecture () const
 
const char * GetFlavor () const
 
virtual bool FlavorValidForArchSpec (const lldb_private::ArchSpec &arch, const char *flavor)=0
 
- Public Member Functions inherited from lldb_private::PluginInterface
 PluginInterface ()=default
 
virtual ~PluginInterface ()=default
 
virtual llvm::StringRef GetPluginName ()=0
 
 PluginInterface (const PluginInterface &)=delete
 
PluginInterfaceoperator= (const PluginInterface &)=delete
 

Static Public Member Functions

static void Initialize ()
 
static void Terminate ()
 
static llvm::StringRef GetPluginNameStatic ()
 
static lldb::DisassemblerSP CreateInstance (const lldb_private::ArchSpec &arch, const char *flavor, const char *cpu, const char *features)
 
- Static Public Member Functions inherited from lldb_private::Disassembler
static lldb::DisassemblerSP FindPlugin (const ArchSpec &arch, const char *flavor, const char *cpu, const char *features, const char *plugin_name)
 
static lldb::DisassemblerSP FindPluginForTarget (const Target &target, const ArchSpec &arch, const char *flavor, const char *cpu, const char *features, const char *plugin_name)
 
static lldb::DisassemblerSP DisassembleRange (const ArchSpec &arch, const char *plugin_name, const char *flavor, const char *cpu, const char *features, Target &target, const AddressRange &disasm_range, bool force_live_memory=false)
 
static lldb::DisassemblerSP DisassembleBytes (const ArchSpec &arch, const char *plugin_name, const char *flavor, const char *cpu, const char *features, const Address &start, const void *bytes, size_t length, uint32_t max_num_instructions, bool data_from_file)
 
static bool Disassemble (Debugger &debugger, const ArchSpec &arch, const char *plugin_name, const char *flavor, const char *cpu, const char *features, const ExecutionContext &exe_ctx, const Address &start, Limit limit, bool mixed_source_and_assembly, uint32_t num_mixed_context_lines, uint32_t options, Stream &strm)
 
static bool Disassemble (Debugger &debugger, const ArchSpec &arch, StackFrame &frame, Stream &strm)
 

Protected Member Functions

bool FlavorValidForArchSpec (const lldb_private::ArchSpec &arch, const char *flavor) override
 
bool IsValid () const
 
int OpInfo (uint64_t PC, uint64_t Offset, uint64_t Size, int TagType, void *TagBug)
 
const char * SymbolLookup (uint64_t ReferenceValue, uint64_t *ReferenceType, uint64_t ReferencePC, const char **ReferenceName)
 

Static Protected Member Functions

static int OpInfoCallback (void *DisInfo, uint64_t PC, uint64_t Offset, uint64_t Size, int TagType, void *TagBug)
 
static const char * SymbolLookupCallback (void *DisInfo, uint64_t ReferenceValue, uint64_t *ReferenceType, uint64_t ReferencePC, const char **ReferenceName)
 
- Static Protected Member Functions inherited from lldb_private::Disassembler
static SourceLine GetFunctionDeclLineEntry (const SymbolContext &sc)
 
static void AddLineToSourceLineTables (SourceLine &line, std::map< FileSpec, std::set< uint32_t > > &source_lines_seen)
 
static bool ElideMixedSourceAndDisassemblyLine (const ExecutionContext &exe_ctx, const SymbolContext &sc, SourceLine &line)
 
static bool ElideMixedSourceAndDisassemblyLine (const ExecutionContext &exe_ctx, const SymbolContext &sc, LineEntry &line)
 

Protected Attributes

const lldb_private::ExecutionContextm_exe_ctx
 
InstructionLLVMCm_inst
 
std::mutex m_mutex
 
bool m_data_from_file
 
lldb::addr_t m_adrp_address
 
std::optional< uint32_t > m_adrp_insn
 
std::unique_ptr< MCDisasmInstancem_disasm_up
 
std::unique_ptr< MCDisasmInstancem_alternate_disasm_up
 
- Protected Attributes inherited from lldb_private::Disassembler
ArchSpec m_arch
 
InstructionList m_instruction_list
 
std::string m_flavor
 

Friends

class InstructionLLVMC
 

Additional Inherited Members

- Public Types inherited from lldb_private::Disassembler
enum  {
  eOptionNone = 0u , eOptionShowBytes = (1u << 0) , eOptionRawOuput = (1u << 1) , eOptionMarkPCSourceLine = (1u << 2) ,
  eOptionMarkPCAddress , eOptionShowControlFlowKind = (1u << 4)
}
 
enum  HexImmediateStyle { eHexStyleC , eHexStyleAsm }
 

Detailed Description

Definition at line 23 of file DisassemblerLLVMC.h.

Constructor & Destructor Documentation

◆ DisassemblerLLVMC()

DisassemblerLLVMC::DisassemblerLLVMC ( const lldb_private::ArchSpec arch,
const char *  flavor,
const char *  cpu,
const char *  features 
)

Definition at line 1438 of file DisassemblerLLVMC.cpp.

References DisassemblerLLVMC::MCDisasmInstance::Create(), lldb_private::ArchSpec::eCore_mips32, lldb_private::ArchSpec::eCore_mips32el, lldb_private::ArchSpec::eCore_mips32r2, lldb_private::ArchSpec::eCore_mips32r2el, lldb_private::ArchSpec::eCore_mips32r3, lldb_private::ArchSpec::eCore_mips32r3el, lldb_private::ArchSpec::eCore_mips32r5, lldb_private::ArchSpec::eCore_mips32r5el, lldb_private::ArchSpec::eCore_mips32r6, lldb_private::ArchSpec::eCore_mips32r6el, lldb_private::ArchSpec::eCore_mips64, lldb_private::ArchSpec::eCore_mips64el, lldb_private::ArchSpec::eCore_mips64r2, lldb_private::ArchSpec::eCore_mips64r2el, lldb_private::ArchSpec::eCore_mips64r3, lldb_private::ArchSpec::eCore_mips64r3el, lldb_private::ArchSpec::eCore_mips64r5, lldb_private::ArchSpec::eCore_mips64r5el, lldb_private::ArchSpec::eCore_mips64r6, lldb_private::ArchSpec::eCore_mips64r6el, lldb_private::ArchSpec::eMIPSAse_dsp, lldb_private::ArchSpec::eMIPSAse_dspr2, lldb_private::ArchSpec::eMIPSAse_micromips, lldb_private::ArchSpec::eMIPSAse_mips16, lldb_private::ArchSpec::eMIPSAse_msa, lldb_private::ArchSpec::eRISCV_float_abi_double, lldb_private::ArchSpec::eRISCV_float_abi_quad, lldb_private::ArchSpec::eRISCV_float_abi_single, lldb_private::ArchSpec::eRISCV_rvc, lldb_private::ArchSpec::eRISCV_rve, FlavorValidForArchSpec(), lldb_private::ArchSpec::GetCore(), lldb_private::ArchSpec::GetFlags(), lldb_private::ArchSpec::GetTriple(), lldb_private::ArchSpec::IsAlwaysThumbInstructions(), lldb_private::ArchSpec::IsMIPS(), m_alternate_disasm_up, m_disasm_up, and lldb_private::Disassembler::m_flavor.

◆ ~DisassemblerLLVMC()

DisassemblerLLVMC::~DisassemblerLLVMC ( )
overridedefault

Member Function Documentation

◆ CreateInstance()

lldb::DisassemblerSP DisassemblerLLVMC::CreateInstance ( const lldb_private::ArchSpec arch,
const char *  flavor,
const char *  cpu,
const char *  features 
)
static

Definition at line 1620 of file DisassemblerLLVMC.cpp.

References lldb_private::ArchSpec::GetTriple().

Referenced by Initialize(), and Terminate().

◆ DecodeInstructions()

size_t DisassemblerLLVMC::DecodeInstructions ( const lldb_private::Address base_addr,
const lldb_private::DataExtractor data,
lldb::offset_t  data_offset,
size_t  num_instructions,
bool  append,
bool  data_from_file 
)
overridevirtual

◆ FlavorValidForArchSpec()

bool DisassemblerLLVMC::FlavorValidForArchSpec ( const lldb_private::ArchSpec arch,
const char *  flavor 
)
overrideprotectedvirtual

Implements lldb_private::Disassembler.

Definition at line 1709 of file DisassemblerLLVMC.cpp.

References lldb_private::ArchSpec::GetTriple().

Referenced by DisassemblerLLVMC().

◆ GetPluginName()

llvm::StringRef DisassemblerLLVMC::GetPluginName ( )
inlineoverridevirtual

Implements lldb_private::PluginInterface.

Definition at line 48 of file DisassemblerLLVMC.h.

References GetPluginNameStatic().

◆ GetPluginNameStatic()

static llvm::StringRef DisassemblerLLVMC::GetPluginNameStatic ( )
inlinestatic

Definition at line 35 of file DisassemblerLLVMC.h.

Referenced by GetPluginName(), and Initialize().

◆ Initialize()

void DisassemblerLLVMC::Initialize ( )
static

◆ IsValid()

bool DisassemblerLLVMC::IsValid ( ) const
protected

Definition at line 1722 of file DisassemblerLLVMC.cpp.

References m_disasm_up.

Referenced by DecodeInstructions().

◆ OpInfo()

int DisassemblerLLVMC::OpInfo ( uint64_t  PC,
uint64_t  Offset,
uint64_t  Size,
int  TagType,
void *  TagBug 
)
protected

Definition at line 1724 of file DisassemblerLLVMC.cpp.

Referenced by OpInfoCallback().

◆ OpInfoCallback()

int DisassemblerLLVMC::OpInfoCallback ( void *  DisInfo,
uint64_t  PC,
uint64_t  Offset,
uint64_t  Size,
int  TagType,
void *  TagBug 
)
staticprotected

Definition at line 1694 of file DisassemblerLLVMC.cpp.

References OpInfo(), and pc.

◆ SymbolLookup()

const char * DisassemblerLLVMC::SymbolLookup ( uint64_t  ReferenceValue,
uint64_t *  ReferenceType,
uint64_t  ReferencePC,
const char **  ReferenceName 
)
protected

◆ SymbolLookupCallback()

const char * DisassemblerLLVMC::SymbolLookupCallback ( void *  DisInfo,
uint64_t  ReferenceValue,
uint64_t *  ReferenceType,
uint64_t  ReferencePC,
const char **  ReferenceName 
)
staticprotected

Definition at line 1701 of file DisassemblerLLVMC.cpp.

References pc, and SymbolLookup().

Referenced by DisassemblerLLVMC::MCDisasmInstance::Create().

◆ Terminate()

void DisassemblerLLVMC::Terminate ( )
static

Friends And Related Function Documentation

◆ InstructionLLVMC

friend class InstructionLLVMC
friend

Definition at line 51 of file DisassemblerLLVMC.h.

Referenced by DecodeInstructions().

Member Data Documentation

◆ m_adrp_address

lldb::addr_t DisassemblerLLVMC::m_adrp_address
protected

Definition at line 81 of file DisassemblerLLVMC.h.

Referenced by SymbolLookup().

◆ m_adrp_insn

std::optional<uint32_t> DisassemblerLLVMC::m_adrp_insn
protected

Definition at line 82 of file DisassemblerLLVMC.h.

Referenced by SymbolLookup().

◆ m_alternate_disasm_up

std::unique_ptr<MCDisasmInstance> DisassemblerLLVMC::m_alternate_disasm_up
protected

Definition at line 89 of file DisassemblerLLVMC.h.

Referenced by DecodeInstructions(), and DisassemblerLLVMC().

◆ m_data_from_file

bool DisassemblerLLVMC::m_data_from_file
protected

Definition at line 76 of file DisassemblerLLVMC.h.

Referenced by DecodeInstructions().

◆ m_disasm_up

std::unique_ptr<MCDisasmInstance> DisassemblerLLVMC::m_disasm_up
protected

◆ m_exe_ctx

const lldb_private::ExecutionContext* DisassemblerLLVMC::m_exe_ctx
protected

Definition at line 73 of file DisassemblerLLVMC.h.

Referenced by SymbolLookup().

◆ m_inst

InstructionLLVMC* DisassemblerLLVMC::m_inst
protected

Definition at line 74 of file DisassemblerLLVMC.h.

Referenced by SymbolLookup().

◆ m_mutex

std::mutex DisassemblerLLVMC::m_mutex
protected

Definition at line 75 of file DisassemblerLLVMC.h.


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