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]
Collaboration diagram for DisassemblerLLVMC:
Collaboration graph
[legend]

Classes

class  MCDisasmInstance
 

Public Member Functions

 DisassemblerLLVMC (const lldb_private::ArchSpec &arch, const char *flavor)
 
 ~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)
 
InstructionListGetInstructionList ()
 
const InstructionListGetInstructionList () const
 
const ArchSpecGetArchitecture () const
 
const char * GetFlavor () const
 
- 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 void Initialize ()
 
static void Terminate ()
 
static llvm::StringRef GetPluginNameStatic ()
 
static lldb_private::DisassemblerCreateInstance (const lldb_private::ArchSpec &arch, const char *flavor)
 
- Static Public Member Functions inherited from lldb_private::Disassembler
static lldb::DisassemblerSP FindPlugin (const ArchSpec &arch, const char *flavor, const char *plugin_name)
 
static lldb::DisassemblerSP FindPluginForTarget (const Target &target, const ArchSpec &arch, const char *flavor, const char *plugin_name)
 
static lldb::DisassemblerSP DisassembleRange (const ArchSpec &arch, const char *plugin_name, const char *flavor, 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 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 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
 
llvm::Optional< uint32_tm_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
 
lldb::addr_t m_base_addr
 
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
}
 
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 
)

◆ ~DisassemblerLLVMC()

DisassemblerLLVMC::~DisassemblerLLVMC ( )
overridedefault

Member Function Documentation

◆ CreateInstance()

Disassembler * DisassemblerLLVMC::CreateInstance ( const lldb_private::ArchSpec arch,
const char *  flavor 
)
static

Definition at line 1225 of file DisassemblerLLVMC.cpp.

References DisassemblerLLVMC(), and 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 1313 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 46 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

Definition at line 1282 of file DisassemblerLLVMC.cpp.

References CreateInstance(), and GetPluginNameStatic().

◆ IsValid()

bool DisassemblerLLVMC::IsValid ( ) const
protected

Definition at line 1326 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 1328 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 1298 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 1305 of file DisassemblerLLVMC.cpp.

References pc, and SymbolLookup().

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

◆ Terminate()

void DisassemblerLLVMC::Terminate ( )
static

Definition at line 1294 of file DisassemblerLLVMC.cpp.

References CreateInstance().

Friends And Related Function Documentation

◆ InstructionLLVMC

friend class InstructionLLVMC
friend

Definition at line 49 of file DisassemblerLLVMC.h.

Referenced by DecodeInstructions().

Member Data Documentation

◆ m_adrp_address

lldb::addr_t DisassemblerLLVMC::m_adrp_address
protected

Definition at line 79 of file DisassemblerLLVMC.h.

Referenced by SymbolLookup().

◆ m_adrp_insn

llvm::Optional<uint32_t> DisassemblerLLVMC::m_adrp_insn
protected

Definition at line 80 of file DisassemblerLLVMC.h.

Referenced by SymbolLookup().

◆ m_alternate_disasm_up

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

Definition at line 87 of file DisassemblerLLVMC.h.

Referenced by DecodeInstructions(), and DisassemblerLLVMC().

◆ m_data_from_file

bool DisassemblerLLVMC::m_data_from_file
protected

Definition at line 74 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 71 of file DisassemblerLLVMC.h.

Referenced by SymbolLookup().

◆ m_inst

InstructionLLVMC* DisassemblerLLVMC::m_inst
protected

Definition at line 72 of file DisassemblerLLVMC.h.

Referenced by SymbolLookup().

◆ m_mutex

std::mutex DisassemblerLLVMC::m_mutex
protected

Definition at line 73 of file DisassemblerLLVMC.h.


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