Class BuildIdSearchLocation
- java.lang.Object
-
- ghidra.app.util.bin.format.dwarf4.external.BuildIdSearchLocation
-
- All Implemented Interfaces:
SearchLocation
public class BuildIdSearchLocation extends java.lang.Object implements SearchLocation
ASearchLocation
that expects the external debug files to be named using the hexadecimal value of the hash of the file, and to be arranged in a bucketed directory hierarchy using the first 2 hexdigits of the hash.For example, the debug file with hash
6addc39dc19c1b45f9ba70baf7fd81ea6508ea7f
would be stored as "6a/ddc39dc19c1b45f9ba70baf7fd81ea6508ea7f.debug" (under some root directory).
-
-
Constructor Summary
Constructors Constructor Description BuildIdSearchLocation(java.io.File rootDir)
Creates a newBuildIdSearchLocation
at the specified location.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static BuildIdSearchLocation
create(java.lang.String locString, SearchLocationCreatorContext context)
Creates a newBuildIdSearchLocation
instance using the specified location string.FSRL
findDebugFile(ExternalDebugInfo debugInfo, TaskMonitor monitor)
Searchs for a debug file that fulfills the criteria specified in theExternalDebugInfo
.java.lang.String
getDescriptiveName()
Returns a human formatted string describing this location, used in UI prompts or lists.java.lang.String
getName()
Returns the name of this instance, which should be a serialized copy of this instance.static boolean
isBuildIdSearchLocation(java.lang.String locString)
Returns true if the specified location string specifies a BuildIdSearchLocation.
-
-
-
Constructor Detail
-
BuildIdSearchLocation
public BuildIdSearchLocation(java.io.File rootDir)
Creates a newBuildIdSearchLocation
at the specified location.- Parameters:
rootDir
- path to the root directory of the build-id directory (typically ends with "./build-id")
-
-
Method Detail
-
isBuildIdSearchLocation
public static boolean isBuildIdSearchLocation(java.lang.String locString)
Returns true if the specified location string specifies a BuildIdSearchLocation.- Parameters:
locString
- string to test- Returns:
- boolean true if locString specifies a BuildId location
-
create
public static BuildIdSearchLocation create(java.lang.String locString, SearchLocationCreatorContext context)
Creates a newBuildIdSearchLocation
instance using the specified location string.- Parameters:
locString
- string, earlier returned fromgetName()
context
-SearchLocationCreatorContext
to allow accessing information outside of the location string that might be needed to create a new instance- Returns:
- new
BuildIdSearchLocation
instance
-
getName
public java.lang.String getName()
Description copied from interface:SearchLocation
Returns the name of this instance, which should be a serialized copy of this instance.- Specified by:
getName
in interfaceSearchLocation
- Returns:
- String serialized data of this instance, typically in "something://serialized_data" form
-
getDescriptiveName
public java.lang.String getDescriptiveName()
Description copied from interface:SearchLocation
Returns a human formatted string describing this location, used in UI prompts or lists.- Specified by:
getDescriptiveName
in interfaceSearchLocation
- Returns:
- formatted string
-
findDebugFile
public FSRL findDebugFile(ExternalDebugInfo debugInfo, TaskMonitor monitor) throws java.io.IOException, CancelledException
Description copied from interface:SearchLocation
Searchs for a debug file that fulfills the criteria specified in theExternalDebugInfo
.- Specified by:
findDebugFile
in interfaceSearchLocation
- Parameters:
debugInfo
- search criteriamonitor
-TaskMonitor
- Returns:
FSRL
of the matching file, ornull
if not found- Throws:
java.io.IOException
- if errorCancelledException
- if cancelled
-
-