LLVM API Documentation
Classes | |
class | X86GenericDisassembler |
struct | InstructionSpecifier |
struct | InternalInstruction |
The x86 internal instruction, which is produced by the decoder. More... | |
struct | OperandSpecifier |
The specification for how to extract and interpret one operand. More... | |
Typedefs | |
typedef int(* | byteReader_t )(const void *arg, uint8_t *byte, uint64_t address) |
Type for the byte reader that the consumer must provide to the decoder. Reads a single byte from the instruction's address space. | |
typedef void(* | dlog_t )(void *arg, const char *log) |
Type for the logging function that the consumer can provide to get debugging output from the decoder. | |
typedef uint16_t | InstrUID |
Enumerations | |
enum | EABase { EA_BASE_NONE } |
All possible values of the base field for effective-address computations, a.k.a. the Mod and R/M fields of the ModR/M byte. We distinguish between bases (EA_BASE_*) and registers that just happen to be referred to when Mod == 0b11 (EA_REG_*). More... | |
enum | SIBIndex { SIB_INDEX_NONE } |
All possible values of the SIB index field. borrows entries from ALL_EA_BASES with the special case that sib is synonymous with NONE. Vector SIB: index can be XMM or YMM. More... | |
enum | SIBBase { SIB_BASE_NONE } |
All possible values of the SIB base field. More... | |
enum | EADisplacement { EA_DISP_NONE, EA_DISP_8, EA_DISP_16, EA_DISP_32 } |
Possible displacement types for effective-address computations. More... | |
enum | Reg |
All possible values of the reg field in the ModR/M byte. More... | |
enum | SegmentOverride { SEG_OVERRIDE_NONE, SEG_OVERRIDE_CS, SEG_OVERRIDE_SS, SEG_OVERRIDE_DS, SEG_OVERRIDE_ES, SEG_OVERRIDE_FS, SEG_OVERRIDE_GS, SEG_OVERRIDE_max } |
All possible segment overrides. More... | |
enum | VEXLeadingOpcodeByte { VEX_LOB_0F = 0x1, VEX_LOB_0F38 = 0x2, VEX_LOB_0F3A = 0x3 } |
Possible values for the VEX.m-mmmm field. More... | |
enum | XOPMapSelect { XOP_MAP_SELECT_8 = 0x8, XOP_MAP_SELECT_9 = 0x9, XOP_MAP_SELECT_A = 0xA } |
enum | VEXPrefixCode { VEX_PREFIX_NONE = 0x0, VEX_PREFIX_66 = 0x1, VEX_PREFIX_F3 = 0x2, VEX_PREFIX_F2 = 0x3 } |
Possible values for the VEX.pp/EVEX.pp field. More... | |
enum | VectorExtensionType { TYPE_NO_VEX_XOP = 0x0, TYPE_VEX_2B = 0x1, TYPE_VEX_3B = 0x2, TYPE_EVEX = 0x3, TYPE_XOP = 0x4 } |
enum | attributeBits { ATTR_max } |
enum | InstructionContext { IC_max } |
enum | OpcodeType { ONEBYTE = 0, TWOBYTE = 1, THREEBYTE_38 = 2, THREEBYTE_3A = 3, XOP8_MAP = 4, XOP9_MAP = 5, XOPA_MAP = 6 } |
enum | ModRMDecisionType { MODRM_max } |
enum | OperandEncoding { ENCODING_max } |
enum | OperandType { TYPE_max } |
enum | ModifierType { MODIFIER_max } |
enum | DisassemblerMode { MODE_16BIT, MODE_32BIT, MODE_64BIT } |
Functions | |
int | decodeInstruction (InternalInstruction *insn, byteReader_t reader, const void *readerArg, dlog_t logger, void *loggerArg, const void *miiArg, uint64_t startLoc, DisassemblerMode mode) |
Decode one instruction and store the decoding results in a buffer provided by the consumer. | |
void | Debug (const char *file, unsigned line, const char *s) |
Print a message to debugs() | |
const char * | GetInstrName (unsigned Opcode, const void *mii) |
Variables | |
static const unsigned | X86_MAX_OPERANDS = 6 |
typedef int(* llvm::X86Disassembler::byteReader_t)(const void *arg, uint8_t *byte, uint64_t address) |
Type for the byte reader that the consumer must provide to the decoder. Reads a single byte from the instruction's address space.
arg | A baton that the consumer can associate with any internal state that it needs. |
byte | A pointer to a single byte in memory that should be set to contain the value at address. |
address | The address in the instruction's address space that should be read from. |
Definition at line 486 of file X86DisassemblerDecoder.h.
typedef void(* llvm::X86Disassembler::dlog_t)(void *arg, const char *log) |
Type for the logging function that the consumer can provide to get debugging output from the decoder.
arg | A baton that the consumer can associate with any internal state that it needs. |
log | A string that contains the message. Will be reused after the logger returns. |
Definition at line 494 of file X86DisassemblerDecoder.h.
typedef uint16_t llvm::X86Disassembler::InstrUID |
Definition at line 296 of file X86DisassemblerDecoderCommon.h.
Definition at line 66 of file X86DisassemblerDecoderCommon.h.
Decoding mode for the Intel disassembler. 16-bit, 32-bit, and 64-bit mode are supported, and represent real mode, IA-32e, and IA-32e in 64-bit mode, respectively.
Definition at line 508 of file X86DisassemblerDecoderCommon.h.
All possible values of the base field for effective-address computations, a.k.a. the Mod and R/M fields of the ModR/M byte. We distinguish between bases (EA_BASE_*) and registers that just happen to be referred to when Mod == 0b11 (EA_REG_*).
Definition at line 385 of file X86DisassemblerDecoder.h.
Possible displacement types for effective-address computations.
Definition at line 421 of file X86DisassemblerDecoder.h.
Definition at line 271 of file X86DisassemblerDecoderCommon.h.
Definition at line 497 of file X86DisassemblerDecoderCommon.h.
Definition at line 322 of file X86DisassemblerDecoderCommon.h.
Definition at line 279 of file X86DisassemblerDecoderCommon.h.
Definition at line 378 of file X86DisassemblerDecoderCommon.h.
Definition at line 479 of file X86DisassemblerDecoderCommon.h.
All possible values of the reg field in the ModR/M byte.
Definition at line 429 of file X86DisassemblerDecoder.h.
All possible segment overrides.
SEG_OVERRIDE_NONE | |
SEG_OVERRIDE_CS | |
SEG_OVERRIDE_SS | |
SEG_OVERRIDE_DS | |
SEG_OVERRIDE_ES | |
SEG_OVERRIDE_FS | |
SEG_OVERRIDE_GS | |
SEG_OVERRIDE_max |
Definition at line 437 of file X86DisassemblerDecoder.h.
All possible values of the SIB base field.
Definition at line 412 of file X86DisassemblerDecoder.h.
All possible values of the SIB index field. borrows entries from ALL_EA_BASES with the special case that sib is synonymous with NONE. Vector SIB: index can be XMM or YMM.
Definition at line 400 of file X86DisassemblerDecoder.h.
Definition at line 469 of file X86DisassemblerDecoder.h.
Possible values for the VEX.m-mmmm field.
Definition at line 449 of file X86DisassemblerDecoder.h.
Possible values for the VEX.pp/EVEX.pp field.
Definition at line 462 of file X86DisassemblerDecoder.h.
Definition at line 455 of file X86DisassemblerDecoder.h.
void llvm::X86Disassembler::Debug | ( | const char * | file, |
unsigned | line, | ||
const char * | s | ||
) |
Print a message to debugs()
file | The name of the file printing the debug message. |
line | The line number that printed the debug message. |
s | The message to print. |
Definition at line 42 of file X86Disassembler.cpp.
References llvm::dbgs().
int llvm::X86Disassembler::decodeInstruction | ( | InternalInstruction * | insn, |
byteReader_t | reader, | ||
const void * | readerArg, | ||
dlog_t | logger, | ||
void * | loggerArg, | ||
const void * | miiArg, | ||
uint64_t | startLoc, | ||
DisassemblerMode | mode | ||
) |
Decode one instruction and store the decoding results in a buffer provided by the consumer.
insn | The buffer to store the instruction in. Allocated by the consumer. |
reader | The byteReader_t for the bytes to be read. |
readerArg | An argument to pass to the reader for storing context specific to the consumer. May be NULL. |
logger | The dlog_t to be used in printing status messages from the disassembler. May be NULL. |
loggerArg | An argument to pass to the logger for storing context specific to the logger. May be NULL. |
startLoc | The address (in the reader's address space) of the first byte in the instruction. |
mode | The mode (16-bit, 32-bit, 64-bit) to decode in. |
Definition at line 1809 of file X86DisassemblerDecoder.cpp.
References dbgprintf(), llvm::X86Disassembler::InternalInstruction::dlog, llvm::X86Disassembler::InternalInstruction::dlogArg, getID(), llvm::X86Disassembler::InternalInstruction::instructionID, llvm::X86Disassembler::InternalInstruction::length, logger(), llvm::LibFunc::memset, llvm::X86Disassembler::InternalInstruction::mode, llvm::X86Disassembler::InternalInstruction::numImmediatesConsumed, llvm::X86Disassembler::InstructionSpecifier::operands, llvm::X86Disassembler::InternalInstruction::operands, llvm::X86Disassembler::InternalInstruction::reader, llvm::X86Disassembler::InternalInstruction::readerArg, llvm::X86Disassembler::InternalInstruction::readerCursor, readOpcode(), readOperands(), readPrefixes(), llvm::X86Disassembler::InternalInstruction::spec, and llvm::X86Disassembler::InternalInstruction::startLocation.
Referenced by llvm::AArch64Disassembler::getInstruction(), and llvm::X86Disassembler::X86GenericDisassembler::getInstruction().
const char * llvm::X86Disassembler::GetInstrName | ( | unsigned | Opcode, |
const void * | mii | ||
) |
Definition at line 47 of file X86Disassembler.cpp.
References llvm::MCInstrInfo::getName().
Referenced by getID().
const unsigned llvm::X86Disassembler::X86_MAX_OPERANDS = 6 [static] |
Definition at line 503 of file X86DisassemblerDecoderCommon.h.