Class BuildIdDebugInfo

java.lang.Object
ghidra.app.util.bin.format.dwarf.external.BuildIdDebugInfo
All Implemented Interfaces:
ExternalDebugInfo

public class BuildIdDebugInfo extends Object implements ExternalDebugInfo
Represents ExternalDebugInfo found in a build-id property embedded in an ELF file.
  • Constructor Details

    • BuildIdDebugInfo

      public BuildIdDebugInfo(byte[] buildId)
      Creates a new BuildIdDebugInfo from the bytes of its hash digest
      Parameters:
      buildId - bytes of the hash digest
    • BuildIdDebugInfo

      public BuildIdDebugInfo(byte[] buildId, ObjectType objectType, String extra)
      Creates a new BuildIdDebugInfo from the bytes of its hash digest, a specifier for the type of the object being pointed to, and an optional path used ObjectType.SOURCE instances.
      Parameters:
      buildId - build-id hash digest found in ".note.gnu.build-id" section
      objectType - ObjectType specifies what kind of debug file is specified by the other info
      extra - additional information used by ObjectType.SOURCE
  • Method Details

    • fromProgram

      public static BuildIdDebugInfo fromProgram(Program program)
    • getBuildIdHexString

      public String getBuildIdHexString()
      Return the build-id.
      Returns:
      build-id hash string
    • getObjectType

      public ObjectType getObjectType()
      Returns ObjectType that this build-id specifier points to.
      Returns:
      ObjectType that this build-id specifier points to
    • getExtra

      public String getExtra()
      Returns extra info used by ObjectTypes that need it.
      Returns:
      extra info used by ObjectTypes that need it
    • withType

      public BuildIdDebugInfo withType(ObjectType newObjectType, String newExtra)
      Returns a new BuildIdDebugInfo instance, pointing to the same build-id hash but an alternate object associated with the base debug file.
      Parameters:
      newObjectType - the new ObjectType
      newExtra - extra information used by the ObjectType to find the target file
      Returns:
      a new BuildIdDebugInfo instance, pointing to the same build-id hash but an alternate object associated with the base debug file
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object