Package ghidra.program.util
Class VariableLocation
java.lang.Object
ghidra.program.util.ProgramLocation
ghidra.program.util.FunctionLocation
ghidra.program.util.VariableLocation
- All Implemented Interfaces:
- Cloneable,- Comparable<ProgramLocation>
- Direct Known Subclasses:
- VariableCommentFieldLocation,- VariableLocFieldLocation,- VariableNameFieldLocation,- VariableTypeFieldLocation,- VariableXRefFieldLocation
VariableLocation provides information about the location
 on a variable within a Function.- 
Field SummaryFields inherited from class ghidra.program.util.FunctionLocationfunctionAddrFields inherited from class ghidra.program.util.ProgramLocationaddr, program, refAddr
- 
Constructor SummaryConstructorsConstructorDescriptionDefault constructor needed for restoring a variable location from XML.VariableLocation(Program program, Address locationAddr, Variable var, int index, int charOffset) Create a new VariableLocation.VariableLocation(Program program, Variable var, int index, int charOffset) Create a new VariableLocation.
- 
Method SummaryModifier and TypeMethodDescriptionintbooleanGet the variable associated with this variable locationbooleanisLocationFor(Variable var) Checks to see if this location is for the indicated variable.booleanbooleanisReturn()booleanReturns true if this location represents a valid location in the given program.voidrestoreState(Program p, SaveState obj) Restore this function location using the given program and save state object.voidSave this function location to the given save state object.toString()Methods inherited from class ghidra.program.util.FunctionLocationgetFunctionAddressMethods inherited from class ghidra.program.util.ProgramLocationclone, compareAddr, getAddress, getByteAddress, getCharOffset, getColumn, getComponentPath, getLocation, getProgram, getRefAddress, getRow, getTranslatedCopy, hashCode
- 
Constructor Details- 
VariableLocationpublic VariableLocation()Default constructor needed for restoring a variable location from XML.
- 
VariableLocationpublic VariableLocation(Program program, Address locationAddr, Variable var, int index, int charOffset) Create a new VariableLocation.- Parameters:
- program- the program of the location
- locationAddr- the address of the listing location (i.e., referent code unit)
- var- the variable associated with this location.
- index- the index of the sub-piece on that variable (only the xrefs have subpieces
- charOffset- the character position on the piece.
 
- 
VariableLocationCreate a new VariableLocation.- Parameters:
- program- the program of the location
- var- the variable associated with this location.
- index- the index of the sub-piece on that variable (only the xrefs have subpieces
- charOffset- the character position on the piece.
 
 
- 
- 
Method Details- 
toString- Overrides:
- toStringin class- FunctionLocation
 
- 
getVariableGet the variable associated with this variable location- Returns:
- associated function variable
 
- 
isLocationForChecks to see if this location is for the indicated variable.- Parameters:
- var- the variable
- Returns:
- true if this location is for the specified variable.
 
- 
isParameterpublic boolean isParameter()
- 
isReturnpublic boolean isReturn()
- 
equals- Overrides:
- equalsin class- FunctionLocation
 
- 
compareTo- Specified by:
- compareToin interface- Comparable<ProgramLocation>
- Overrides:
- compareToin class- ProgramLocation
 
- 
restoreStateDescription copied from class:FunctionLocationRestore this function location using the given program and save state object.- Overrides:
- restoreStatein class- FunctionLocation
- Parameters:
- p- the program containing the function location
- obj- the save state object for saving the location
 
- 
saveStateDescription copied from class:FunctionLocationSave this function location to the given save state object.- Overrides:
- saveStatein class- FunctionLocation
- Parameters:
- obj- the save state object for saving the location
 
- 
isValidDescription copied from class:ProgramLocationReturns true if this location represents a valid location in the given program.- Overrides:
- isValidin class- FunctionLocation
- Parameters:
- p- the program to test if this location is valid.
- Returns:
- true if this location represents a valid location in the given program.
 
 
-