LLDB mainline
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
InstructionLLVMC Class Reference
Inheritance diagram for InstructionLLVMC:
Inheritance graph
[legend]

Classes

class  DisassemblerScope
 Grants exclusive access to the disassembler and initializes it with the given InstructionLLVMC and an optional ExecutionContext. More...
 

Public Member Functions

 InstructionLLVMC (DisassemblerLLVMC &disasm, const lldb_private::Address &address, AddressClass addr_class)
 
 ~InstructionLLVMC () override=default
 
bool DoesBranch () override
 
bool HasDelaySlot () override
 
bool IsLoad () override
 
bool IsAuthenticated () override
 
DisassemblerLLVMC::MCDisasmInstanceGetDisasmToUse (bool &is_alternate_isa)
 
size_t Decode (const lldb_private::Disassembler &disassembler, const lldb_private::DataExtractor &data, lldb::offset_t data_offset) override
 
void AppendComment (std::string &description)
 
lldb::InstructionControlFlowKind GetControlFlowKind (const lldb_private::ExecutionContext *exe_ctx) override
 
void CalculateMnemonicOperandsAndComment (const lldb_private::ExecutionContext *exe_ctx) override
 
bool IsValid () const
 
bool UsingFileAddress () const
 
size_t GetByteSize () const
 
bool ParseOperands (llvm::SmallVectorImpl< Instruction::Operand > &operands) override
 
bool IsCall () override
 
- Public Member Functions inherited from lldb_private::Instruction
 Instruction (const Address &address, AddressClass addr_class=AddressClass::eInvalid)
 
virtual ~Instruction ()
 
const AddressGetAddress () const
 
const char * GetMnemonic (const ExecutionContext *exe_ctx, bool markup=false)
 
const char * GetOperands (const ExecutionContext *exe_ctx, bool markup=false)
 
const char * GetComment (const ExecutionContext *exe_ctx)
 
virtual lldb::InstructionControlFlowKind GetControlFlowKind (const ExecutionContext *exe_ctx)
 
virtual void CalculateMnemonicOperandsAndComment (const ExecutionContext *exe_ctx)=0
 
AddressClass GetAddressClass ()
 
void SetAddress (const Address &addr)
 
virtual void Dump (Stream *s, uint32_t max_opcode_byte_size, bool show_address, bool show_bytes, bool show_control_flow_kind, const ExecutionContext *exe_ctx, const SymbolContext *sym_ctx, const SymbolContext *prev_sym_ctx, const FormatEntity::Entry *disassembly_addr_format, size_t max_address_text_size)
 Dump the text representation of this Instruction to a Stream.
 
virtual bool DoesBranch ()=0
 
virtual bool HasDelaySlot ()
 
virtual bool IsLoad ()=0
 
virtual bool IsAuthenticated ()=0
 
bool CanSetBreakpoint ()
 
virtual size_t Decode (const Disassembler &disassembler, const DataExtractor &data, lldb::offset_t data_offset)=0
 
virtual void SetDescription (llvm::StringRef)
 
lldb::OptionValueSP ReadArray (FILE *in_file, Stream &out_stream, OptionValue::Type data_type)
 
lldb::OptionValueSP ReadDictionary (FILE *in_file, Stream &out_stream)
 
bool DumpEmulation (const ArchSpec &arch)
 
virtual bool TestEmulation (Stream &stream, const char *test_file_name)
 
bool Emulate (const ArchSpec &arch, uint32_t evaluate_options, void *baton, EmulateInstruction::ReadMemoryCallback read_mem_callback, EmulateInstruction::WriteMemoryCallback write_mem_calback, EmulateInstruction::ReadRegisterCallback read_reg_callback, EmulateInstruction::WriteRegisterCallback write_reg_callback)
 
const OpcodeGetOpcode () const
 
uint32_t GetData (DataExtractor &data)
 
virtual bool ParseOperands (llvm::SmallVectorImpl< Operand > &operands)
 
virtual bool IsCall ()
 

Static Public Member Functions

static llvm::StringRef::const_iterator ConsumeWhitespace (llvm::StringRef::const_iterator osi, llvm::StringRef::const_iterator ose)
 
static std::pair< bool, llvm::StringRef::const_iterator > ConsumeChar (llvm::StringRef::const_iterator osi, const char c, llvm::StringRef::const_iterator ose)
 
static std::pair< Operand, llvm::StringRef::const_iterator > ParseRegisterName (llvm::StringRef::const_iterator osi, llvm::StringRef::const_iterator ose)
 
static std::pair< Operand, llvm::StringRef::const_iterator > ParseImmediate (llvm::StringRef::const_iterator osi, llvm::StringRef::const_iterator ose)
 
static std::pair< Operand, llvm::StringRef::const_iterator > ParseIntelIndexedAccess (llvm::StringRef::const_iterator osi, llvm::StringRef::const_iterator ose)
 
static std::pair< Operand, llvm::StringRef::const_iterator > ParseIntelDerefAccess (llvm::StringRef::const_iterator osi, llvm::StringRef::const_iterator ose)
 
static std::pair< Operand, llvm::StringRef::const_iterator > ParseARMOffsetAccess (llvm::StringRef::const_iterator osi, llvm::StringRef::const_iterator ose)
 
static std::pair< Operand, llvm::StringRef::const_iterator > ParseARMDerefAccess (llvm::StringRef::const_iterator osi, llvm::StringRef::const_iterator ose)
 
static void DumpOperand (const Operand &op, Stream &s)
 
- Static Public Member Functions inherited from lldb_private::Instruction
static const char * GetNameForInstructionControlFlowKind (lldb::InstructionControlFlowKind instruction_control_flow_kind)
 

Protected Member Functions

void VisitInstruction ()
 
- Protected Member Functions inherited from lldb_private::Instruction
void CalculateMnemonicOperandsAndCommentIfNeeded (const ExecutionContext *exe_ctx)
 

Protected Attributes

std::weak_ptr< DisassemblerLLVMCm_disasm_wp
 
bool m_is_valid = false
 
bool m_using_file_addr = false
 
bool m_has_visited_instruction = false
 
bool m_does_branch = true
 
bool m_has_delay_slot = false
 
bool m_is_call = false
 
bool m_is_load = false
 
bool m_is_authenticated = false
 
- Protected Attributes inherited from lldb_private::Instruction
Address m_address
 
Opcode m_opcode
 
std::string m_opcode_name
 
std::string m_markup_opcode_name
 
std::string m_mnemonics
 
std::string m_markup_mnemonics
 
std::string m_comment
 
bool m_calculated_strings
 

Private Member Functions

DisassemblerLLVMC::MCDisasmInstanceGetDisasmToUse (bool &is_alternate_isa, DisassemblerScope &disasm)
 

Detailed Description

Definition at line 412 of file DisassemblerLLVMC.cpp.

Constructor & Destructor Documentation

◆ InstructionLLVMC()

InstructionLLVMC::InstructionLLVMC ( DisassemblerLLVMC disasm,
const lldb_private::Address address,
AddressClass  addr_class 
)
inline

Definition at line 414 of file DisassemblerLLVMC.cpp.

◆ ~InstructionLLVMC()

InstructionLLVMC::~InstructionLLVMC ( )
overridedefault

Member Function Documentation

◆ AppendComment()

void InstructionLLVMC::AppendComment ( std::string &  description)
inline

◆ CalculateMnemonicOperandsAndComment()

void InstructionLLVMC::CalculateMnemonicOperandsAndComment ( const lldb_private::ExecutionContext exe_ctx)
inlineoverridevirtual

Implements lldb_private::Instruction.

Definition at line 563 of file DisassemblerLLVMC.cpp.

References AppendComment(), lldb_private::Disassembler::eHexStyleC, lldb_private::RegularExpression::Execute(), lldb_private::Instruction::GetAddressClass(), lldb_private::DataExtractor::GetByteOrder(), lldb_private::Opcode::GetByteSize(), lldb_private::DataExtractor::GetByteSize(), lldb_private::Opcode::GetData(), lldb_private::DataExtractor::GetDataStart(), lldb_private::Address::GetFileAddress(), lldb_private::TargetProperties::GetHexImmediateStyle(), lldb_private::Address::GetLoadAddress(), DisassemblerLLVMC::MCDisasmInstance::GetMCInst(), lldb_private::StreamString::GetString(), lldb_private::ExecutionContext::GetTargetPtr(), lldb_private::DataExtractor::GetU16(), lldb_private::DataExtractor::GetU32(), lldb_private::DataExtractor::GetU64(), lldb_private::DataExtractor::GetU8(), DisassemblerLLVMC::MCDisasmInstance::GetUseColor(), lldb_private::TargetProperties::GetUseHexImmediates(), LLDB_INVALID_ADDRESS, lldb_private::Instruction::m_address, lldb_private::Instruction::m_comment, lldb_private::Instruction::m_markup_mnemonics, lldb_private::Instruction::m_markup_opcode_name, lldb_private::Instruction::m_mnemonics, lldb_private::Instruction::m_opcode, lldb_private::Instruction::m_opcode_name, m_using_file_addr, pc, lldb_private::DataExtractor::PeekData(), lldb_private::Stream::Printf(), DisassemblerLLVMC::MCDisasmInstance::PrintMCInst(), lldb_private::Opcode::SetOpcode16(), lldb_private::Opcode::SetOpcode32(), lldb_private::Opcode::SetOpcode64(), lldb_private::Opcode::SetOpcode8(), lldb_private::Opcode::SetOpcodeBytes(), DisassemblerLLVMC::MCDisasmInstance::SetStyle(), and DisassemblerLLVMC::MCDisasmInstance::SetUseColor().

◆ ConsumeChar()

static std::pair< bool, llvm::StringRef::const_iterator > InstructionLLVMC::ConsumeChar ( llvm::StringRef::const_iterator  osi,
const char  c,
llvm::StringRef::const_iterator  ose 
)
inlinestatic

◆ ConsumeWhitespace()

static llvm::StringRef::const_iterator InstructionLLVMC::ConsumeWhitespace ( llvm::StringRef::const_iterator  osi,
llvm::StringRef::const_iterator  ose 
)
inlinestatic

◆ Decode()

size_t InstructionLLVMC::Decode ( const lldb_private::Disassembler disassembler,
const lldb_private::DataExtractor data,
lldb::offset_t  data_offset 
)
inlineoverridevirtual

◆ DoesBranch()

bool InstructionLLVMC::DoesBranch ( )
inlineoverridevirtual

Implements lldb_private::Instruction.

Definition at line 423 of file DisassemblerLLVMC.cpp.

References m_does_branch, and VisitInstruction().

◆ DumpOperand()

static void InstructionLLVMC::DumpOperand ( const Operand op,
Stream s 
)
inlinestatic

◆ GetByteSize()

size_t InstructionLLVMC::GetByteSize ( ) const
inline

◆ GetControlFlowKind()

lldb::InstructionControlFlowKind InstructionLLVMC::GetControlFlowKind ( const lldb_private::ExecutionContext exe_ctx)
inlineoverridevirtual
Returns
The control flow kind of this instruction, or eInstructionControlFlowKindUnknown if the instruction can't be classified.

Reimplemented from lldb_private::Instruction.

Definition at line 551 of file DisassemblerLLVMC.cpp.

References lldb::eInstructionControlFlowKindUnknown, x86::GetControlFlowKind(), and lldb_private::Instruction::m_opcode.

◆ GetDisasmToUse() [1/2]

DisassemblerLLVMC::MCDisasmInstance * InstructionLLVMC::GetDisasmToUse ( bool &  is_alternate_isa)
inline

Definition at line 443 of file DisassemblerLLVMC.cpp.

References GetDisasmToUse().

Referenced by Decode(), GetDisasmToUse(), and VisitInstruction().

◆ GetDisasmToUse() [2/2]

DisassemblerLLVMC::MCDisasmInstance * InstructionLLVMC::GetDisasmToUse ( bool &  is_alternate_isa,
DisassemblerScope disasm 
)
inlineprivate

◆ HasDelaySlot()

bool InstructionLLVMC::HasDelaySlot ( )
inlineoverridevirtual

Reimplemented from lldb_private::Instruction.

Definition at line 428 of file DisassemblerLLVMC.cpp.

References m_has_delay_slot, and VisitInstruction().

◆ IsAuthenticated()

bool InstructionLLVMC::IsAuthenticated ( )
inlineoverridevirtual

Implements lldb_private::Instruction.

Definition at line 438 of file DisassemblerLLVMC.cpp.

References m_is_authenticated, and VisitInstruction().

◆ IsCall()

bool InstructionLLVMC::IsCall ( )
inlineoverridevirtual

Reimplemented from lldb_private::Instruction.

Definition at line 1165 of file DisassemblerLLVMC.cpp.

References m_is_call, and VisitInstruction().

◆ IsLoad()

bool InstructionLLVMC::IsLoad ( )
inlineoverridevirtual

Implements lldb_private::Instruction.

Definition at line 433 of file DisassemblerLLVMC.cpp.

References m_is_load, and VisitInstruction().

◆ IsValid()

bool InstructionLLVMC::IsValid ( ) const
inline

Definition at line 692 of file DisassemblerLLVMC.cpp.

References m_is_valid.

◆ ParseARMDerefAccess()

static std::pair< Operand, llvm::StringRef::const_iterator > InstructionLLVMC::ParseARMDerefAccess ( llvm::StringRef::const_iterator  osi,
llvm::StringRef::const_iterator  ose 
)
inlinestatic

◆ ParseARMOffsetAccess()

static std::pair< Operand, llvm::StringRef::const_iterator > InstructionLLVMC::ParseARMOffsetAccess ( llvm::StringRef::const_iterator  osi,
llvm::StringRef::const_iterator  ose 
)
inlinestatic

◆ ParseImmediate()

static std::pair< Operand, llvm::StringRef::const_iterator > InstructionLLVMC::ParseImmediate ( llvm::StringRef::const_iterator  osi,
llvm::StringRef::const_iterator  ose 
)
inlinestatic

◆ ParseIntelDerefAccess()

static std::pair< Operand, llvm::StringRef::const_iterator > InstructionLLVMC::ParseIntelDerefAccess ( llvm::StringRef::const_iterator  osi,
llvm::StringRef::const_iterator  ose 
)
inlinestatic

◆ ParseIntelIndexedAccess()

static std::pair< Operand, llvm::StringRef::const_iterator > InstructionLLVMC::ParseIntelIndexedAccess ( llvm::StringRef::const_iterator  osi,
llvm::StringRef::const_iterator  ose 
)
inlinestatic

◆ ParseOperands()

bool InstructionLLVMC::ParseOperands ( llvm::SmallVectorImpl< Instruction::Operand > &  operands)
inlineoverridevirtual

◆ ParseRegisterName()

static std::pair< Operand, llvm::StringRef::const_iterator > InstructionLLVMC::ParseRegisterName ( llvm::StringRef::const_iterator  osi,
llvm::StringRef::const_iterator  ose 
)
inlinestatic

◆ UsingFileAddress()

bool InstructionLLVMC::UsingFileAddress ( ) const
inline

Definition at line 694 of file DisassemblerLLVMC.cpp.

References m_using_file_addr.

Referenced by DisassemblerLLVMC::SymbolLookup().

◆ VisitInstruction()

void InstructionLLVMC::VisitInstruction ( )
inlineprotected

Member Data Documentation

◆ m_disasm_wp

std::weak_ptr<DisassemblerLLVMC> InstructionLLVMC::m_disasm_wp
protected

Definition at line 1171 of file DisassemblerLLVMC.cpp.

Referenced by ParseOperands().

◆ m_does_branch

bool InstructionLLVMC::m_does_branch = true
protected

Definition at line 1183 of file DisassemblerLLVMC.cpp.

Referenced by DoesBranch(), and VisitInstruction().

◆ m_has_delay_slot

bool InstructionLLVMC::m_has_delay_slot = false
protected

Definition at line 1184 of file DisassemblerLLVMC.cpp.

Referenced by HasDelaySlot(), and VisitInstruction().

◆ m_has_visited_instruction

bool InstructionLLVMC::m_has_visited_instruction = false
protected

Definition at line 1175 of file DisassemblerLLVMC.cpp.

Referenced by VisitInstruction().

◆ m_is_authenticated

bool InstructionLLVMC::m_is_authenticated = false
protected

Definition at line 1187 of file DisassemblerLLVMC.cpp.

Referenced by IsAuthenticated(), and VisitInstruction().

◆ m_is_call

bool InstructionLLVMC::m_is_call = false
protected

Definition at line 1185 of file DisassemblerLLVMC.cpp.

Referenced by IsCall(), and VisitInstruction().

◆ m_is_load

bool InstructionLLVMC::m_is_load = false
protected

Definition at line 1186 of file DisassemblerLLVMC.cpp.

Referenced by IsLoad(), and VisitInstruction().

◆ m_is_valid

bool InstructionLLVMC::m_is_valid = false
protected

Definition at line 1173 of file DisassemblerLLVMC.cpp.

Referenced by Decode(), and IsValid().

◆ m_using_file_addr

bool InstructionLLVMC::m_using_file_addr = false
protected

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