Package ghidra.program.model.block
Class SingleEntSubIterator
java.lang.Object
ghidra.program.model.block.SingleEntSubIterator
- All Implemented Interfaces:
CodeBlockIterator,Iterable<CodeBlock>
SingleEntSubIterator is an implementation of
CodeBlockIterator capable of iterating in
the forward direction over subroutine code blocks.
This iterator supports subroutine models which allow only one
called/source entry point within a subroutine and may
share code with other subroutines produced by the same model.
All entry points must be accounted for within M-Model subroutines.
NOTE: This iterator only supports OverlapCodeSubModel block models
and extensions.
NOTE: If the containing M-model subroutine has two entry points, say
A and B, such that the code traversed from A is identical to the code traversed
by B (due to a cycle), then this iterator will include it twice rather than
skipping over the identical address set. This is because the iterator works by
iterating through M-model subroutines, and wherever M-model subroutines have
n > 1 multiple entry points, the iterator produces an O-model subroutine
for every one of the entry points.-
Constructor Summary
ConstructorsConstructorDescriptionSingleEntSubIterator(OverlapCodeSubModel model, AddressSetView set, TaskMonitor monitor) Creates a new iterator that will iterate over the program within a given address range set.SingleEntSubIterator(OverlapCodeSubModel model, TaskMonitor monitor) Creates a new iterator that will iterate over the entire program starting from its current minimum address. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ghidra.program.model.block.CodeBlockIterator
iteratorMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
SingleEntSubIterator
public SingleEntSubIterator(OverlapCodeSubModel model, TaskMonitor monitor) throws CancelledException Creates a new iterator that will iterate over the entire program starting from its current minimum address.- Parameters:
model- the BlockModel the iterator will use in its operations.monitor- task monitor which allows user to cancel operation.- Throws:
CancelledException- if the monitor cancels the operation.
-
SingleEntSubIterator
public SingleEntSubIterator(OverlapCodeSubModel model, AddressSetView set, TaskMonitor monitor) throws CancelledException Creates a new iterator that will iterate over the program within a given address range set. All blocks which overlap the address set will be returned.- Parameters:
model- the BlockModel the iterator will use in its operations.set- the address range set which the iterator is to be restricted to.monitor- task monitor which allows user to cancel operation.- Throws:
CancelledException- if the monitor cancels the operation.
-
-
Method Details
-
hasNext
Description copied from interface:CodeBlockIteratorReturn true if next() will return a CodeBlock.- Specified by:
hasNextin interfaceCodeBlockIterator- Returns:
- true if next() will return a CodeBlock.
- Throws:
CancelledException- thrown if the operation is cancelled.- See Also:
-
next
Description copied from interface:CodeBlockIteratorReturn the next CodeBlock.- Specified by:
nextin interfaceCodeBlockIterator- Returns:
- the next CodeBlock.
- Throws:
CancelledException- thrown if the operation is cancelled.- See Also:
-