Class ExternalDebugInfo
- java.lang.Object
-
- ghidra.app.util.bin.format.dwarf4.external.ExternalDebugInfo
-
public class ExternalDebugInfo extends java.lang.ObjectMetadata needed to find an ELF/DWARF external debug file, retrieved from an ELF binary's ".gnu_debuglink" section and/or ".note.gnu.build-id" section.The debuglink can provide a filename and crc of the external debug file, while the build-id can provide a hash that is converted to a filename that identifies the external debug file.
-
-
Constructor Summary
Constructors Constructor Description ExternalDebugInfo(java.lang.String filename, int crc, byte[] hash)Constructor to create anExternalDebugInfoinstance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ExternalDebugInfofromProgram(Program program)Create a newExternalDebugInfofrom information found in the specified program.intgetCrc()Return the crc of the external debug file.java.lang.StringgetFilename()Return the filename of the external debug file, or null if not specified.byte[]getHash()Return the build-id hash digest.booleanhasFilename()Return true if there is a filenamejava.lang.StringtoString()
-
-
-
Constructor Detail
-
ExternalDebugInfo
public ExternalDebugInfo(java.lang.String filename, int crc, byte[] hash)Constructor to create anExternalDebugInfoinstance.- Parameters:
filename- filename of external debug file, or nullcrc- crc32 of external debug file, or 0 if no filenamehash- build-id hash digest found in ".note.gnu.build-id" section, or null if not present
-
-
Method Detail
-
fromProgram
public static ExternalDebugInfo fromProgram(Program program)
Create a newExternalDebugInfofrom information found in the specified program.- Parameters:
program-Programto query- Returns:
- new
ExternalDebugInfoor null if no external debug metadata found in program
-
hasFilename
public boolean hasFilename()
Return true if there is a filename- Returns:
- boolean true if filename is available, false if not
-
getFilename
public java.lang.String getFilename()
Return the filename of the external debug file, or null if not specified.- Returns:
- String filename of external debug file, or null if not specified
-
getCrc
public int getCrc()
Return the crc of the external debug file. Not valid if filename is missing.- Returns:
- int crc32 of external debug file.
-
getHash
public byte[] getHash()
Return the build-id hash digest.- Returns:
- byte array containing the build-id hash (usually 20 bytes)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-