LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
llvm::MCExternalSymbolizer Class Reference

Symbolize using user-provided, C API, callbacks. More...

#include <MCExternalSymbolizer.h>

Inheritance diagram for llvm::MCExternalSymbolizer:
Inheritance graph
[legend]
Collaboration diagram for llvm::MCExternalSymbolizer:
Collaboration graph
[legend]

Public Member Functions

 MCExternalSymbolizer (MCContext &Ctx, OwningPtr< MCRelocationInfo > &RelInfo, LLVMOpInfoCallback getOpInfo, LLVMSymbolLookupCallback symbolLookUp, void *disInfo)
 
bool tryAddingSymbolicOperand (MCInst &MI, raw_ostream &CommentStream, int64_t Value, uint64_t Address, bool IsBranch, uint64_t Offset, uint64_t InstSize)
 Try to add a symbolic operand instead of Value to the MCInst. More...
 
void tryAddingPcLoadReferenceComment (raw_ostream &CommentStream, int64_t Value, uint64_t Address)
 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. More...
 
- Public Member Functions inherited from llvm::MCSymbolizer
 MCSymbolizer (MCContext &Ctx, OwningPtr< MCRelocationInfo > &RelInfo)
 Construct an MCSymbolizer, taking ownership of RelInfo. More...
 
virtual ~MCSymbolizer ()
 

Additional Inherited Members

- Protected Attributes inherited from llvm::MCSymbolizer
MCContextCtx
 
OwningPtr< MCRelocationInfoRelInfo
 

Detailed Description

Symbolize using user-provided, C API, callbacks.

See llvm-c/Disassembler.h.

Definition at line 27 of file MCExternalSymbolizer.h.

Constructor & Destructor Documentation

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

Definition at line 40 of file MCExternalSymbolizer.h.

Member Function Documentation

void MCExternalSymbolizer::tryAddingPcLoadReferenceComment ( raw_ostream cStream,
int64_t  Value,
uint64_t  Address 
)
virtual
bool MCExternalSymbolizer::tryAddingSymbolicOperand ( MCInst Inst,
raw_ostream cStream,
int64_t  Value,
uint64_t  Address,
bool  IsBranch,
uint64_t  Offset,
uint64_t  InstSize 
)
virtual

Try to add a symbolic operand instead of 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.

Parameters
Inst- The MCInst where to insert the symbolic operand.
cStream- Stream to print comments and annotations on.
Value- Operand value, pc-adjusted by the caller if necessary.
Address- Load address of the instruction.
IsBranch- Is the instruction a branch?
Offset- Byte offset of the operand inside the inst.
InstSize- Size of the instruction in bytes.
Returns
Whether a symbolic operand was added.

Implements llvm::MCSymbolizer.

Definition at line 31 of file MCExternalSymbolizer.cpp.

References llvm::MCInst::addOperand(), LLVMOpInfo1::AddSymbol, llvm::MCConstantExpr::Create(), llvm::MCSymbolRefExpr::Create(), llvm::MCBinaryExpr::CreateAdd(), llvm::MCOperand::CreateExpr(), llvm::MCUnaryExpr::CreateMinus(), llvm::MCBinaryExpr::CreateSub(), llvm::MCSymbolizer::Ctx, llvm::MCContext::GetOrCreateSymbol(), LLVMDisassembler_ReferenceType_In_Branch, LLVMDisassembler_ReferenceType_InOut_None, LLVMDisassembler_ReferenceType_Out_Objc_Message, LLVMDisassembler_ReferenceType_Out_SymbolStub, llvm::Intrinsic::memset, LLVMOpInfoSymbol1::Name, LLVMOpInfoSymbol1::Present, llvm::MCSymbolizer::RelInfo, LLVMOpInfo1::SubtractSymbol, LLVMOpInfoSymbol1::Value, LLVMOpInfo1::Value, and LLVMOpInfo1::VariantKind.


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