Package ghidra.app.util.bin.format.dwarf
Class DWARFLocationList
java.lang.Object
ghidra.app.util.bin.format.dwarf.DWARFLocationList
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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetLocationContaining
(long pc) Get the location that corresponds to the specified PC location.boolean
isEmpty()
static DWARFLocationList
readV4
(BinaryReader reader, DWARFCompilationUnit cu) Read a v4DWARFLocationList
from the debug_loc section.static DWARFLocationList
readV5
(BinaryReader reader, DWARFCompilationUnit cu) Reads a v5DWARFLocationList
from the debug_loclists stream.toString()
static DWARFLocationList
withWildcardRange
(byte[] expr) Creates a simple location list containing a single wildcarded range and the specified expression bytes.
-
Field Details
-
EMPTY
-
-
Constructor Details
-
DWARFLocationList
-
-
Method Details
-
withWildcardRange
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 v4DWARFLocationList
from the debug_loc section.- Parameters:
reader
- stream positioned at the start of a .debug_loc location listcu
- 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 v5DWARFLocationList
from the debug_loclists stream.- Parameters:
reader
- stream positioned at the start of a .debug_loclists location listcu
- 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
Get the location that corresponds to the specified PC location.- Parameters:
pc
- programcounter address- Returns:
- the byte array corresponding to the location expression
-
getFirstLocation
-
toString
-