Class ExternalDebugFilesService
java.lang.Object
ghidra.app.util.bin.format.dwarf.external.ExternalDebugFilesService
A collection of
providers that can be queried to find a
DWARF external debug file. Typically this will be an ELF binary that contains the debug
information that was stripped from the original ELF binary, but can also include ability
to fetch original binaries as well as source files.-
Constructor Summary
ConstructorsConstructorDescriptionExternalDebugFilesService(DebugFileStorage storage, List<DebugInfoProvider> providers) Creates a new instance using aDebugFileStorage, and a list of providers. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddProvider(DebugInfoProvider provider) Adds aDebugInfoProvideras a location to search.find(ExternalDebugInfo debugInfo, TaskMonitor monitor) Searches for the specified external debug file.static ExternalDebugFilesServiceforProgram(Program program) Get a new instance ofExternalDebugFilesServiceusing the previously saved information (viasaveToPrefs(ExternalDebugFilesService)), for the specified program.static ExternalDebugFilesServicefromPrefs(DebugInfoProviderCreatorContext context) Get a new instance ofExternalDebugFilesServiceusing the previously saved information (viasaveToPrefs(ExternalDebugFilesService)).static ExternalDebugFilesServiceReturns an ExternalDebugFilesService instance with default search locations.static ExternalDebugFilesServiceReturns an ExternalDebugFilesService instance with no additional search locations.Returns the configured providers.static voidsaveToPrefs(ExternalDebugFilesService service) Serializes anExternalDebugFilesServiceto a string and writes to the Ghidra global preferences.
-
Constructor Details
-
ExternalDebugFilesService
Creates a new instance using aDebugFileStorage, and a list of providers.- Parameters:
storage-DebugFileStorageproviders- list ofprovidersto search
-
-
Method Details
-
getStorage
-
getProviders
Returns the configured providers.- Returns:
- list of providers
-
addProvider
Adds aDebugInfoProvideras a location to search.- Parameters:
provider-DebugInfoProviderto add
-
find
Searches for the specified external debug file.- Parameters:
debugInfo- information about the external debug filemonitor-TaskMonitor- Returns:
- found file, or
nullif not found - Throws:
IOException- if error
-
getMinimal
Returns an ExternalDebugFilesService instance with no additional search locations.- Returns:
- an ExternalDebugFilesService instance with no additional search locations
-
getDefault
Returns an ExternalDebugFilesService instance with default search locations.- Returns:
- an ExternalDebugFilesService instance with default search locations
-
forProgram
Get a new instance ofExternalDebugFilesServiceusing the previously saved information (viasaveToPrefs(ExternalDebugFilesService)), for the specified program.- Parameters:
program-Program- Returns:
- new
ExternalDebugFilesServiceinstance
-
fromPrefs
Get a new instance ofExternalDebugFilesServiceusing the previously saved information (viasaveToPrefs(ExternalDebugFilesService)).- Parameters:
context- created viaDebugInfoProviderRegistry.newContext(ghidra.program.model.listing.Program)- Returns:
- new
ExternalDebugFilesServiceinstance
-
saveToPrefs
Serializes anExternalDebugFilesServiceto a string and writes to the Ghidra global preferences.- Parameters:
service- theExternalDebugFilesServiceto commit to preferences
-