Class DefUseInfo
java.lang.Object
com.pnfsoftware.jeb.core.units.code.DefUseInfo
- Direct Known Subclasses:
EDefUseInfo
Def-use information object provided by instruction for data-flow analysis purposes. Can be subclassed.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intConservative collection flags.verified defines / never nullpotential defines
may be null (non-null IFF theFLAG_INCLUDE_POTENTIALSflag was set)
must not intersectdefstatic final intInclude potential definitions and uses.static final intInclude spoiled variables.Instruction address, if known.spoiled variables, i.e.verified uses / never nullpotential uses
may be null (non-null IFF theFLAG_INCLUDE_POTENTIALSflag was set)
must not intersectuse -
Constructor Summary
ConstructorsConstructorDescriptionCreate def-use information with default flags.DefUseInfo(int flags) Create def-use information. -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clear all collected information.getDef()Get defined variable ranges.Get defined variable ids.Get the instruction address.Get potentially defined variable ids.Get potentially used variable ids.Get spoiled variable ids.getUse()Get used variable ranges.Get used variable ids.voidsetInstructionAddress(long addr) Set the instruction address.booleanDetermine whether potential definitions and uses should be collected.booleanDetermine whether spoiled variables should be collected.toString()
-
Field Details
-
FLAG_INCLUDE_POTENTIALS
public static final int FLAG_INCLUDE_POTENTIALSInclude potential definitions and uses.- See Also:
-
FLAG_INCLUDE_SPOILED
public static final int FLAG_INCLUDE_SPOILEDInclude spoiled variables.- See Also:
-
CONSERVATIVE
public static final int CONSERVATIVEConservative collection flags.- See Also:
-
insnAddress
Instruction address, if known. -
def
verified defines / never null -
use
verified uses / never null -
defpot
potential defines
may be null (non-null IFF theFLAG_INCLUDE_POTENTIALSflag was set)
must not intersectdef -
usepot
potential uses
may be null (non-null IFF theFLAG_INCLUDE_POTENTIALSflag was set)
must not intersectuse -
spoiled
spoiled variables, i.e. vars defined to unusable values a.k.a. collateral writes
may be null (non-null IFF theFLAG_INCLUDE_SPOILEDflag was set)
-
-
Constructor Details
-
DefUseInfo
public DefUseInfo()Create def-use information with default flags. -
DefUseInfo
public DefUseInfo(int flags) Create def-use information.- Parameters:
flags- collection flags
-
-
Method Details
-
getInstructionAddress
Get the instruction address.- Returns:
- instruction address, or null
-
setInstructionAddress
public void setInstructionAddress(long addr) Set the instruction address.- Parameters:
addr- instruction address
-
clear
public void clear()Clear all collected information. -
shouldCollectPotentials
public boolean shouldCollectPotentials()Determine whether potential definitions and uses should be collected.- Returns:
- true if potential definitions and uses should be collected
-
shouldCollectSpoiled
public boolean shouldCollectSpoiled()Determine whether spoiled variables should be collected.- Returns:
- true if spoiled variables should be collected
-
getDef
Get defined variable ranges.- Returns:
- defined variable ranges
-
getUse
Get used variable ranges.- Returns:
- used variable ranges
-
getDefinedVarIds
Get defined variable ids.- Returns:
- defined variable ids
-
getUsedVarIds
Get used variable ids.- Returns:
- used variable ids
-
getPotentiallyDefinedVarIds
Get potentially defined variable ids.- Returns:
- potentially defined variable ids
-
getPotentiallyUsedVarIds
Get potentially used variable ids.- Returns:
- potentially used variable ids
-
getSpoiledVarIds
Get spoiled variable ids.- Returns:
- spoiled variable ids
-
toString
-