Package ghidra.program.model.block
Class BasicBlockModel
java.lang.Object
ghidra.program.model.block.SimpleBlockModel
ghidra.program.model.block.BasicBlockModel
- All Implemented Interfaces:
CodeBlockModel
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:
-
Field Summary
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
ConstructorDescriptionBasicBlockModel
(Program program) BasicBlockModel
(Program program, boolean includeExternals) -
Method Summary
Modifier and TypeMethodDescriptionprotected 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 Details
-
NAME
- See Also:
-
-
Constructor Details
-
BasicBlockModel
-
BasicBlockModel
-
-
Method Details
-
hasEndOfBlockFlow
Description copied from class:SimpleBlockModel
Examine an instruction for out-bound flows which qualify it as an end-of-block.- Overrides:
hasEndOfBlockFlow
in classSimpleBlockModel
- Parameters:
instr
-- Returns:
- true if end-of-block flow exists from specified instruction.
-