Class LocalDirDebugInfoDProvider

java.lang.Object
ghidra.app.util.bin.format.dwarf.external.LocalDirDebugInfoDProvider
All Implemented Interfaces:
DebugFileProvider, DebugFileStorage, DebugInfoProvider

public class LocalDirDebugInfoDProvider extends Object implements DebugFileStorage
Provides debug files found in a debuginfod-client compatible directory structure.

Provides ability to store files.

Does not try to follow debuginfod's file age-off logic or config values.

  • Field Details

  • Constructor Details

    • LocalDirDebugInfoDProvider

      public LocalDirDebugInfoDProvider(File rootDir)
    • LocalDirDebugInfoDProvider

      public LocalDirDebugInfoDProvider(File rootDir, String name, String descriptiveName)
  • Method Details

    • matches

      public static boolean matches(String name)
      Returns true if the specified name string specifies a LocalDirDebugInfoDProvider.
      Parameters:
      name - string to test
      Returns:
      boolean true if name specifies a LocalDirDebugInfoDProvider
    • create

      public static LocalDirDebugInfoDProvider create(String name, DebugInfoProviderCreatorContext context)
      Creates a new BuildIdDebugFileProvider instance using the specified name string.
      Parameters:
      name - string, earlier returned from getName()
      context - DebugInfoProviderCreatorContext to allow accessing information outside of the name string that might be needed to create a new instance
      Returns:
      new BuildIdDebugFileProvider instance
    • getUserHomeCacheInstance

      public static LocalDirDebugInfoDProvider getUserHomeCacheInstance()
      Returns a new LocalDirDebugInfoDProvider that stores files in the same directory that the debuginfod-find CLI tool would (/home/user/.cache/debuginfod_client/).
      Returns:
      a new LocalDirDebugInfoDProvider that stores files in the same directory that the debuginfod-find CLI tool would (/home/user/.cache/debuginfod_client/)
    • getGhidraCacheInstance

      public static LocalDirDebugInfoDProvider getGhidraCacheInstance()
      Returns a new LocalDirDebugInfoDProvider that stores files in a Ghidra specific cache directory.
      Returns:
      a new LocalDirDebugInfoDProvider that stores files in a Ghidra specific cache directory
    • getRootDir

      public File getRootDir()
    • getName

      public String getName()
      Description copied from interface: DebugInfoProvider
      Returns the name of this instance, which should be a serialized copy of this instance, typically like "something://serialized_data".
      Specified by:
      getName in interface DebugInfoProvider
      Returns:
      the name of this instance, which should be a serialized copy of this instance, typically like "something://serialized_data"
    • getDescriptiveName

      public String getDescriptiveName()
      Description copied from interface: DebugInfoProvider
      Returns a human formatted string describing this provider, used in UI prompts or lists.
      Specified by:
      getDescriptiveName in interface DebugInfoProvider
      Returns:
      a human formatted string describing this provider, used in UI prompts or lists
    • getStatus

      public DebugInfoProviderStatus getStatus(TaskMonitor monitor)
      Description copied from interface: DebugInfoProvider
      Returns DebugInfoProviderStatus representing this provider's current status.
      Specified by:
      getStatus in interface DebugInfoProvider
      Parameters:
      monitor - TaskMonitor
      Returns:
      DebugInfoProviderStatus representing this provider's current status
    • getDirectory

      public File getDirectory()
    • setNeedsMaintCheck

      public void setNeedsMaintCheck(boolean needsInitMaintCheck)
    • getFile

      public File getFile(ExternalDebugInfo debugInfo, TaskMonitor monitor) throws IOException, CancelledException
      Description copied from interface: DebugFileProvider
      Searches for a debug file that fulfills the criteria specified in the ExternalDebugInfo.
      Specified by:
      getFile in interface DebugFileProvider
      Parameters:
      debugInfo - search criteria
      monitor - TaskMonitor
      Returns:
      File of the matching file, or null if not found
      Throws:
      IOException - if error
      CancelledException - if cancelled
    • putStream

      Specified by:
      putStream in interface DebugFileStorage
      Throws:
      IOException
      CancelledException
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • purgeAll

      public void purgeAll()
    • performInitMaintIfNeeded

      public void performInitMaintIfNeeded()
    • performCacheMaintIfNeeded

      public void performCacheMaintIfNeeded()