Class LocalDirectorySearchLocation
- java.lang.Object
-
- ghidra.app.util.bin.format.dwarf4.external.LocalDirectorySearchLocation
-
- All Implemented Interfaces:
SearchLocation
public class LocalDirectorySearchLocation extends java.lang.Object implements SearchLocation
ASearchLocationthat recursively searches for dwarf external debug files under a configured directory.
-
-
Constructor Summary
Constructors Constructor Description LocalDirectorySearchLocation(java.io.File searchDir)Creates a newLocalDirectorySearchLocationat the specified location.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static intcalcCRC(java.io.File f)Calculates the crc32 for the specified file.static LocalDirectorySearchLocationcreate(java.lang.String locString, SearchLocationCreatorContext context)Creates a newLocalDirectorySearchLocationinstance using the specified location string.FSRLfindDebugFile(ExternalDebugInfo debugInfo, TaskMonitor monitor)Searchs for a debug file that fulfills the criteria specified in theExternalDebugInfo.java.lang.StringgetDescriptiveName()Returns a human formatted string describing this location, used in UI prompts or lists.java.lang.StringgetName()Returns the name of this instance, which should be a serialized copy of this instance.static booleanisLocalDirSearchLoc(java.lang.String locString)Returns true if the specified location string specifies a LocalDirectorySearchLocation.
-
-
-
Constructor Detail
-
LocalDirectorySearchLocation
public LocalDirectorySearchLocation(java.io.File searchDir)
Creates a newLocalDirectorySearchLocationat the specified location.- Parameters:
searchDir- path to the root directory of where to search
-
-
Method Detail
-
isLocalDirSearchLoc
public static boolean isLocalDirSearchLoc(java.lang.String locString)
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(java.lang.String locString, SearchLocationCreatorContext context)
Creates a newLocalDirectorySearchLocationinstance using the specified location string.- Parameters:
locString- string, earlier returned fromgetName()context-SearchLocationCreatorContextto allow accessing information outside of the location string that might be needed to create a new instance- Returns:
- new
LocalDirectorySearchLocationinstance
-
getName
public java.lang.String getName()
Description copied from interface:SearchLocationReturns the name of this instance, which should be a serialized copy of this instance.- Specified by:
getNamein interfaceSearchLocation- Returns:
- String serialized data of this instance, typically in "something://serialized_data" form
-
getDescriptiveName
public java.lang.String getDescriptiveName()
Description copied from interface:SearchLocationReturns a human formatted string describing this location, used in UI prompts or lists.- Specified by:
getDescriptiveNamein interfaceSearchLocation- Returns:
- formatted string
-
findDebugFile
public FSRL findDebugFile(ExternalDebugInfo debugInfo, TaskMonitor monitor) throws CancelledException, java.io.IOException
Description copied from interface:SearchLocationSearchs for a debug file that fulfills the criteria specified in theExternalDebugInfo.- Specified by:
findDebugFilein interfaceSearchLocation- Parameters:
debugInfo- search criteriamonitor-TaskMonitor- Returns:
FSRLof the matching file, ornullif not found- Throws:
CancelledException- if cancelledjava.io.IOException- if error
-
calcCRC
public static int calcCRC(java.io.File f) throws java.io.IOExceptionCalculates the crc32 for the specified file.- Parameters:
f-Fileto read- Returns:
- int crc32
- Throws:
java.io.IOException- if error reading file
-
-