Package ghidra.app.util
Class XReferenceUtils
java.lang.Object
ghidra.app.util.XReferenceUtils
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetAllXrefs
(ProgramLocation location) Returns all xrefs to the given location.getOffcutXReferences
(CodeUnit cu, int max) Returns an array containing all offcut xref references to the specified code unitstatic void
Populates the provided lists with the direct and offcut xrefs to the specified variablestatic void
Populates the provided lists with the direct and offcut xrefs to the specified variablegetXReferences
(CodeUnit cu, int max) Returns an array containing the firstmax
direct xref references to the specified code unit.static void
showXrefs
(Navigatable navigatable, ServiceProvider serviceProvider, TableService service, ProgramLocation location, Collection<Reference> xrefs) Shows all xrefs to the given location in a new table.
-
Constructor Details
-
XReferenceUtils
public XReferenceUtils()
-
-
Method Details
-
getXReferences
Returns an array containing the firstmax
direct xref references to the specified code unit.- Parameters:
cu
- the code unit to generate the xrefsmax
- max number of xrefs to get, or -1 to get all references- Returns:
- array first
max
xrefs to the code unit
-
getOffcutXReferences
Returns an array containing all offcut xref references to the specified code unit- Parameters:
cu
- the code unit to generate the offcut xrefsmax
- max number of offcut xrefs to get, or -1 to get all offcut references- Returns:
- array of all offcut xrefs to the code unit
-
getVariableRefs
Populates the provided lists with the direct and offcut xrefs to the specified variable- Parameters:
var
- variable to get referencesxrefs
- list to put direct references inoffcuts
- list to put offcut references in
-
getVariableRefs
public static void getVariableRefs(Variable var, List<Reference> xrefs, List<Reference> offcuts, int max) Populates the provided lists with the direct and offcut xrefs to the specified variable- Parameters:
var
- variable to get referencesxrefs
- list to put direct references inoffcuts
- list to put offcut references inmax
- max number of xrefs to get, or -1 to get all references
-
getAllXrefs
Returns all xrefs to the given location. If in data, then xrefs to the specific data component will be returned. Otherwise, the code unit containing the address of the given location will be used as the source of the xrefs.- Parameters:
location
- the location for which to get xrefs- Returns:
- the xrefs
-