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
ConstructorDescriptionDefault 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 TypeMethodDescriptionboolean
Returns the standard string representation of the address in the address field.int
hashCode()
void
restoreState
(Program restoreProgram, SaveState obj) Restore this program location using the given program and save state object.void
Save 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
isValid
Methods 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:
toString
in classProgramLocation
-
hashCode
public int hashCode()- Overrides:
hashCode
in classProgramLocation
-
equals
- Overrides:
equals
in classProgramLocation
-
saveState
Description copied from class:ProgramLocation
Save this program location to the given save state object.- Overrides:
saveState
in classProgramLocation
- Parameters:
obj
- the save state object for saving the location
-
restoreState
Description copied from class:ProgramLocation
Restore this program location using the given program and save state object.- Overrides:
restoreState
in classProgramLocation
- Parameters:
restoreProgram
- program to restore fromobj
- the save state to restore from
-