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 Details

  • Constructor Details

  • 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