Package ghidra.app.util.bin.format.dwarf.sectionprovider

# Class BaseSectionProvider

java.lang.Object
ghidra.app.util.bin.format.dwarf.sectionprovider.BaseSectionProvider

All Implemented Interfaces:
  `DWARFSectionProvider`, `Closeable`, `AutoCloseable`

Direct Known Subclasses:
  `ExternalDebugFileSectionProvider`

public class BaseSectionProvider extends Object implements DWARFSectionProvider
Fetches DWARF sections from a normal program using simple Ghidra memory blocks.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected Program`
  `program`
  `protected List<String>`
  `sectionPrefixes`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `BaseSectionProvider(Program program)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `close()`
  `static BaseSectionProvider`
  `createSectionProviderFor(Program program, TaskMonitor monitor)`
  `protected MemoryBlock`
  `getSection(String sectionName)`
  `ByteProvider`
  `getSectionAsByteProvider(String sectionName, TaskMonitor monitor)`
  Returns a ByteProvider for the specified section.
  `protected List<String>`
  `getSectionPrefixSearchList()`
  `boolean`
  `hasSection(String... sectionNames)`
  Returns true if the specified section names are present.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface ghidra.app.util.bin.format.dwarf.sectionprovider.DWARFSectionProvider

  `updateProgramInfo`

- ## Field Details

  - ### program

    protected Program program

  - ### sectionPrefixes

    protected List<String> sectionPrefixes

- ## Constructor Details

  - ### BaseSectionProvider

    public BaseSectionProvider(Program program)

- ## Method Details

  - ### createSectionProviderFor

    public static BaseSectionProvider createSectionProviderFor(Program program, TaskMonitor monitor)

  - ### getSectionPrefixSearchList

    protected List<String> getSectionPrefixSearchList()

  - ### getSectionAsByteProvider

    public ByteProvider getSectionAsByteProvider(String sectionName, TaskMonitor monitor) throws IOException
    Description copied from interface: `DWARFSectionProvider`
    Returns a ByteProvider for the specified section.
    Specified by:
      `getSectionAsByteProvider` in interface `DWARFSectionProvider`
    Parameters:
      `sectionName` - name of the section
      `monitor` - `TaskMonitor` to use when performing long operations
    Returns:
      ByteProvider, which will be closed by the section provider when itself is closed
    Throws:
      `IOException` - if error

  - ### hasSection

    public boolean hasSection(String... sectionNames)
    Description copied from interface: `DWARFSectionProvider`
    Returns true if the specified section names are present.
    Specified by:
      `hasSection` in interface `DWARFSectionProvider`
    Parameters:
      `sectionNames` - list of section names to test
    Returns:
      true if all are present, false if not present

  - ### getSection

    protected MemoryBlock getSection(String sectionName)

  - ### close

    public void close()
    Specified by:
      `close` in interface `AutoCloseable`
    Specified by:
      `close` in interface `Closeable`
    Specified by:
      `close` in interface `DWARFSectionProvider`