java.lang.Object | |
↳ | com.pnfsoftware.jeb.core.units.code.asm.cfg.CFGFormatter<InsnType extends com.pnfsoftware.jeb.core.units.code.IInstruction> |
Known Direct Subclasses |
Customizable CFG formatter.
Sub-classes are permitted. Protected methods genXxx()
may be overridden to customize
rendering.
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
public static final AtomicInteger | cfgfwccnt | Performance counter reserved for internal use. |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
CFGFormatter(CFG<InsnType> cfg)
Legacy CFG formatter.
| |||||||||||
CFGFormatter(CFG<InsnType> cfg, IVariableProvider varprv, boolean formatFineGrained)
Build a CFG formatter with an optional variable provider to aid in the representation of data
chains.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String |
format(boolean formatAddresses, boolean formatChains, boolean formatInOut, IDFA<InsnType> dfa, IFormattingContextFactory<InsnType> fcf)
Format the CFG into a printable string, with optional data chains.
| ||||||||||
static <T extends Number> String | formatChains(Map<Integer, Collection<T>> chains, IVariableProvider varprv) | ||||||||||
final String |
formatSimple()
Convenience method.
| ||||||||||
final CFG<InsnType> | getCfg() |
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void |
genAddress(StringBuilder sb, long address, InsnType insn)
The default implementation generates
ADDRESS/SIZE . | ||||||||||
void |
genAddressCharacter(StringBuilder sb, long address, InsnType insn, BasicBlock<InsnType> b, int i)
The default implementation generates one of:
: (default) > (entry) + (block) * (handler) v (branching down) ^ (branching up)
| ||||||||||
void |
genBOL(StringBuilder sb, long address, InsnType insn)
The default implementation does nothing.
| ||||||||||
void |
genEOL(StringBuilder sb, long address, InsnType insn)
The default implementation appends a New Line (
\n ) character. | ||||||||||
void |
genHeader(StringBuilder sb)
The default implementation does nothing.
| ||||||||||
void |
genPostAddress(StringBuilder sb, long address, InsnType insn)
The default implementation appends 2 spaces.
| ||||||||||
void |
genPostChains(StringBuilder sb, long address, InsnType insn)
The default implementation appends spaces to pad the current line to 2000 characters (or
more).
| ||||||||||
void |
genPostInstruction(StringBuilder sb, long address, InsnType insn)
The default implementation appends spaces to pad the current line to 120 characters (or
more).
| ||||||||||
void |
genPreAddress(StringBuilder sb, long address, InsnType insn)
The default implementation does nothing.
| ||||||||||
void |
genPreChains(StringBuilder sb, long address, InsnType insn)
The default implementation does nothing.
| ||||||||||
void |
genPreInstruction(StringBuilder sb, long address, InsnType insn)
The default implementation does nothing.
| ||||||||||
void |
genTrailer(StringBuilder sb)
The default implementation does nothing.
| ||||||||||
final void | padLine(StringBuilder sb, int alignLen) |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Performance counter reserved for internal use.
Legacy CFG formatter. Variables/registers/bits in data chains are represented by their ids.
cfg | a CFG |
---|
Build a CFG formatter with an optional variable provider to aid in the representation of data chains.
cfg | a CFG |
---|---|
varprv | optional variable provider |
formatFineGrained | N/A if varprv is null; else, determine if the chains should be represented fine grained (partial variable use is explicitly shown), or coarse grained (any bit of a variable being used will be represented as a full variable use) |
Format the CFG into a printable string, with optional data chains.
formatAddresses | true to prepend instructions by their address |
---|---|
formatChains | true to format data chains |
formatInOut | true to format the input and output chains |
dfa | DFA object |
fcf | optional context generator for instructions |
Convenience method. Format a CFG without any chain.
The default implementation generates ADDRESS/SIZE
.
The default implementation generates one of:
: (default) > (entry) + (block) * (handler) v (branching down) ^ (branching up)
The default implementation does nothing.
The default implementation appends a New Line (\n
) character.
The default implementation does nothing.
The default implementation appends 2 spaces.
The default implementation appends spaces to pad the current line to 2000 characters (or more).
The default implementation appends spaces to pad the current line to 120 characters (or more).
The default implementation does nothing.
The default implementation does nothing.
The default implementation does nothing.
The default implementation does nothing.