Package ghidra.program.model.pcode
Class PcodeBlock
java.lang.Object
ghidra.program.model.pcode.PcodeBlock
- Direct Known Subclasses:
- BlockCopy,- BlockGraph,- PcodeBlockBasic
Blocks of PcodeOps
- 
Nested Class SummaryNested Classes
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final int
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidaddInEdge(PcodeBlock b, int lab) intcalcDepth(PcodeBlock leaf) voidDecode this block from a streamprotected voiddecodeBody(Decoder decoder, BlockMap resolver) Restore the any additional information beyond header and edges from streamprotected voiddecodeEdges(Decoder decoder, BlockMap resolver) protected voiddecodeHeader(Decoder decoder) protected voiddecodeNextInEdge(Decoder decoder, BlockMap resolver) Decode the next input edge from the streamprotected voiddecodeNextInEdge(Decoder decoder, ArrayList<? extends PcodeBlock> blockList) Decode the next input edge from the stream.voidEncode this block to a streamprotected voidencodeBody(Encoder encoder) Encode information about the block to stream, other than header and edge infoprotected voidencodeEdges(Encoder encoder) Encode information about this blocks edges to streamprotected voidencodeHeader(Encoder encoder) Encode basic attributes to stream.Assuming paths out of this block depend on a boolean conditiongetIn(int i) intgetIndex()intgetInRevIndex(int i) Get reverse index of the i-th incoming block.intgetOut(int i) intgetOutRevIndex(int i) Get reverse index of the i-th outgoing block.intgetStart()getStop()Assuming paths out of this block depend on a boolean conditionintgetType()static intnameToType(String name) voidsetIndex(int i) toString()static StringtypeToName(int type) 
- 
Field Details- 
PLAINpublic static final int PLAIN- See Also:
 
- 
BASICpublic static final int BASIC- See Also:
 
- 
GRAPHpublic static final int GRAPH- See Also:
 
- 
COPYpublic static final int COPY- See Also:
 
- 
GOTOpublic static final int GOTO- See Also:
 
- 
MULTIGOTOpublic static final int MULTIGOTO- See Also:
 
- 
LISTpublic static final int LIST- See Also:
 
- 
CONDITIONpublic static final int CONDITION- See Also:
 
- 
PROPERIFpublic static final int PROPERIF- See Also:
 
- 
IFELSEpublic static final int IFELSE- See Also:
 
- 
IFGOTOpublic static final int IFGOTO- See Also:
 
- 
WHILEDOpublic static final int WHILEDO- See Also:
 
- 
DOWHILEpublic static final int DOWHILE- See Also:
 
- 
SWITCHpublic static final int SWITCH- See Also:
 
- 
INFLOOPpublic static final int INFLOOP- See Also:
 
 
- 
- 
Constructor Details- 
PcodeBlockpublic PcodeBlock()
 
- 
- 
Method Details- 
typeToName
- 
nameToType
- 
toString
- 
getTypepublic int getType()
- 
getStart- Returns:
- the first Address covered by this block
 
- 
getStop- Returns:
- the last Address covered by this block
 
- 
setIndexpublic void setIndex(int i) 
- 
getIndexpublic int getIndex()
- 
getParent
- 
addInEdge
- 
decodeNextInEdgeDecode the next input edge from the stream- Parameters:
- decoder- is the stream decoder
- resolver- is used to find PcodeBlocks
- Throws:
- DecoderException- for any invalid encoding
 
- 
decodeNextInEdgeprotected void decodeNextInEdge(Decoder decoder, ArrayList<? extends PcodeBlock> blockList) throws DecoderException Decode the next input edge from the stream. Resolve block indices via a blockList- Parameters:
- decoder- is the stream decoder
- blockList- allows lookup of PcodeBlock via index
- Throws:
- DecoderException- for any invalid encoding
 
- 
getIn
- 
getOut
- 
getOutRevIndexpublic int getOutRevIndex(int i) Get reverse index of the i-th outgoing block. I.e this.getOut(i).getIn(reverse_index) == this- Parameters:
- i- is the outgoing block to request reverse index from
- Returns:
- the reverse index
 
- 
getInRevIndexpublic int getInRevIndex(int i) Get reverse index of the i-th incoming block. I.e. this.getIn(i).getOut(reverse_index) == this- Parameters:
- i- is the incoming block to request reverse index from
- Returns:
- the reverse index
 
- 
getFalseOutAssuming paths out of this block depend on a boolean condition- Returns:
- the PcodeBlock coming out of this if the condition is false
 
- 
getTrueOutAssuming paths out of this block depend on a boolean condition- Returns:
- the PcodeBlock coming out of this if the condition is true
 
- 
getInSizepublic int getInSize()
- 
getOutSizepublic int getOutSize()
- 
calcDepth
- 
getFrontLeaf
- 
encodeHeaderEncode basic attributes to stream. Assume this block's element is already started.- Parameters:
- encoder- is the stream encoder
- Throws:
- IOException- for errors writing to the underlying stream
 
- 
decodeHeader- Throws:
- DecoderException
 
- 
encodeBodyEncode information about the block to stream, other than header and edge info- Parameters:
- encoder- is the stream encoder
- Throws:
- IOException- for errors writing to the underlying stream
 
- 
encodeEdgesEncode information about this blocks edges to stream- Parameters:
- encoder- is the stream encoder
- Throws:
- IOException- for errors writing to the underlying stream
 
- 
decodeBodyRestore the any additional information beyond header and edges from stream- Parameters:
- decoder- is the stream decoder
- resolver- is for looking up edge references
- Throws:
- DecoderException- for invalid encoding
 
- 
decodeEdges- Throws:
- DecoderException
 
- 
encodeEncode this block to a stream- Parameters:
- encoder- is the stream encoder
- Throws:
- IOException- for errors writing to the underlying stream
 
- 
decodeDecode this block from a stream- Parameters:
- decoder- is the stream decoder
- resolver- is the map from reference to block object
- Throws:
- DecoderException- for errors in the encoding
 
 
-