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

#include <Disassembler.h>

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

Classes

struct  Limit
 
struct  SourceLine
 
struct  SourceLinesToDisplay
 

Public Types

enum  {
  eOptionNone = 0u , eOptionShowBytes = (1u << 0) , eOptionRawOuput = (1u << 1) , eOptionMarkPCSourceLine = (1u << 2) ,
  eOptionMarkPCAddress , eOptionShowControlFlowKind = (1u << 4)
}
 
enum  HexImmediateStyle { eHexStyleC , eHexStyleAsm }
 

Public Member Functions

 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 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)
 

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
 
std::string m_flavor
 

Private Member Functions

 Disassembler (const Disassembler &)=delete
 
const Disassembleroperator= (const Disassembler &)=delete
 

Detailed Description

Definition at line 388 of file Disassembler.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
eOptionNone 
eOptionShowBytes 
eOptionRawOuput 
eOptionMarkPCSourceLine 
eOptionMarkPCAddress 
eOptionShowControlFlowKind 

Definition at line 391 of file Disassembler.h.

◆ HexImmediateStyle

Enumerator
eHexStyleC 
eHexStyleAsm 

Definition at line 402 of file Disassembler.h.

Constructor & Destructor Documentation

◆ Disassembler() [1/2]

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

◆ ~Disassembler()

Disassembler::~Disassembler ( )
overridedefault

◆ Disassembler() [2/2]

lldb_private::Disassembler::Disassembler ( const Disassembler )
privatedelete

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/2]

bool Disassembler::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

◆ Disassemble() [2/2]

bool Disassembler::Disassemble ( Debugger debugger,
const ArchSpec arch,
StackFrame frame,
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,
Target target,
const AddressRange disasm_range,
bool  force_live_memory = false 
)
static

◆ ElideMixedSourceAndDisassemblyLine() [1/2]

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

◆ ElideMixedSourceAndDisassemblyLine() [2/2]

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

◆ FindPlugin()

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

◆ FindPluginForTarget()

DisassemblerSP Disassembler::FindPluginForTarget ( const Target target,
const ArchSpec arch,
const char *  flavor,
const char *  plugin_name 
)
static

◆ 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 473 of file Disassembler.h.

References m_arch.

◆ GetFlavor()

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

Definition at line 475 of file Disassembler.h.

References m_flavor.

◆ 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 1145 of file Disassembler.cpp.

References m_instruction_list.

◆ operator=()

const Disassembler & lldb_private::Disassembler::operator= ( const Disassembler )
privatedelete

◆ ParseInstructions()

size_t Disassembler::ParseInstructions ( Target target,
Address  address,
Limit  limit,
Stream error_strm_ptr,
bool  force_live_memory = false 
)

◆ PrintInstructions()

void Disassembler::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 
)

Definition at line 274 of file Disassembler.cpp.

References AddLineToSourceLineTables(), lldb_private::SymbolContext::Clear(), lldb_private::Disassembler::SourceLine::column, lldb_private::LineEntry::column, lldb_private::SymbolContext::comp_unit, lldb_private::AddressRange::ContainsFileAddress(), lldb_private::Disassembler::SourceLinesToDisplay::current_source_line, lldb_private::SourceManager::DisplaySourceLinesWithLineNumbers(), lldb_private::Instruction::Dump(), ElideMixedSourceAndDisassemblyLine(), lldb_private::Stream::EOL(), eOptionMarkPCSourceLine, eOptionShowBytes, eOptionShowControlFlowKind, lldb_private::Disassembler::SourceLine::file, lldb_private::Debugger::FormatDisassemblerAddress(), lldb_private::SymbolContext::function, lldb_private::Instruction::GetAddress(), lldb_private::SymbolContext::GetAddressRange(), lldb_private::Target::GetDebugger(), lldb_private::Debugger::GetDisassemblyFormat(), lldb_private::LineEntry::GetFile(), lldb_private::StackFrame::GetFrameCodeAddress(), lldb_private::ExecutionContext::GetFramePtr(), GetFunctionDeclLineEntry(), 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::Disassembler::SourceLine::line, lldb_private::LineEntry::line, lldb_private::SymbolContext::line_entry, lldb_private::Disassembler::SourceLinesToDisplay::lines, lldb_private::LineEntry::original_file_sp, lldb_private::FormatEntity::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 548 of file Disassembler.h.

Referenced by Disassembler(), GetArchitecture(), and ParseInstructions().

◆ m_flavor

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

Definition at line 550 of file Disassembler.h.

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

◆ m_instruction_list

InstructionList lldb_private::Disassembler::m_instruction_list
protected

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