class MCExternalSymbolizer

Declaration

class MCExternalSymbolizer : public MCSymbolizer { /* full declaration omitted */ };

Description

Symbolize using user-provided, C API, callbacks. See llvm-c/Disassembler.h.

Declared at: llvm/include/llvm/MC/MCDisassembler/MCExternalSymbolizer.h:27

Inherits from: MCSymbolizer

Member Variables

protected LLVMOpInfoCallback GetOpInfo
@ { The function to get the symbolic information for operands.
protected LLVMSymbolLookupCallback SymbolLookUp
The function to lookup a symbol name.
protected void* DisInfo
The pointer to the block of symbolic information for above call back.

Inherited from MCSymbolizer:

protected Ctx
protected RelInfo

Method Overview

  • public MCExternalSymbolizer(llvm::MCContext & Ctx, std::unique_ptr<MCRelocationInfo> RelInfo, LLVMOpInfoCallback getOpInfo, LLVMSymbolLookupCallback symbolLookUp, void * disInfo)
  • public void tryAddingPcLoadReferenceComment(llvm::raw_ostream & CommentStream, int64_t Value, uint64_t Address)
  • public bool tryAddingSymbolicOperand(llvm::MCInst & MI, llvm::raw_ostream & CommentStream, int64_t Value, uint64_t Address, bool IsBranch, uint64_t Offset, uint64_t InstSize)

Inherited from MCSymbolizer:

Methods

MCExternalSymbolizer(
    llvm::MCContext& Ctx,
    std::unique_ptr<MCRelocationInfo> RelInfo,
    LLVMOpInfoCallback getOpInfo,
    LLVMSymbolLookupCallback symbolLookUp,
    void* disInfo)

Description

@ }

Declared at: llvm/include/llvm/MC/MCDisassembler/MCExternalSymbolizer.h:40

Parameters

llvm::MCContext& Ctx
std::unique_ptr<MCRelocationInfo> RelInfo
LLVMOpInfoCallback getOpInfo
LLVMSymbolLookupCallback symbolLookUp
void* disInfo

void tryAddingPcLoadReferenceComment(
    llvm::raw_ostream& CommentStream,
    int64_t Value,
    uint64_t Address)

Description

Try to add a comment on the PC-relative load. For instance, in Mach-O, this is used to add annotations to instructions that use C string literals, as found in __cstring.

Declared at: llvm/include/llvm/MC/MCDisassembler/MCExternalSymbolizer.h:50

Parameters

llvm::raw_ostream& CommentStream
int64_t Value
uint64_t Address

bool tryAddingSymbolicOperand(
    llvm::MCInst& MI,
    llvm::raw_ostream& CommentStream,
    int64_t Value,
    uint64_t Address,
    bool IsBranch,
    uint64_t Offset,
    uint64_t InstSize)

Description

Try to add a symbolic operand instead of \p Value to the MCInst. Instead of having a difficult to read immediate, a symbolic operand would represent this immediate in a more understandable way, for instance as a symbol or an offset from a symbol. Relocations can also be used to enrich the symbolic expression.

Declared at: llvm/include/llvm/MC/MCDisassembler/MCExternalSymbolizer.h:47

Parameters

llvm::MCInst& MI
llvm::raw_ostream& CommentStream
int64_t Value
- Operand value, pc-adjusted by the caller if necessary.
uint64_t Address
- Load address of the instruction.
bool IsBranch
- Is the instruction a branch?
uint64_t Offset
- Byte offset of the operand inside the inst.
uint64_t InstSize
- Size of the instruction in bytes.

Returns

Whether a symbolic operand was added.