Package ghidra.program.model.block
Class ExtCodeBlockImpl
- java.lang.Object
-
- ghidra.program.model.address.AddressSet
-
- ghidra.program.model.block.ExtCodeBlockImpl
-
- All Implemented Interfaces:
AddressSetView
,CodeBlock
,java.lang.Iterable<AddressRange>
public class ExtCodeBlockImpl extends AddressSet implements CodeBlock
-
-
Constructor Summary
Constructors Constructor Description ExtCodeBlockImpl(CodeBlockModel model, Address extAddr)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CodeBlockReferenceIterator
getDestinations(TaskMonitor monitor)
Get an Iterator over the CodeBlocks that are flowed to from this CodeBlock.Address
getFirstStartAddress()
Return the first start address of the CodeBlock.FlowType
getFlowType()
Return, in theory, how things flow out of this node.CodeBlockModel
getModel()
Get the model instance which was used to generate this block.java.lang.String
getName()
Return the name of the block.int
getNumDestinations(TaskMonitor monitor)
Get the number of CodeBlocks this block flows to.int
getNumSources(TaskMonitor monitor)
Get the number of CodeBlocks that flow into this CodeBlock.CodeBlockReferenceIterator
getSources(TaskMonitor monitor)
Get an Iterator over the CodeBlocks that flow into this CodeBlock.Address[]
getStartAddresses()
Get all the entry points to this block.int
hashCode()
-
Methods inherited from class ghidra.program.model.address.AddressSet
add, add, add, add, addRange, addRange, clear, contains, contains, contains, delete, delete, delete, deleteRange, equals, findFirstAddressInCommon, getAddresses, getAddresses, getAddressRanges, getAddressRanges, getAddressRanges, getFirstRange, getLastRange, getMaxAddress, getMinAddress, getNumAddresses, getNumAddressRanges, getRangeContaining, hasSameAddresses, intersect, intersectRange, intersects, intersects, isEmpty, iterator, iterator, iterator, printRanges, subtract, toList, toString, union, xor
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface ghidra.program.model.address.AddressSetView
contains, contains, contains, findFirstAddressInCommon, getAddresses, getAddresses, getAddressRanges, getAddressRanges, getAddressRanges, getFirstRange, getLastRange, getMaxAddress, getMinAddress, getNumAddresses, getNumAddressRanges, getRangeContaining, hasSameAddresses, intersect, intersectRange, intersects, intersects, isEmpty, iterator, iterator, iterator, subtract, union, xor
-
-
-
-
Constructor Detail
-
ExtCodeBlockImpl
public ExtCodeBlockImpl(CodeBlockModel model, Address extAddr)
-
-
Method Detail
-
getFirstStartAddress
public Address getFirstStartAddress()
Description copied from interface:CodeBlock
Return the first start address of the CodeBlock. Depending on the model used to generate the CodeBlock, there may be multiple entry points to the block. This will return the first start address for the block. It should always return the same address for a given block if there is more than one entry point.- Specified by:
getFirstStartAddress
in interfaceCodeBlock
- Returns:
- the first start address of the block.
-
getFlowType
public FlowType getFlowType()
Description copied from interface:CodeBlock
Return, in theory, how things flow out of this node. If there are any abnormal ways to flow out of this node, (ie: jump, call, etc...) then the flow type of the node takes on that type. If there are multiple unique ways out of the node, then we should return FlowType.UNKNOWN. Fallthrough is returned if that is the only way out.- Specified by:
getFlowType
in interfaceCodeBlock
- Returns:
- flow type of this node
-
getModel
public CodeBlockModel getModel()
Description copied from interface:CodeBlock
Get the model instance which was used to generate this block.
-
getName
public java.lang.String getName()
Description copied from interface:CodeBlock
Return the name of the block.
-
getNumDestinations
public int getNumDestinations(TaskMonitor monitor) throws CancelledException
Description copied from interface:CodeBlock
Get the number of CodeBlocks this block flows to. Note that this is almost as much work as getting the actual destination references.- Specified by:
getNumDestinations
in interfaceCodeBlock
- Parameters:
monitor
- task monitor which allows user to cancel operation.- Returns:
- number of destination CodeBlocks.
- Throws:
CancelledException
- if the monitor cancels the operation.- See Also:
CodeBlock.getDestinations(ghidra.util.task.TaskMonitor)
-
getDestinations
public CodeBlockReferenceIterator getDestinations(TaskMonitor monitor) throws CancelledException
Description copied from interface:CodeBlock
Get an Iterator over the CodeBlocks that are flowed to from this CodeBlock.- Specified by:
getDestinations
in interfaceCodeBlock
- Parameters:
monitor
- task monitor which allows user to cancel operation.- Returns:
- An iterator over CodeBlocks refered to by this Block.
- Throws:
CancelledException
- if the monitor cancels the operation.
-
getNumSources
public int getNumSources(TaskMonitor monitor) throws CancelledException
Description copied from interface:CodeBlock
Get the number of CodeBlocks that flow into this CodeBlock. Note that this is almost as much work as getting the actual source references.- Specified by:
getNumSources
in interfaceCodeBlock
- Parameters:
monitor
- task monitor which allows user to cancel operation.- Returns:
- number of source CodeBlocks.
- Throws:
CancelledException
- if the monitor cancels the operation.- See Also:
CodeBlock.getSources(ghidra.util.task.TaskMonitor)
-
getSources
public CodeBlockReferenceIterator getSources(TaskMonitor monitor) throws CancelledException
Description copied from interface:CodeBlock
Get an Iterator over the CodeBlocks that flow into this CodeBlock.- Specified by:
getSources
in interfaceCodeBlock
- Parameters:
monitor
- task monitor which allows user to cancel operation.- Returns:
- An iterator over CodeBlocks referencing this Block.
- Throws:
CancelledException
- if the monitor cancels the operation.
-
getStartAddresses
public Address[] getStartAddresses()
Description copied from interface:CodeBlock
Get all the entry points to this block. Depending on the model, there may be more than one entry point. Entry points will be returned in natural sorted order.- Specified by:
getStartAddresses
in interfaceCodeBlock
- Returns:
- an array of entry points to this block. a zero length array if there are no entry points.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classAddressSet
- See Also:
Object.hashCode()
-
-