Class LocalDirectorySearchLocation
java.lang.Object
ghidra.app.util.bin.format.dwarf.external.LocalDirectorySearchLocation
- All Implemented Interfaces:
SearchLocation
A
SearchLocation
that recursively searches for dwarf external debug files
under a configured directory.-
Constructor Summary
ConstructorDescriptionLocalDirectorySearchLocation
(File searchDir) Creates a newLocalDirectorySearchLocation
at the specified location. -
Method Summary
Modifier and TypeMethodDescriptionstatic int
Calculates the crc32 for the specified file.static LocalDirectorySearchLocation
create
(String locString, SearchLocationCreatorContext context) Creates a newLocalDirectorySearchLocation
instance using the specified location string.findDebugFile
(ExternalDebugInfo debugInfo, TaskMonitor monitor) Searchs for a debug file that fulfills the criteria specified in theExternalDebugInfo
.Returns a human formatted string describing this location, used in UI prompts or lists.getName()
Returns the name of this instance, which should be a serialized copy of this instance.static boolean
isLocalDirSearchLoc
(String locString) Returns true if the specified location string specifies a LocalDirectorySearchLocation.
-
Constructor Details
-
LocalDirectorySearchLocation
Creates a newLocalDirectorySearchLocation
at the specified location.- Parameters:
searchDir
- path to the root directory of where to search
-
-
Method Details
-
isLocalDirSearchLoc
Returns true if the specified location string specifies a LocalDirectorySearchLocation.- Parameters:
locString
- string to test- Returns:
- boolean true if locString specifies a local dir search location
-
create
public static LocalDirectorySearchLocation create(String locString, SearchLocationCreatorContext context) Creates a newLocalDirectorySearchLocation
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
LocalDirectorySearchLocation
instance
-
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
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 CancelledException, IOException 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:
CancelledException
- if cancelledIOException
- if error
-
calcCRC
Calculates the crc32 for the specified file.- Parameters:
f
-File
to read- Returns:
- int crc32
- Throws:
IOException
- if error reading file
-