Package ghidra.app.decompiler.component
Class DecompilerUtils
- java.lang.Object
-
- ghidra.app.decompiler.component.DecompilerUtils
-
public class DecompilerUtils extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description DecompilerUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static AddressfindAddressBefore(Field[] lines, ClangToken token)static AddressSetfindClosestAddressSet(Program program, AddressSpace functionSpace, java.util.List<ClangToken> tokenList)static intfindIndexOfFirstField(java.util.List<ClangToken> tokenlist, Field[] fields)Find index of first field containing a ClangNode in tokenListstatic java.util.Set<Varnode>getBackwardSlice(Varnode seed)static java.util.Set<PcodeOp>getBackwardSliceToPCodeOps(Varnode seed)static AddressgetClosestAddress(ClangToken token)static FieldSelectiongetFieldSelection(java.util.List<ClangToken> tokens)static java.util.Set<Varnode>getForwardSlice(Varnode seed)Construct the set of varnodes making up a simple forward slice of seedstatic java.util.Set<PcodeOp>getForwardSliceToPCodeOps(Varnode seed)static FunctiongetFunction(Program program, ClangFuncNameToken token)static java.util.List<ClangToken>getTokens(ClangNode root, Address address)static java.util.List<ClangToken>getTokens(ClangNode root, AddressSetView addressSet)Find all ClangNodes that have a minimum address in the AddressSetViewstatic java.util.List<ClangToken>getTokensInSelection(FieldSelection selection, Field[] lines)static VarnodegetVarnodeRef(ClangToken vartoken)If the token refers to an individual Varnode, return it.static java.util.ArrayList<ClangLine>toLines(ClangTokenGroup group)
-
-
-
Method Detail
-
getVarnodeRef
public static Varnode getVarnodeRef(ClangToken vartoken)
If the token refers to an individual Varnode, return it. Otherwise return null;- Returns:
- the Varnode or null otherwise
-
getForwardSlice
public static java.util.Set<Varnode> getForwardSlice(Varnode seed)
Construct the set of varnodes making up a simple forward slice of seed- Parameters:
seed- Varnode where the slice starts- Returns:
- set of Varnodes in the slice
-
getForwardSliceToPCodeOps
public static java.util.Set<PcodeOp> getForwardSliceToPCodeOps(Varnode seed)
-
getBackwardSliceToPCodeOps
public static java.util.Set<PcodeOp> getBackwardSliceToPCodeOps(Varnode seed)
-
getFunction
public static Function getFunction(Program program, ClangFuncNameToken token)
- Returns:
- the function referenced by the given token
-
findIndexOfFirstField
public static int findIndexOfFirstField(java.util.List<ClangToken> tokenlist, Field[] fields)
Find index of first field containing a ClangNode in tokenList- Parameters:
tokenlist-- Returns:
- index of field, or -1
-
getTokens
public static java.util.List<ClangToken> getTokens(ClangNode root, AddressSetView addressSet)
Find all ClangNodes that have a minimum address in the AddressSetView- Parameters:
reslist- is resulting list of found ClangNodesparentNode- is root of node tree to searchaset- is the AddressSetView to match
-
getTokens
public static java.util.List<ClangToken> getTokens(ClangNode root, Address address)
-
getClosestAddress
public static Address getClosestAddress(ClangToken token)
-
findClosestAddressSet
public static AddressSet findClosestAddressSet(Program program, AddressSpace functionSpace, java.util.List<ClangToken> tokenList)
-
getFieldSelection
public static FieldSelection getFieldSelection(java.util.List<ClangToken> tokens)
-
getTokensInSelection
public static java.util.List<ClangToken> getTokensInSelection(FieldSelection selection, Field[] lines)
-
findAddressBefore
public static Address findAddressBefore(Field[] lines, ClangToken token)
-
toLines
public static java.util.ArrayList<ClangLine> toLines(ClangTokenGroup group)
-
-