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

# Class DWARFLocationList

java.lang.Object
ghidra.app.util.bin.format.dwarf.DWARFLocationList

public class DWARFLocationList extends Object
A collection of `DWARFLocation` elements, each which represents a location of an item that is only valid for a certain range of program-counter locations.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final DWARFLocationList`
  `EMPTY`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DWARFLocationList(List<DWARFLocation> list)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `DWARFLocation`
  `getFirstLocation()`
  `DWARFLocation`
  `getLocationContaining(long pc)`
  Get the location that corresponds to the specified PC location.
  `boolean`
  `isEmpty()`
  `static DWARFLocationList`
  `readV4(BinaryReader reader, DWARFCompilationUnit cu)`
  Read a v4 `DWARFLocationList` from the debug_loc section.
  `static DWARFLocationList`
  `readV5(BinaryReader reader, DWARFCompilationUnit cu)`
  Reads a v5 `DWARFLocationList` from the debug_loclists stream.
  `String`
  `toString()`
  `static DWARFLocationList`
  `withWildcardRange(byte[] expr)`
  Creates a simple location list containing a single wildcarded range and the specified expression bytes.

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

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

- ## Field Details

  - ### EMPTY

    public static final DWARFLocationList EMPTY

- ## Constructor Details

  - ### DWARFLocationList

    public DWARFLocationList(List<DWARFLocation> list)

- ## Method Details

  - ### withWildcardRange

    public static DWARFLocationList withWildcardRange(byte[] expr)
    Creates a simple location list containing a single wildcarded range and the specified expression bytes.
    Parameters:
      `expr` - `DWARFExpression` bytes
    Returns:
      new `DWARFLocationList` containing a single wildcarded range

  - ### readV4

    public static DWARFLocationList readV4(BinaryReader reader, DWARFCompilationUnit cu) throws IOException
    Read a v4 `DWARFLocationList` from the debug_loc section.
    Parameters:
      `reader` - stream positioned at the start of a .debug_loc location list
      `cu` - the compUnit that refers to the location list
    Returns:
      list of DWARF locations (address range and location expression)
    Throws:
      `IOException` - if an I/O error occurs

  - ### readV5

    public static DWARFLocationList readV5(BinaryReader reader, DWARFCompilationUnit cu) throws IOException
    Reads a v5 `DWARFLocationList` from the debug_loclists stream.
    Parameters:
      `reader` - stream positioned at the start of a .debug_loclists location list
      `cu` - the compUnit that refers to the location list
    Returns:
      list of DWARF locations (address range and location expression)
    Throws:
      `IOException` - if an I/O error occurs

  - ### isEmpty

    public boolean isEmpty()

  - ### getLocationContaining

    public DWARFLocation getLocationContaining(long pc)
    Get the location that corresponds to the specified PC location.
    Parameters:
      `pc` - programcounter address
    Returns:
      the byte array corresponding to the location expression

  - ### getFirstLocation

    public DWARFLocation getFirstLocation()

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`