LLDB  mainline
Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
lldb_private::Disassembler Class Referenceabstract

#include <Disassembler.h>

Inheritance diagram for lldb_private::Disassembler:
Inheritance graph
[legend]
Collaboration diagram for lldb_private::Disassembler:
Collaboration graph
[legend]

Classes

struct  SourceLine
 
struct  SourceLinesToDisplay
 

Public Types

enum  {
  eOptionNone = 0u, eOptionShowBytes = (1u << 0), eOptionRawOuput = (1u << 1), eOptionMarkPCSourceLine = (1u << 2),
  eOptionMarkPCAddress
}
 
enum  HexImmediateStyle { eHexStyleC, eHexStyleAsm }
 
typedef const char *(* SummaryCallback) (const Instruction &inst, ExecutionContext *exe_context, void *user_data)
 

Public Member Functions

 Disassembler (const ArchSpec &arch, const char *flavor)
 
 ~Disassembler () override
 
size_t ParseInstructions (const ExecutionContext *exe_ctx, const AddressRange &range, Stream *error_strm_ptr, bool prefer_file_cache)
 
size_t ParseInstructions (const ExecutionContext *exe_ctx, const Address &range, uint32_t num_instructions, bool prefer_file_cache)
 
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
virtual ~PluginInterface ()
 
virtual ConstString GetPluginName ()=0
 
virtual uint32_t GetPluginVersion ()=0
 

Static Public Member Functions

static lldb::DisassemblerSP FindPlugin (const ArchSpec &arch, const char *flavor, const char *plugin_name)
 
static lldb::DisassemblerSP FindPluginForTarget (const lldb::TargetSP target_sp, const ArchSpec &arch, const char *flavor, const char *plugin_name)
 
static lldb::DisassemblerSP DisassembleRange (const ArchSpec &arch, const char *plugin_name, const char *flavor, const ExecutionContext &exe_ctx, const AddressRange &disasm_range, bool prefer_file_cache)
 
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 AddressRange &range, uint32_t num_instructions, bool mixed_source_and_assembly, uint32_t num_mixed_context_lines, uint32_t options, Stream &strm)
 
static bool Disassemble (Debugger &debugger, const ArchSpec &arch, const char *plugin_name, const char *flavor, const ExecutionContext &exe_ctx, const Address &start, uint32_t num_instructions, bool mixed_source_and_assembly, uint32_t num_mixed_context_lines, uint32_t options, Stream &strm)
 
static size_t Disassemble (Debugger &debugger, const ArchSpec &arch, const char *plugin_name, const char *flavor, const ExecutionContext &exe_ctx, SymbolContextList &sc_list, uint32_t num_instructions, bool mixed_source_and_assembly, uint32_t num_mixed_context_lines, uint32_t options, Stream &strm)
 
static bool Disassemble (Debugger &debugger, const ArchSpec &arch, const char *plugin_name, const char *flavor, const ExecutionContext &exe_ctx, ConstString name, Module *module, uint32_t num_instructions, bool mixed_source_and_assembly, uint32_t num_mixed_context_lines, uint32_t options, Stream &strm)
 
static bool Disassemble (Debugger &debugger, const ArchSpec &arch, const char *plugin_name, const char *flavor, const ExecutionContext &exe_ctx, uint32_t num_instructions, bool mixed_source_and_assembly, uint32_t num_mixed_context_lines, uint32_t options, Stream &strm)
 
static bool PrintInstructions (Disassembler *disasm_ptr, Debugger &debugger, const ArchSpec &arch, const ExecutionContext &exe_ctx, uint32_t num_instructions, bool mixed_source_and_assembly, uint32_t num_mixed_context_lines, uint32_t options, Stream &strm)
 

Static Protected Member Functions

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

ArchSpec m_arch
 
InstructionList m_instruction_list
 
lldb::addr_t m_base_addr
 
std::string m_flavor
 

Detailed Description

Definition at line 346 of file Disassembler.h.

Member Typedef Documentation

◆ SummaryCallback

typedef const char*(* lldb_private::Disassembler::SummaryCallback) (const Instruction &inst, ExecutionContext *exe_context, void *user_data)

Definition at line 428 of file Disassembler.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
eOptionNone 
eOptionShowBytes 
eOptionRawOuput 
eOptionMarkPCSourceLine 
eOptionMarkPCAddress 

Definition at line 349 of file Disassembler.h.

◆ HexImmediateStyle

Enumerator
eHexStyleC 
eHexStyleAsm 

Definition at line 359 of file Disassembler.h.

Constructor & Destructor Documentation

◆ Disassembler()

Disassembler::Disassembler ( const ArchSpec arch,
const char *  flavor 
)

◆ ~Disassembler()

Disassembler::~Disassembler ( )
overridedefault

Referenced by Disassembler().

Member Function Documentation

◆ AddLineToSourceLineTables()

void Disassembler::AddLineToSourceLineTables ( SourceLine line,
std::map< FileSpec, std::set< uint32_t >> &  source_lines_seen 
)
staticprotected

◆ DecodeInstructions()

virtual size_t lldb_private::Disassembler::DecodeInstructions ( const Address base_addr,
const DataExtractor data,
lldb::offset_t  data_offset,
size_t  num_instructions,
bool  append,
bool  data_from_file 
)
pure virtual

◆ Disassemble() [1/5]

bool Disassembler::Disassemble ( Debugger debugger,
const ArchSpec arch,
const char *  plugin_name,
const char *  flavor,
const ExecutionContext exe_ctx,
const AddressRange range,
uint32_t  num_instructions,
bool  mixed_source_and_assembly,
uint32_t  num_mixed_context_lines,
uint32_t  options,
Stream strm 
)
static

◆ Disassemble() [2/5]

bool Disassembler::Disassemble ( Debugger debugger,
const ArchSpec arch,
const char *  plugin_name,
const char *  flavor,
const ExecutionContext exe_ctx,
const Address start,
uint32_t  num_instructions,
bool  mixed_source_and_assembly,
uint32_t  num_mixed_context_lines,
uint32_t  options,
Stream strm 
)
static

◆ Disassemble() [3/5]

size_t Disassembler::Disassemble ( Debugger debugger,
const ArchSpec arch,
const char *  plugin_name,
const char *  flavor,
const ExecutionContext exe_ctx,
SymbolContextList sc_list,
uint32_t  num_instructions,
bool  mixed_source_and_assembly,
uint32_t  num_mixed_context_lines,
uint32_t  options,
Stream strm 
)
static

◆ Disassemble() [4/5]

bool Disassembler::Disassemble ( Debugger debugger,
const ArchSpec arch,
const char *  plugin_name,
const char *  flavor,
const ExecutionContext exe_ctx,
ConstString  name,
Module module,
uint32_t  num_instructions,
bool  mixed_source_and_assembly,
uint32_t  num_mixed_context_lines,
uint32_t  options,
Stream strm 
)
static

◆ Disassemble() [5/5]

bool Disassembler::Disassemble ( Debugger debugger,
const ArchSpec arch,
const char *  plugin_name,
const char *  flavor,
const ExecutionContext exe_ctx,
uint32_t  num_instructions,
bool  mixed_source_and_assembly,
uint32_t  num_mixed_context_lines,
uint32_t  options,
Stream strm 
)
static

◆ DisassembleBytes()

lldb::DisassemblerSP Disassembler::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

◆ DisassembleRange()

lldb::DisassemblerSP Disassembler::DisassembleRange ( const ArchSpec arch,
const char *  plugin_name,
const char *  flavor,
const ExecutionContext exe_ctx,
const AddressRange disasm_range,
bool  prefer_file_cache 
)
static

◆ ElideMixedSourceAndDisassemblyLine() [1/2]

bool Disassembler::ElideMixedSourceAndDisassemblyLine ( const ExecutionContext exe_ctx,
const SymbolContext sc,
SourceLine line 
)
staticprotected

◆ ElideMixedSourceAndDisassemblyLine() [2/2]

static bool lldb_private::Disassembler::ElideMixedSourceAndDisassemblyLine ( const ExecutionContext exe_ctx,
const SymbolContext sc,
LineEntry line 
)
inlinestaticprotected

◆ FindPlugin()

DisassemblerSP Disassembler::FindPlugin ( const ArchSpec arch,
const char *  flavor,
const char *  plugin_name 
)
static

◆ FindPluginForTarget()

DisassemblerSP Disassembler::FindPluginForTarget ( const lldb::TargetSP  target_sp,
const ArchSpec arch,
const char *  flavor,
const char *  plugin_name 
)
static

Definition at line 92 of file Disassembler.cpp.

References lldb_private::ArchSpec::GetTriple().

◆ FlavorValidForArchSpec()

virtual bool lldb_private::Disassembler::FlavorValidForArchSpec ( const lldb_private::ArchSpec arch,
const char *  flavor 
)
pure virtual

Implemented in DisassemblerLLVMC.

◆ GetArchitecture()

const ArchSpec& lldb_private::Disassembler::GetArchitecture ( ) const
inline

Definition at line 458 of file Disassembler.h.

◆ GetFlavor()

const char* lldb_private::Disassembler::GetFlavor ( ) const
inline

Definition at line 460 of file Disassembler.h.

◆ GetFunctionDeclLineEntry()

Disassembler::SourceLine Disassembler::GetFunctionDeclLineEntry ( const SymbolContext sc)
staticprotected

◆ GetInstructionList() [1/2]

InstructionList & Disassembler::GetInstructionList ( )

◆ GetInstructionList() [2/2]

const InstructionList & Disassembler::GetInstructionList ( ) const

Definition at line 1268 of file Disassembler.cpp.

References m_instruction_list.

◆ ParseInstructions() [1/2]

size_t Disassembler::ParseInstructions ( const ExecutionContext exe_ctx,
const AddressRange range,
Stream error_strm_ptr,
bool  prefer_file_cache 
)

◆ ParseInstructions() [2/2]

size_t Disassembler::ParseInstructions ( const ExecutionContext exe_ctx,
const Address range,
uint32_t  num_instructions,
bool  prefer_file_cache 
)

◆ PrintInstructions()

bool Disassembler::PrintInstructions ( Disassembler disasm_ptr,
Debugger debugger,
const ArchSpec arch,
const ExecutionContext exe_ctx,
uint32_t  num_instructions,
bool  mixed_source_and_assembly,
uint32_t  num_mixed_context_lines,
uint32_t  options,
Stream strm 
)
static

Definition at line 370 of file Disassembler.cpp.

References lldb_private::SymbolContext::Clear(), lldb_private::LineEntry::column, lldb_private::Disassembler::SourceLine::column, lldb_private::SymbolContext::comp_unit, lldb_private::AddressRange::ContainsFileAddress(), lldb_private::Disassembler::SourceLinesToDisplay::current_source_line, lldb_private::Instruction::Dump(), lldb_private::Stream::EOL(), lldb_private::LineEntry::file, lldb_private::Disassembler::SourceLine::file, lldb_private::SymbolContext::function, lldb_private::Instruction::GetAddress(), lldb_private::SymbolContext::GetAddressRange(), lldb_private::Target::GetDebugger(), lldb_private::Debugger::GetDisassemblyFormat(), lldb_private::StackFrame::GetFrameCodeAddress(), lldb_private::ExecutionContext::GetFramePtr(), lldb_private::InstructionList::GetInstructionAtIndex(), GetInstructionList(), lldb_private::InstructionList::GetMaxOpcocdeByteSize(), lldb_private::Address::GetModule(), lldb_private::InstructionList::GetSize(), lldb_private::StreamString::GetSizeOfLastLine(), lldb_private::Debugger::GetSourceManager(), lldb_private::Function::GetStartLineSourceInfo(), lldb_private::ExecutionContext::GetTargetRef(), lldb_private::ExecutionContext::GetTargetSP(), lldb_private::ExecutionContext::HasTargetScope(), lldb_private::LineEntry::IsValid(), lldb_private::LineEntry::line, lldb_private::Disassembler::SourceLine::line, lldb_private::SymbolContext::line_entry, lldb_private::Disassembler::SourceLinesToDisplay::lines, lldb_private::LineEntry::original_file, lldb_private::postfix::Parse(), lldb_private::Disassembler::SourceLinesToDisplay::print_source_context_end_eol, and lldb_private::SymbolContext::symbol.

Member Data Documentation

◆ m_arch

ArchSpec lldb_private::Disassembler::m_arch
protected

Definition at line 532 of file Disassembler.h.

Referenced by Disassembler().

◆ m_base_addr

lldb::addr_t lldb_private::Disassembler::m_base_addr
protected

Definition at line 537 of file Disassembler.h.

◆ m_flavor

std::string lldb_private::Disassembler::m_flavor
protected

Definition at line 538 of file Disassembler.h.

Referenced by Disassembler(), and DisassemblerLLVMC::DisassemblerLLVMC().

◆ m_instruction_list

InstructionList lldb_private::Disassembler::m_instruction_list
protected

Definition at line 536 of file Disassembler.h.

Referenced by DisassemblerLLVMC::DecodeInstructions(), and GetInstructionList().


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