Class ExternalDebugInfo
java.lang.Object
ghidra.app.util.bin.format.dwarf.external.ExternalDebugInfo
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
ConstructorsConstructorDescriptionExternalDebugInfo(String filename, int crc, String buildId, ObjectType objectType, String extra) Constructor to create anExternalDebugInfoinstance. -
Method Summary
Modifier and TypeMethodDescriptionstatic ExternalDebugInfoforBuildId(String buildId) Returns a new ExternalDebugInfo instance created using the specified Build-Id value.static ExternalDebugInfoforDebugLink(String debugLinkFilename, int crc) Returns a new ExternalDebugInfo instance created using the specified debuglink values.static ExternalDebugInfofromProgram(Program program) Create a newExternalDebugInfofrom information found in the specified program.Return the build-id.intgetCrc()Return the crc of the external debug file.getExtra()Return the filename of the external debug file, or null if not specified.booleanReturns true if buildId is available, false if not.booleanReturn true if there is a filenametoString()withType(ObjectType newObjectType, String newExtra)
-
Constructor Details
-
ExternalDebugInfo
public ExternalDebugInfo(String filename, int crc, String buildId, ObjectType objectType, String extra) Constructor to create anExternalDebugInfoinstance.- Parameters:
filename- filename of external debug file, or nullcrc- crc32 of external debug file, or 0 if no filenamebuildId- build-id hash digest found in ".note.gnu.build-id" section, or null if not presentobjectType-ObjectTypespecifies what kind of debug file is specified by the other infoextra- additional information used byObjectType.SOURCE
-
-
Method Details
-
fromProgram
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
-
forBuildId
Returns a new ExternalDebugInfo instance created using the specified Build-Id value.- Parameters:
buildId- hex string- Returns:
- a new ExternalDebugInfo instance created using the specified Build-Id value
-
forDebugLink
Returns a new ExternalDebugInfo instance created using the specified debuglink values.- Parameters:
debugLinkFilename- filename from debuglink sectioncrc- crc32 from debuglink section- Returns:
- a new ExternalDebugInfo instance created using the specified debuglink values
-
hasDebugLink
public boolean hasDebugLink()Return true if there is a filename- Returns:
- boolean true if filename is available, false if not
-
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.
-
getBuildId
Return the build-id.- Returns:
- build-id hash string
-
hasBuildId
public boolean hasBuildId()Returns true if buildId is available, false if not.- Returns:
- true if buildId is available, false if not
-
getObjectType
-
getExtra
-
withType
-
toString
-