decompiler  1.0.0
Public Member Functions | List of all members
ghidra::PcodeEmit Class Referenceabstract

Abstract class for emitting pcode to an application. More...

#include <translate.hh>

Inheritance diagram for ghidra::PcodeEmit:
ghidra::PcodeEmitCache ghidra::PcodeEmitFd

Public Member Functions

virtual ~PcodeEmit (void)
 Virtual destructor.
 
virtual void dump (const Address &addr, OpCode opc, VarnodeData *outvar, VarnodeData *vars, int4 isize)=0
 The main pcode emit method. More...
 
void decodeOp (const Address &addr, Decoder &decoder)
 Emit pcode directly from an <op> element. More...
 

Detailed Description

Abstract class for emitting pcode to an application.

Translation engines pass back the generated pcode for an instruction to the application using this class.

Member Function Documentation

◆ decodeOp()

void ghidra::PcodeEmit::decodeOp ( const Address addr,
Decoder decoder 
)

Emit pcode directly from an <op> element.

A convenience method for passing around p-code operations via stream. A single p-code operation is parsed from an <op> element and returned to the application via the PcodeEmit::dump method.

Parameters
addris the address (of the instruction) to associate with the p-code op
decoderis the stream decoder

References ghidra::Decoder::closeElement(), ghidra::PcodeOpRaw::decode(), ghidra::Decoder::openElement(), and ghidra::Decoder::readSignedInteger().

Referenced by ghidra::InjectPayloadGhidra::inject(), ghidra::ExecutablePcodeGhidra::inject(), and ghidra::GhidraTranslate::oneInstruction().

◆ dump()

virtual void ghidra::PcodeEmit::dump ( const Address addr,
OpCode  opc,
VarnodeData outvar,
VarnodeData vars,
int4  isize 
)
pure virtual

The main pcode emit method.

A single pcode instruction is returned to the application via this method. Particular applications override it to tailor how the operations are used.

Parameters
addris the Address of the machine instruction
opcis the opcode of the particular pcode instruction
outvarif not null is a pointer to data about the output varnode
varsis a pointer to an array of VarnodeData for each input varnode
isizeis the number of input varnodes

Implemented in ghidra::PcodeEmitFd, and ghidra::PcodeEmitCache.

Referenced by ghidra::PcodeCacher::emit().


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