Package ghidra.program.util
Class FunctionLocation
- java.lang.Object
-
- ghidra.program.util.ProgramLocation
-
- ghidra.program.util.FunctionLocation
-
- All Implemented Interfaces:
java.lang.Comparable<ProgramLocation>
- Direct Known Subclasses:
FunctionCallFixupFieldLocation
,FunctionRepeatableCommentFieldLocation
,FunctionSignatureFieldLocation
,FunctionSignatureSourceFieldLocation
,FunctionTagFieldLocation
,ThunkedFunctionFieldLocation
,VariableLocation
public class FunctionLocation extends ProgramLocation
FunctionLocation
provides information about the location in a program within aFunction
.
-
-
Field Summary
Fields Modifier and Type Field Description protected Address
functionAddr
-
Fields inherited from class ghidra.program.util.ProgramLocation
addr, program, refAddr
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
FunctionLocation()
Default constructor needed for restoring a program function location from XMLprotected
FunctionLocation(Program program, Address locationAddr, Address functionAddr, int row, int col, int charOffset)
Create a new FunctionLocation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
Address
getFunctionAddress()
Return the Function symbol address which may differ from the "location address" when a function is indirectly inferred via a reference.boolean
isValid(Program p)
Returns true if this location represents a valid location in the given programvoid
restoreState(Program program1, SaveState obj)
Restore this function location using the given program and save state object.void
saveState(SaveState obj)
Save this function location to the given save state object.java.lang.String
toString()
-
Methods inherited from class ghidra.program.util.ProgramLocation
compareAddr, compareTo, getAddress, getByteAddress, getCharOffset, getColumn, getComponentPath, getLocation, getProgram, getRefAddress, getRow, hashCode
-
-
-
-
Field Detail
-
functionAddr
protected Address functionAddr
-
-
Constructor Detail
-
FunctionLocation
protected FunctionLocation(Program program, Address locationAddr, Address functionAddr, int row, int col, int charOffset)
Create a new FunctionLocation.- Parameters:
the
- program of the locationlocationAddr
- the address of the listing location (i.e., referent code unit)functionAddr
- the function addressrow
- the row in the fieldcol
- the display piece on the rowcharOffset
- the character position within the display piece specifed by row,col
-
FunctionLocation
protected FunctionLocation()
Default constructor needed for restoring a program function location from XML
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classProgramLocation
- See Also:
Object.equals(java.lang.Object)
-
getFunctionAddress
public Address getFunctionAddress()
Return the Function symbol address which may differ from the "location address" when a function is indirectly inferred via a reference. WARNING: TheProgramLocation.getAddress()
should not be used to obtain the function address!- Returns:
- the function address corresponding to this program location
-
saveState
public void saveState(SaveState obj)
Save this function location to the given save state object.- Overrides:
saveState
in classProgramLocation
- Parameters:
obj
- the save state object for saving the locationprefix
- prefix appended to the names of the save state items to make the entry unique
-
restoreState
public void restoreState(Program program1, SaveState obj)
Restore this function location using the given program and save state object.- Overrides:
restoreState
in classProgramLocation
- Parameters:
prefix
- prefix appended to the names of the save state items to make the entry unique
-
isValid
public boolean isValid(Program p)
Description copied from class:ProgramLocation
Returns true if this location represents a valid location in the given program- Overrides:
isValid
in classProgramLocation
- Parameters:
p
- the program to test if this location is valid.- Returns:
- true if this location represents a valid location in the given program
-
toString
public java.lang.String toString()
- Overrides:
toString
in classProgramLocation
-
-