Package ghidra.program.util
Class LabelFieldLocation
- java.lang.Object
-
- ghidra.program.util.ProgramLocation
-
- ghidra.program.util.CodeUnitLocation
-
- ghidra.program.util.LabelFieldLocation
-
- All Implemented Interfaces:
java.lang.Comparable<ProgramLocation>
public class LabelFieldLocation extends CodeUnitLocation
TheLableFieldLocationclass contains specific location information within the LABEL field of a CodeUnitLocation object.
-
-
Field Summary
-
Fields inherited from class ghidra.program.util.ProgramLocation
addr, program, refAddr
-
-
Constructor Summary
Constructors Constructor Description LabelFieldLocation()Default constructor needed for restoring a label field location from XMLLabelFieldLocation(Program program, Address addr, int[] componentPath, java.lang.String label, Namespace namespace, int row, int charOffset)Construct a new LabelFieldLocation.LabelFieldLocation(Program program, Address addr, java.lang.String label)Construct a new LabelFieldLocation where the namespace is global, primary is false, and the cursor location is at row 0, column 0;LabelFieldLocation(Program program, Address addr, java.lang.String label, Namespace namespace, int row)Construct a new LabelFieldLocation.LabelFieldLocation(Symbol s)Creates a label field location using the specified symbol and an index of 0.LabelFieldLocation(Symbol s, int row, int charOffset)Creates a label field location using the specified symbol and the specified field index.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)java.lang.StringgetName()Return the label string at this location.SymbolgetSymbol()Returns the symbol at this LabelFieldLocation NOTE: currently a null symbol will be returned for default thunk functionsSymbolPathgetSymbolPath()Returns the symbol path which corresponds to the label locationinthashCode()voidrestoreState(Program p, SaveState obj)Restore this program location using the given program and save state object.voidsaveState(SaveState obj)Save this program location to the given save state object.java.lang.StringtoString()Returns a String representation of this location.-
Methods inherited from class ghidra.program.util.CodeUnitLocation
isValid
-
Methods inherited from class ghidra.program.util.ProgramLocation
compareAddr, compareTo, getAddress, getByteAddress, getCharOffset, getColumn, getComponentPath, getLocation, getProgram, getRefAddress, getRow
-
-
-
-
Constructor Detail
-
LabelFieldLocation
public LabelFieldLocation()
Default constructor needed for restoring a label field location from XML
-
LabelFieldLocation
public LabelFieldLocation(Program program, Address addr, int[] componentPath, java.lang.String label, Namespace namespace, int row, int charOffset)
Construct a new LabelFieldLocation.- Parameters:
the- program of the locationaddr- address of the location; should not be nullcomponentPath- array of indexes for each nested data component; the index is the data component's index within its parent; may be nulllabel- the label String at this location.row- the row in list of labels as displayed by the label field. Only used for program location comparison purposes.charOffset- the column position within the label string for this location.
-
LabelFieldLocation
public LabelFieldLocation(Program program, Address addr, java.lang.String label)
Construct a new LabelFieldLocation where the namespace is global, primary is false, and the cursor location is at row 0, column 0;- Parameters:
program- the program of the location.addr- the address of the location.label- the name of the symbol for this label location.
-
LabelFieldLocation
public LabelFieldLocation(Program program, Address addr, java.lang.String label, Namespace namespace, int row)
Construct a new LabelFieldLocation.- Parameters:
program- the program of the location.addr- address of the location; should not be nulllabel- the label String at this location.namespace- the namespace for the label. Null will default to the global namespace.row- the row in list of labels as displayed by the label field. Only used for program location comparison purposes.
-
LabelFieldLocation
public LabelFieldLocation(Symbol s)
Creates a label field location using the specified symbol and an index of 0.- Parameters:
s- the symbol to use when creating the location
-
LabelFieldLocation
public LabelFieldLocation(Symbol s, int row, int charOffset)
Creates a label field location using the specified symbol and the specified field index.- Parameters:
s- the symbol to use when creating the locationrow- the row of the symbol.charOffset- the position within the label string for this location
-
-
Method Detail
-
getName
public java.lang.String getName()
Return the label string at this location.
-
getSymbol
public Symbol getSymbol()
Returns the symbol at this LabelFieldLocation NOTE: currently a null symbol will be returned for default thunk functions- Returns:
- the symbol at this LabelFieldLocation or null if symbol lookup fails
-
getSymbolPath
public SymbolPath getSymbolPath()
Returns the symbol path which corresponds to the label location- Returns:
- symbol path
-
toString
public java.lang.String toString()
Returns a String representation of this location.- Overrides:
toStringin classProgramLocation
-
hashCode
public int hashCode()
- Overrides:
hashCodein classProgramLocation
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classProgramLocation
-
saveState
public void saveState(SaveState obj)
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
public void restoreState(Program p, SaveState obj)
Description copied from class:ProgramLocationRestore this program location using the given program and save state object.- Overrides:
restoreStatein classProgramLocation
-
-