java.lang.Object | |
↳ | com.pnfsoftware.jeb.core.units.code.asm.cfg.BasicBlock<InsnType extends com.pnfsoftware.jeb.core.units.code.IInstruction> |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
BasicBlock(long base)
Create a new empty basic block.
| |||||||||||
BasicBlock(long base, List<InsnType> insns, List<Long> dstOffsets, List<Long> irrdstOffsets, boolean unknownDst)
Create a new basic block.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void |
add(InsnType insn)
DANGEROUS! Append an instruction to the block.
| ||||||||||
Iterable<AddressableInstruction<InsnType>> | addressableInstructions() | ||||||||||
int |
allinsize()
Get the total number of input edges to this block.
| ||||||||||
int | alloutsize() | ||||||||||
boolean | canThrow() | ||||||||||
InsnType |
get(int index)
Get the instruction at the specified index.
| ||||||||||
AddressableInstruction<InsnType> |
get2(int index)
Get the instruction at the specified index, in an addressable form.
| ||||||||||
long | getAddressOfInstruction(int index) | ||||||||||
List<BasicBlock<InsnType>> | getAllInputBlocks() | ||||||||||
List<BasicBlock<InsnType>> |
getAllOutputBlocks()
Get regular and irregular output blocks.
| ||||||||||
AddressableInstruction<InsnType> |
getBranchingInstruction2(boolean includeBreaking, boolean includeCalling)
Retrieve the branching instruction, if any.
| ||||||||||
AddressableInstruction<InsnType> |
getBranchingInstruction2()
Same as
getBranchingInstruction2(true,
true) . | ||||||||||
Object |
getData(String name)
May return null if the custom object does not exist.
| ||||||||||
long |
getEndAddress()
Address following the last instruction of the block (ie, last exclusive address).
| ||||||||||
long |
getFirstAddress()
Address of first instruction in the block.
| ||||||||||
Map<Integer, Set<Long>> | getFullDefUseChains(int index) | ||||||||||
Map<Integer, Set<Long>> | getFullUseDefChains(int index) | ||||||||||
int | getIndexOfInstruction(long address) | ||||||||||
BasicBlock<InsnType> |
getInputBlock(int index)
Get a regular input block.
| ||||||||||
List<BasicBlock<InsnType>> |
getInputBlocks()
Get the regular input blocks.
| ||||||||||
InsnType | getInstruction(int index) | ||||||||||
InsnType | getInstruction(long address) | ||||||||||
List<InsnType> |
getInstructions()
Get a copy of the list of instructions that make up this basic block.
| ||||||||||
BasicBlock<InsnType> |
getIrregularInputBlock(int index)
Get an irregular input block.
| ||||||||||
List<BasicBlock<InsnType>> | getIrregularInputBlocks() | ||||||||||
BasicBlock<InsnType> |
getIrregularOutputBlock(int index)
Get an irregular output block.
| ||||||||||
List<BasicBlock<InsnType>> |
getIrregularOutputBlocks()
Get irregular output blocks.
| ||||||||||
InsnType |
getLast()
Get the last instruction of the block.
| ||||||||||
AddressableInstruction<InsnType> |
getLast2()
Get the last instruction of the block, in an addressable form.
| ||||||||||
long |
getLastAddress()
Address of last instruction in the block.
| ||||||||||
BasicBlock<InsnType> |
getOutputBlock(int index)
Get a regular output block.
| ||||||||||
List<BasicBlock<InsnType>> |
getOutputBlocks()
Get the regular output blocks.
| ||||||||||
Map<Integer, Set<Integer>> | getSimpleDefUseChains(int index) | ||||||||||
Map<Integer, Set<Integer>> | getSimpleUseDefChains(int index) | ||||||||||
Tracker<InsnType> | getTrackerLiveRegisters() | ||||||||||
Tracker<InsnType> | getTrackerReachingRegisters() | ||||||||||
boolean | hasUnknownDst() | ||||||||||
int |
insize()
Get the number of regular input edges to this block.
| ||||||||||
int |
irrinsize()
Get the number of irregular input edges to this block.
| ||||||||||
int | irroutsize() | ||||||||||
boolean |
isEmpty()
Determine if the block has 0 instruction.
| ||||||||||
boolean |
isInfiniteLoop()
Check if the block has a single regular out-edge which points to itself.
| ||||||||||
boolean |
isSelfReferencing()
Check if the block has at least one regular out-edge pointing to itself.
| ||||||||||
Iterator<InsnType> | iterator() | ||||||||||
int | outsize() | ||||||||||
boolean |
remove(int index)
Remove an instruction from the block as well as associated chains.
| ||||||||||
boolean | removeData(String name) | ||||||||||
InsnType |
set(int index, InsnType insn)
Replace an instruction.
| ||||||||||
void |
setData(String name, Object object)
Custom data is reset when a DFA is invalidated.
| ||||||||||
BasicBlock<InsnType> |
shallowCopy(boolean copyBlockReferences)
Shallow duplication of a basic block.
| ||||||||||
int |
size()
Get the number of instructions in the block.
| ||||||||||
String | toString() |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() |
Create a new empty basic block.
Create a new basic block.
DANGEROUS! Append an instruction to the block.
The instruction is appended to the block. The edges are not updated.
The caller is solely responsible for maintaining the consistency of the block and of the CFG.
insn | the instruction to be appended |
---|
Get the total number of input edges to this block.
Get the instruction at the specified index.
Get the instruction at the specified index, in an addressable form.
Get regular and irregular output blocks.
Retrieve the branching instruction, if any.
Same as getBranchingInstruction2(true,
true)
.
May return null if the custom object does not exist.
Address following the last instruction of the block (ie, last exclusive address).
Address of first instruction in the block.
Get a regular input block.
index | block index |
---|
Get the regular input blocks.
Get a copy of the list of instructions that make up this basic block.
Get an irregular input block.
index | block index |
---|
Get irregular output blocks.
Get the last instruction of the block.
Keep in mind that a branching instruction may NOT be the last instruction of a basic block if it supports delay-slots.
Get the last instruction of the block, in an addressable form.
Keep in mind that a branching instruction may NOT be the last instruction of a basic block if it supports delay-slots.
Address of last instruction in the block.
Get the regular output blocks.
Get the number of regular input edges to this block.
Get the number of irregular input edges to this block.
Determine if the block has 0 instruction.
Check if the block has a single regular out-edge which points to itself.
Check if the block has at least one regular out-edge pointing to itself.
Remove an instruction from the block as well as associated chains. Usage is not recommended for public clients.
This method may have the nasty side-effect of making the block empty. In that case, it returns true, and it is the caller's responsibility to refresh the CFG at their earliest convenience.
Another issue the client needs to take care of is the removal of the last instruction, which should only happen on very specific conditions, since the trailing instruction typically conditions the out-edges of the block.
Replace an instruction. Sizes must match.
insn | the instruction |
---|
Custom data is reset when a DFA is invalidated.
Shallow duplication of a basic block. USE THE RESULTING BLOCK WITH CAUTION. - Instructions
references are copied
- Block references (edges) are optionally copied (the blocks are not)
- DFA data is not copied
Get the number of instructions in the block.