Package ghidra.program.util
Class CodeUnitLocation
java.lang.Object
ghidra.program.util.ProgramLocation
ghidra.program.util.CodeUnitLocation
- All Implemented Interfaces:
Cloneable
,Comparable<ProgramLocation>
- Direct Known Subclasses:
AddressFieldLocation
,BytesFieldLocation
,CommentFieldLocation
,FieldNameFieldLocation
,IndentFieldLocation
,LabelFieldLocation
,MnemonicFieldLocation
,OffsetFieldLocation
,OperandFieldLocation
,SpaceFieldLocation
,SpacerFieldLocation
,SubDataFieldLocation
,XRefFieldLocation
CodeUnitLocation
provides information about the location
in a program within a CodeUnit
.-
Field Summary
Fields inherited from class ghidra.program.util.ProgramLocation
addr, program, refAddr
-
Constructor Summary
ModifierConstructorDescriptionDefault constructor for a code unit location needed for restoring from XML.CodeUnitLocation
(Program program, Address addr, int[] componentPath, int row, int col, int charOffset) Create a newCodeUnitLocation
for the given address.protected
CodeUnitLocation
(Program program, Address addr, int[] componentPath, Address refAddr, int row, int col, int charOffset) CodeUnitLocation
(Program program, Address addr, int row, int col, int charOffset) Create a newCodeUnitLocation
for the given address.protected
CodeUnitLocation
(Program program, Address addr, Address byteAddr, int[] componentPath, int row, int col, int charOffset) Create a newCodeUnitLocation
using the given information -
Method Summary
Methods inherited from class ghidra.program.util.ProgramLocation
clone, compareAddr, compareTo, equals, getAddress, getByteAddress, getCharOffset, getColumn, getComponentPath, getLocation, getProgram, getRefAddress, getRow, getTranslatedCopy, hashCode, restoreState, saveState, toString
-
Constructor Details
-
CodeUnitLocation
public CodeUnitLocation(Program program, Address addr, int[] componentPath, int row, int col, int charOffset) Create a newCodeUnitLocation
for the given address. The address will be adjusted to the beginning of the code unit containing that address(if it exists). The original address can be retrieved using the "getByteAddress()" method.- Parameters:
program
- the program for obtaining the code unitaddr
- address of the location; should not be nullcomponentPath
- if this is not null it is the path to a data component inside of another data componentrow
- the row within the field.col
- - the display item index on the given row. (Note most fields only have one display item per row)charOffset
- - the character offset within the display item.
-
CodeUnitLocation
protected CodeUnitLocation(Program program, Address addr, Address byteAddr, int[] componentPath, int row, int col, int charOffset) Create a newCodeUnitLocation
using the given information- Parameters:
program
- the program for obtaining the code unitaddr
- address of the location; should be on a code unit boundary.byteAddr
- the address of specific byte within the code unit at the addr address.componentPath
- if this is not null it is the path to a data component inside of another data componentrow
- the row within the field.col
- - the display item index on the given row. (Note most fields only have one display item per row)charOffset
- - the character offset within the display item.
-
CodeUnitLocation
Create a newCodeUnitLocation
for the given address. The address will be adjusted to the beginning of the code unit containing that address(if it exists). The original address can be retrieved using the "getByteAddress()" method.- Parameters:
program
- the program for obtaining the code unitaddr
- address of the location; should not be nullrow
- the row within the field.col
- - the display item index on the given row. (Note most fields only have one display item per row)charOffset
- - the character offset within the display item.
-
CodeUnitLocation
-
CodeUnitLocation
public CodeUnitLocation()Default constructor for a code unit location needed for restoring from XML.
-
-
Method Details
-
isValid
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.
-