Class ExternalDebugInfo
- java.lang.Object
-
- ghidra.app.util.bin.format.dwarf4.external.ExternalDebugInfo
-
public class ExternalDebugInfo extends java.lang.Object
Metadata 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 anExternalDebugInfo
instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ExternalDebugInfo
fromProgram(Program program)
Create a newExternalDebugInfo
from information found in the specified program.int
getCrc()
Return the crc of the external debug file.java.lang.String
getFilename()
Return the filename of the external debug file, or null if not specified.byte[]
getHash()
Return the build-id hash digest.boolean
hasFilename()
Return true if there is a filenamejava.lang.String
toString()
-
-
-
Constructor Detail
-
ExternalDebugInfo
public ExternalDebugInfo(java.lang.String filename, int crc, byte[] hash)
Constructor to create anExternalDebugInfo
instance.- 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 newExternalDebugInfo
from information found in the specified program.- Parameters:
program
-Program
to query- Returns:
- new
ExternalDebugInfo
or 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:
toString
in classjava.lang.Object
-
-