Class CodeUnitInfo

java.lang.Object
ghidra.app.util.CodeUnitInfo

public class CodeUnitInfo extends Object
Container object to keep a relative index, label, and comments. Used in a list for copying/pasting labels and comments from one program to another.
  • Constructor Details

    • CodeUnitInfo

      public CodeUnitInfo(int index)
      Constructor a new CodeUnitInfo.
      Parameters:
      index - relative index added to a base address for where this information will be placed
  • Method Details

    • setSymbols

      public void setSymbols(Symbol[] symbols)
      Set the symbols to be transferred.
    • setComment

      public void setComment(int commentType, String[] comment)
      Set the comment to be transferred.
      Parameters:
      commentType - CodeUnit.PRE_COMMENT, POST_COMMENT, PLATE_COMMENT, EOL_COMMENT, or REPEATABLE.
      comment - comment
    • setFunction

      public void setFunction(Function function)
      Set the function info.
      Parameters:
      function - function used to get function info to transfer
    • getIndex

      public int getIndex()
      Get the relative index for this CodeUnitInfo to add to a base address.
    • hasSymbols

      public boolean hasSymbols()
      Return whether this CodeUnitInfo has symbols to copy.
    • hasDynamicSymbol

      public boolean hasDynamicSymbol()
      Return whether this CodeUnitInfo has a dynamic symbol.
    • getPrimarySymbolName

      public String getPrimarySymbolName()
      Get the label; may be null.
    • getPrimarySymbolSource

      public SourceType getPrimarySymbolSource()
      Get the label source
    • isPrimarySymbolInFunctionScope

      public boolean isPrimarySymbolInFunctionScope()
      Is primary symbol in a function scope
    • getFunctionScopeSymbolNames

      public String[] getFunctionScopeSymbolNames()
      Get the names of the function scope symbols.
    • getFunctionScopeSymbolSources

      public SourceType[] getFunctionScopeSymbolSources()
      Get the sources of the function scope symbols.
    • getOtherSymbolNames

      public String[] getOtherSymbolNames()
      Get the names of the other symbols not in a function scope.
    • getOtherSymbolSources

      public SourceType[] getOtherSymbolSources()
      Get the sources of the other symbols not in a function scope.
    • getPlateComment

      public String[] getPlateComment()
      Get the plate comment.
    • getPreComment

      public String[] getPreComment()
      Get the pre comment.
    • getPostComment

      public String[] getPostComment()
      Get the post comment.
    • getEOLComment

      public String[] getEOLComment()
      Get the EOL comment.
    • getRepeatableComment

      public String[] getRepeatableComment()
      Get the repeatable comment.
    • getFunctionName

      public String getFunctionName()
      Get the function name.
    • getFunctionComments

      public String[] getFunctionComments()
      Get the function comments.
    • getStackVariableNames

      public String[] getStackVariableNames()
      Get the stack variable names.
    • getStackVariableSources

      public SourceType[] getStackVariableSources()
      Get the stack variable sources.
    • getStackOffsets

      public int[] getStackOffsets()
      Get the stack offsets.
    • getStackVarFirstUseOffsets

      public int[] getStackVarFirstUseOffsets()
      Get the stack variable "First Use Offsets"
    • getStackVariableComments

      public String[] getStackVariableComments()
      Get the stack variable comments.
    • getVariableNames

      public String[] getVariableNames()
      Get the non-stack variable names.
    • getVariableSources

      public SourceType[] getVariableSources()
      Get the non-stack variable sources.
    • getVarAddresses

      public Address[] getVarAddresses()
      Get the storage addresses corresponding to each non-stack variable.
    • getVarFirstUseOffsets

      public int[] getVarFirstUseOffsets()
      Get the non-stack variable "First Use Offsets"
    • getVariableComments

      public String[] getVariableComments()
      Get the non-stack variable comments.