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

Classes

struct  Limit
 
struct  SourceLine
 
struct  SourceLinesToDisplay
 

Public Types

enum  {
  eOptionNone = 0u, eOptionShowBytes = (1u << 0), eOptionRawOuput = (1u << 1), eOptionMarkPCSourceLine = (1u << 2),
  eOptionMarkPCAddress
}
 
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
 
lldb::addr_t m_base_addr
 
std::string m_flavor
 

Private Member Functions

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

Detailed Description

Definition at line 368 of file Disassembler.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
eOptionNone 
eOptionShowBytes 
eOptionRawOuput 
eOptionMarkPCSourceLine 
eOptionMarkPCAddress 

Definition at line 371 of file Disassembler.h.

◆ HexImmediateStyle

Enumerator
eHexStyleC 
eHexStyleAsm 

Definition at line 381 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 452 of file Disassembler.h.

References m_arch.

◆ GetFlavor()

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

Definition at line 454 of file Disassembler.h.

References m_flavor.

◆ GetFunctionDeclLineEntry()

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

◆ GetInstructionList() [1/2]

const InstructionList & Disassembler::GetInstructionList ( )

Definition at line 1100 of file Disassembler.cpp.

References m_instruction_list.

Referenced by lldb_private::ThreadPlanAssemblyTracer::Log().

◆ GetInstructionList() [2/2]

const InstructionList& lldb_private::Disassembler::GetInstructionList ( ) const

◆ 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 278 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::SourceManager::DisplaySourceLinesWithLineNumbers(), 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::Address::GetModule(), 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::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 524 of file Disassembler.h.

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

◆ m_base_addr

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

Definition at line 529 of file Disassembler.h.

◆ m_flavor

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

Definition at line 530 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: