Class DisplayableEol

java.lang.Object
ghidra.app.util.DisplayableEol

public class DisplayableEol extends 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 Details

  • Constructor Details

    • DisplayableEol

      public DisplayableEol(CodeUnit cu, boolean alwaysShowRepeatable, boolean alwaysShowRefRepeats, boolean alwaysShowAutomatic, boolean operandsFollowPointerRefs, int maxDisplayLines, boolean useAbbreviatedAutomatic, boolean showAutomaticFunctions)
  • Method Details

    • hasEOL

      public boolean hasEOL()
      Return whether the associated code unit has an end of line comment
      Returns:
      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
      Returns:
      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
      Returns:
      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. For example, a memory reference from this code unit has a function defined at the reference's to address, or if the to address is a pointer.
      Returns:
      whether this code unit has an automatic comment
    • getComments

      public String[] getComments()
      Return all the comments
      Returns:
      the comments
    • getEOLComments

      public String[] getEOLComments()
      Gets the end of line comment as an array.
      Returns:
      the EOL comment
    • getRepeatableComments

      public 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 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 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 String[] getAutomaticComment()
      Gets the automatic comment as an array.
      Returns:
      the automatic comment
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • 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)