Package ghidra.program.util
Class AddressFieldLocation
java.lang.Object
ghidra.program.util.ProgramLocation
ghidra.program.util.CodeUnitLocation
ghidra.program.util.AddressFieldLocation
- All Implemented Interfaces:
Cloneable,Comparable<ProgramLocation>
The
AddressFieldLocation class provides specific information
about a program location within the ADDRESS field.-
Field Summary
Fields inherited from class ghidra.program.util.ProgramLocation
addr, program, refAddr -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor needed for restoring an address field location from XML.AddressFieldLocation(Program program, Address addr) Construct a new default AddressFieldLocation for a given program address.AddressFieldLocation(Program program, Address addr, int[] componentPath, String addrRepresentation, int charOffset) Construct a new AddressFieldLocation object with the standard string representation and a position within that string. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the standard string representation of the address in the address field.inthashCode()voidrestoreState(Program restoreProgram, SaveState obj) Restore this program location using the given program and save state object.voidSave this program location to the given save state object.toString()Returns a String representation of this location.Methods inherited from class ghidra.program.util.CodeUnitLocation
isValidMethods inherited from class ghidra.program.util.ProgramLocation
clone, compareAddr, compareTo, getAddress, getByteAddress, getCharOffset, getColumn, getComponentPath, getLocation, getProgram, getRefAddress, getRow, getTranslatedCopy
-
Constructor Details
-
AddressFieldLocation
public AddressFieldLocation(Program program, Address addr, int[] componentPath, String addrRepresentation, int charOffset) Construct a new AddressFieldLocation object with the standard string representation and a position within that string.- Parameters:
program- the program of the locationaddr- address of the locationcomponentPath- if not null, it is the array of indexes that point to a specific data type inside of another data typeaddrRepresentation- the string representation of the addresscharOffset- the position into the string representation indicating the exact position within the Address Field.
-
AddressFieldLocation
Construct a new default AddressFieldLocation for a given program address.- Parameters:
program- the program of the locationaddr- address of the location
-
AddressFieldLocation
public AddressFieldLocation()Default constructor needed for restoring an address field location from XML.
-
-
Method Details
-
getAddressRepresentation
Returns the standard string representation of the address in the address field. If there is no address, then null should be returned. -
toString
Returns a String representation of this location.- Overrides:
toStringin classProgramLocation
-
hashCode
public int hashCode()- Overrides:
hashCodein classProgramLocation
-
equals
- Overrides:
equalsin classProgramLocation
-
saveState
Description copied from class:ProgramLocationSave this program location to the given save state object.- Overrides:
saveStatein classProgramLocation- Parameters:
obj- the save state object for saving the location
-
restoreState
Description copied from class:ProgramLocationRestore this program location using the given program and save state object.- Overrides:
restoreStatein classProgramLocation- Parameters:
restoreProgram- program to restore fromobj- the save state to restore from
-