Package ghidra.program.model.block
Class BasicBlockModel
- java.lang.Object
-
- ghidra.program.model.block.SimpleBlockModel
-
- ghidra.program.model.block.BasicBlockModel
-
- All Implemented Interfaces:
CodeBlockModel
public class BasicBlockModel extends SimpleBlockModel
This BlockModel implements the Basic block model. Each Codeblock is made up of contiguous instructions in address order. Blocks satisfy the following:- Any instruction with a label starts a block.
- Each instruction that could cause program control flow to change local to the containing function (i.e., excludes calls) is the last instruction of a Codeblock.
- All other instructions are "NOP" fallthroughs, meaning after execution the program counter will be at the instruction immediately following.
- Any instruction that is unreachable and has no label is also considered the start of a block.
- The delay slot depth of the delayed instruction will always correspond to the number of delay slot instructions immediately following the instruction. The model may not behave properly if the disassembled code violates this assumption.
- See Also:
CodeBlockModel
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
NAME
-
Fields inherited from class ghidra.program.model.block.SimpleBlockModel
emptyArray, followIndirectFlows, foundBlockMap, includeExternals, listing, program, referenceMgr
-
Fields inherited from interface ghidra.program.model.block.CodeBlockModel
emptyBlockArray
-
-
Constructor Summary
Constructors Constructor Description BasicBlockModel(Program program)
BasicBlockModel(Program program, boolean includeExternals)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
hasEndOfBlockFlow(Instruction instr)
Examine an instruction for out-bound flows which qualify it as an end-of-block.-
Methods inherited from class ghidra.program.model.block.SimpleBlockModel
allowsBlockOverlap, createSimpleDataBlock, externalsIncluded, getBasicBlockModel, getCodeBlockAt, getCodeBlocks, getCodeBlocksContaining, getCodeBlocksContaining, getDestinations, getFirstCodeBlockContaining, getFlowType, getListing, getName, getName, getNumDestinations, getNumSources, getProgram, getSources, isBlockStart, isBlockStart
-
-
-
-
Field Detail
-
NAME
public static final java.lang.String NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
hasEndOfBlockFlow
protected boolean hasEndOfBlockFlow(Instruction instr)
Description copied from class:SimpleBlockModel
Examine an instruction for out-bound flows which qualify it as an end-of-block.- Overrides:
hasEndOfBlockFlow
in classSimpleBlockModel
- Returns:
- true if end-of-block flow exists from specified instruction.
-
-