LLDB mainline
|
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::MCDisasmInstance * | GetDisasmToUse (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 Address & | GetAddress () 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 Opcode & | GetOpcode () 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< DisassemblerLLVMC > | m_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::MCDisasmInstance * | GetDisasmToUse (bool &is_alternate_isa, DisassemblerScope &disasm) |
Definition at line 412 of file DisassemblerLLVMC.cpp.
|
inline |
Definition at line 414 of file DisassemblerLLVMC.cpp.
|
overridedefault |
|
inline |
Definition at line 541 of file DisassemblerLLVMC.cpp.
References lldb_private::Instruction::m_comment.
Referenced by CalculateMnemonicOperandsAndComment(), and DisassemblerLLVMC::SymbolLookup().
|
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().
|
inlinestatic |
Definition at line 740 of file DisassemblerLLVMC.cpp.
References ConsumeWhitespace().
Referenced by ParseARMDerefAccess(), ParseARMOffsetAccess(), ParseIntelDerefAccess(), ParseIntelIndexedAccess(), and ParseOperands().
|
inlinestatic |
Definition at line 723 of file DisassemblerLLVMC.cpp.
Referenced by ConsumeChar(), ParseImmediate(), ParseOperands(), and ParseRegisterName().
|
inlineoverridevirtual |
Implements lldb_private::Instruction.
Definition at line 448 of file DisassemblerLLVMC.cpp.
References lldb_private::DataExtractor::BytesLeft(), lldb_private::Opcode::Clear(), lldb_private::DataExtractor::GetByteOrder(), lldb_private::Opcode::GetByteSize(), GetDisasmToUse(), lldb_private::Address::GetFileAddress(), lldb_private::ArchSpec::GetMachine(), lldb_private::ArchSpec::GetMaximumOpcodeByteSize(), DisassemblerLLVMC::MCDisasmInstance::GetMCInst(), lldb_private::ArchSpec::GetMinimumOpcodeByteSize(), lldb_private::DataExtractor::GetU16(), lldb_private::DataExtractor::GetU32(), lldb_private::DataExtractor::GetU64(), lldb_private::DataExtractor::GetU8(), lldb_private::Instruction::m_address, m_is_valid, lldb_private::Instruction::m_opcode, pc, lldb_private::DataExtractor::PeekData(), lldb_private::Opcode::SetOpcode16(), lldb_private::Opcode::SetOpcode16_2(), lldb_private::Opcode::SetOpcode32(), lldb_private::Opcode::SetOpcode64(), lldb_private::Opcode::SetOpcode8(), lldb_private::Opcode::SetOpcodeBytes(), and lldb_private::DataExtractor::ValidOffsetForDataOfSize().
|
inlineoverridevirtual |
Implements lldb_private::Instruction.
Definition at line 423 of file DisassemblerLLVMC.cpp.
References m_does_branch, and VisitInstruction().
Definition at line 1055 of file DisassemblerLLVMC.cpp.
References DumpOperand(), lldb_private::ConstString::GetStringRef(), lldb_private::Instruction::Operand::m_children, lldb_private::Instruction::Operand::m_immediate, lldb_private::Instruction::Operand::m_negative, lldb_private::Instruction::Operand::m_register, lldb_private::Instruction::Operand::m_type, and lldb_private::Stream::PutCString().
Referenced by DumpOperand(), and ParseOperands().
|
inline |
Definition at line 698 of file DisassemblerLLVMC.cpp.
References lldb_private::Opcode::GetByteSize(), and lldb_private::Instruction::m_opcode.
|
inlineoverridevirtual |
Reimplemented from lldb_private::Instruction.
Definition at line 551 of file DisassemblerLLVMC.cpp.
References lldb::eInstructionControlFlowKindUnknown, x86::GetControlFlowKind(), and lldb_private::Instruction::m_opcode.
|
inline |
Definition at line 443 of file DisassemblerLLVMC.cpp.
References GetDisasmToUse().
Referenced by Decode(), GetDisasmToUse(), and VisitInstruction().
|
inlineprivate |
Definition at line 1226 of file DisassemblerLLVMC.cpp.
References lldb_private::Instruction::GetAddressClass().
|
inlineoverridevirtual |
Reimplemented from lldb_private::Instruction.
Definition at line 428 of file DisassemblerLLVMC.cpp.
References m_has_delay_slot, and VisitInstruction().
|
inlineoverridevirtual |
Implements lldb_private::Instruction.
Definition at line 438 of file DisassemblerLLVMC.cpp.
References m_is_authenticated, and VisitInstruction().
|
inlineoverridevirtual |
Reimplemented from lldb_private::Instruction.
Definition at line 1168 of file DisassemblerLLVMC.cpp.
References m_is_call, and VisitInstruction().
|
inlineoverridevirtual |
Implements lldb_private::Instruction.
Definition at line 433 of file DisassemblerLLVMC.cpp.
References m_is_load, and VisitInstruction().
|
inline |
Definition at line 695 of file DisassemblerLLVMC.cpp.
References m_is_valid.
|
inlinestatic |
Definition at line 1028 of file DisassemblerLLVMC.cpp.
References ConsumeChar(), lldb_private::Instruction::Operand::m_children, lldb_private::Instruction::Operand::m_type, and ParseRegisterName().
Referenced by ParseOperands().
|
inlinestatic |
Definition at line 983 of file DisassemblerLLVMC.cpp.
References ConsumeChar(), lldb_private::Instruction::Operand::m_children, lldb_private::Instruction::Operand::m_type, ParseImmediate(), and ParseRegisterName().
Referenced by ParseOperands().
|
inlinestatic |
Definition at line 795 of file DisassemblerLLVMC.cpp.
References ConsumeWhitespace(), lldb_private::Instruction::Operand::m_immediate, lldb_private::Instruction::Operand::m_negative, and lldb_private::Instruction::Operand::m_type.
Referenced by ParseARMOffsetAccess(), ParseIntelDerefAccess(), ParseIntelIndexedAccess(), and ParseOperands().
|
inlinestatic |
Definition at line 936 of file DisassemblerLLVMC.cpp.
References ConsumeChar(), lldb_private::Instruction::Operand::m_children, lldb_private::Instruction::Operand::m_type, ParseImmediate(), and ParseRegisterName().
Referenced by ParseOperands().
|
inlinestatic |
Definition at line 853 of file DisassemblerLLVMC.cpp.
References ConsumeChar(), lldb_private::Instruction::Operand::m_children, lldb_private::Instruction::Operand::m_type, ParseImmediate(), and ParseRegisterName().
Referenced by ParseOperands().
|
inlineoverridevirtual |
Reimplemented from lldb_private::Instruction.
Definition at line 1090 of file DisassemblerLLVMC.cpp.
References ConsumeChar(), ConsumeWhitespace(), DumpOperand(), lldb_private::GetLog(), lldb_private::Instruction::GetOperands(), lldb_private::StreamString::GetString(), lldb_private::Instruction::Operand::IsValid(), m_disasm_wp, ParseARMDerefAccess(), ParseARMOffsetAccess(), ParseImmediate(), ParseIntelDerefAccess(), ParseIntelIndexedAccess(), ParseRegisterName(), lldb_private::Stream::Printf(), and lldb_private::Stream::PutCString().
|
inlinestatic |
Definition at line 754 of file DisassemblerLLVMC.cpp.
References ConsumeWhitespace(), lldb_private::Instruction::Operand::m_register, and lldb_private::Instruction::Operand::m_type.
Referenced by ParseARMDerefAccess(), ParseARMOffsetAccess(), ParseIntelDerefAccess(), ParseIntelIndexedAccess(), and ParseOperands().
|
inline |
Definition at line 697 of file DisassemblerLLVMC.cpp.
References m_using_file_addr.
Referenced by DisassemblerLLVMC::SymbolLookup().
|
inlineprotected |
Definition at line 1192 of file DisassemblerLLVMC.cpp.
References DisassemblerLLVMC::MCDisasmInstance::CanBranch(), lldb_private::DataExtractor::GetByteSize(), lldb_private::Opcode::GetData(), lldb_private::DataExtractor::GetDataStart(), GetDisasmToUse(), lldb_private::Address::GetFileAddress(), DisassemblerLLVMC::MCDisasmInstance::GetMCInst(), DisassemblerLLVMC::MCDisasmInstance::HasDelaySlot(), DisassemblerLLVMC::MCDisasmInstance::IsAuthenticated(), DisassemblerLLVMC::MCDisasmInstance::IsCall(), DisassemblerLLVMC::MCDisasmInstance::IsLoad(), lldb_private::Instruction::m_address, m_does_branch, m_has_delay_slot, m_has_visited_instruction, m_is_authenticated, m_is_call, m_is_load, lldb_private::Instruction::m_opcode, and pc.
Referenced by DoesBranch(), HasDelaySlot(), IsAuthenticated(), IsCall(), and IsLoad().
|
protected |
Definition at line 1174 of file DisassemblerLLVMC.cpp.
Referenced by ParseOperands().
|
protected |
Definition at line 1186 of file DisassemblerLLVMC.cpp.
Referenced by DoesBranch(), and VisitInstruction().
|
protected |
Definition at line 1187 of file DisassemblerLLVMC.cpp.
Referenced by HasDelaySlot(), and VisitInstruction().
|
protected |
Definition at line 1178 of file DisassemblerLLVMC.cpp.
Referenced by VisitInstruction().
|
protected |
Definition at line 1190 of file DisassemblerLLVMC.cpp.
Referenced by IsAuthenticated(), and VisitInstruction().
|
protected |
Definition at line 1188 of file DisassemblerLLVMC.cpp.
Referenced by IsCall(), and VisitInstruction().
|
protected |
Definition at line 1189 of file DisassemblerLLVMC.cpp.
Referenced by IsLoad(), and VisitInstruction().
|
protected |
Definition at line 1176 of file DisassemblerLLVMC.cpp.
|
protected |
Definition at line 1177 of file DisassemblerLLVMC.cpp.
Referenced by CalculateMnemonicOperandsAndComment(), and UsingFileAddress().