Package ghidra.app.util
Class DisplayableEol
- java.lang.Object
-
- ghidra.app.util.DisplayableEol
-
public class DisplayableEol extends java.lang.Object
Utility class with methods to get comment information that can be displayed in the end of line comment field. A DisplayableEol is associated with a code unit. The DisplayableEol gets information for the EOL comment field, which can show the End of Line comment for the code unit, the Repeatable comment for the code unit, any repeatable comments for the code units that this code unit has references to, and possibly a comment indicating the data at a code unit that is referenced by this code unit.
-
-
Field Summary
Fields Modifier and Type Field Description static int
MY_AUTOMATIC
static int
MY_EOLS
static int
MY_REPEATABLES
static int
REF_REPEATABLES
-
Constructor Summary
Constructors Constructor Description DisplayableEol(CodeUnit cu, boolean alwaysShowRepeatable, boolean alwaysShowRefRepeats, boolean alwaysShowAutomatic, boolean operandsFollowPointerRefs, int maxDisplayLines, boolean useAbbreviatedAutomatic)
Construct a new DisplayableEol.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String[]
getAutomaticComment()
Gets the automatic comment as an array.int
getCommentLineCount(int subType)
java.lang.String[]
getComments()
Return all the comments (End of Line, Repeatable, Referenced Repeatables, and Referenced Data).java.lang.String[]
getEOLComments()
Gets the end of line comment as an array.ProgramLocation
getLocation(int eolRow, int eolColumn)
java.lang.String[]
getReferencedRepeatableComments()
RefRepeatComment
getReferencedRepeatableComments(int index)
Gets a referenced repeatable comment as a RefRepeatComment object.java.lang.String[]
getReferencedRepeatableComments(Address refAddress)
Gets a referenced repeatable comment as a RefRepeatComment object.int
getReferencedRepeatableCommentsCount()
Gets the number of repeatable comments at the "to reference"sint
getRefRepeatableCommentLineCount(Address refAddress)
java.lang.String[]
getRepeatableComments()
Gets the repeatable comment as an array.RowColLocation
getRowCol(CommentFieldLocation cloc)
boolean
hasAutomatic()
Return whether this code unit has an automatic comment.boolean
hasEOL()
Return whether the associated code unit has an end of line comment.boolean
hasReferencedRepeatable()
Return whether any memory reference from this code unit has a repeatable comment at the reference's to address.boolean
hasRepeatable()
Return whether the associated code unit has a repeatable comment.boolean
isRefRepeatRow(int eolRow)
-
-
-
Field Detail
-
MY_EOLS
public static final int MY_EOLS
- See Also:
- Constant Field Values
-
MY_REPEATABLES
public static final int MY_REPEATABLES
- See Also:
- Constant Field Values
-
REF_REPEATABLES
public static final int REF_REPEATABLES
- See Also:
- Constant Field Values
-
MY_AUTOMATIC
public static final int MY_AUTOMATIC
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DisplayableEol
public DisplayableEol(CodeUnit cu, boolean alwaysShowRepeatable, boolean alwaysShowRefRepeats, boolean alwaysShowAutomatic, boolean operandsFollowPointerRefs, int maxDisplayLines, boolean useAbbreviatedAutomatic)
Construct a new DisplayableEol.- Parameters:
cu
- code unit that may have end of line or repeatable comments.
-
-
Method Detail
-
hasEOL
public boolean hasEOL()
Return whether the associated code unit has an end of line comment.
-
hasRepeatable
public boolean hasRepeatable()
Return whether the associated code unit has a repeatable comment.
-
hasReferencedRepeatable
public boolean hasReferencedRepeatable()
Return whether any memory reference from this code unit has a repeatable comment at the reference's to address.
-
hasAutomatic
public boolean hasAutomatic()
Return whether this code unit has an automatic comment. (i.e. any memory reference from this code unit has a function defined at the reference's to address, or if the to address is a pointer.)
-
getComments
public java.lang.String[] getComments()
Return all the comments (End of Line, Repeatable, Referenced Repeatables, and Referenced Data).
-
getEOLComments
public java.lang.String[] getEOLComments()
Gets the end of line comment as an array.- Returns:
- the EOL comment
-
getRepeatableComments
public java.lang.String[] getRepeatableComments()
Gets the repeatable comment as an array.- Returns:
- the repeatable comment.
-
getReferencedRepeatableCommentsCount
public int getReferencedRepeatableCommentsCount()
Gets the number of repeatable comments at the "to reference"s- Returns:
- the number of reference repeatable comments
-
getReferencedRepeatableComments
public java.lang.String[] getReferencedRepeatableComments()
-
getReferencedRepeatableComments
public RefRepeatComment getReferencedRepeatableComments(int index)
Gets a referenced repeatable comment as a RefRepeatComment object.- Parameters:
index
- indicator of which referenced repeatable comment is desired. The value is 0 thru one less than the number of referenced repeatable comments.- Returns:
- the RefRepeatComment containing the referenced address and its referenced repeatable comment
-
getReferencedRepeatableComments
public java.lang.String[] getReferencedRepeatableComments(Address refAddress)
Gets a referenced repeatable comment as a RefRepeatComment object.- Parameters:
refAddress
- the reference address whose repeatable comment is desired. Note: there must be a reference from the address for this displayableEol to the refAddress.- Returns:
- the comment lines for the referenced address's repeatable comment or null.
-
getAutomaticComment
public java.lang.String[] getAutomaticComment()
Gets the automatic comment as an array.- Returns:
- the automatic comment
-
getCommentLineCount
public int getCommentLineCount(int subType)
-
getRefRepeatableCommentLineCount
public int getRefRepeatableCommentLineCount(Address refAddress)
-
getRowCol
public RowColLocation getRowCol(CommentFieldLocation cloc)
-
getLocation
public ProgramLocation getLocation(int eolRow, int eolColumn)
-
isRefRepeatRow
public boolean isRefRepeatRow(int eolRow)
-
-