Package ghidra.app.util.bin.format.dwarf
Class DWARFUnitHeader
java.lang.Object
ghidra.app.util.bin.format.dwarf.DWARFUnitHeader
- Direct Known Subclasses:
DWARFCompilationUnit
The base class for a set of headers that share a common field layout.
-
Field Summary
FieldsChangeModifier and TypeFieldDescriptionNEWprotected final DIEContainerprotected final DWARFProgramReference to the owningDWARFProgram.protected final shortVersion number, as read from the header.protected final longOffset in the section of the end of this header.protected final intsize of integers, 4=int32 or 8=int64protected final longOffset in the section of this headerprotected final intSequential number of this unit -
Constructor Summary
ConstructorsChangeModifierConstructorDescriptionprotectedDWARFUnitHeader(DIEContainer dieContainer, long startOffset, long endOffset, int intSize, short version, int unitNumber) protectedDWARFUnitHeader(DWARFUnitHeader other) -
Method Summary
ChangeModifier and TypeMethodDescriptionNEWshortlongReturns the byte offset to the end of this unit.intReturns either 4 (for DWARF_32) or 8 (for DWARF_64) depending on the current unit formatlongReturns the byte offset to the start of this unit.intReturn the ordinal number of this unitNEWstatic DWARFUnitHeaderread(DIEContainer dieContainer, BinaryReader reader, int unitNumber) Reads the initial fields found in a unit header.REMOVEDDWARFUnitHeaderread(DWARFProgram dprog, BinaryReader reader, BinaryReader abbrReader, int unitNumber, TaskMonitor monitor) Removed
-
Field Details
-
dprog
Reference to the owningDWARFProgram. -
dieContainer NEW
-
startOffset
protected final long startOffsetOffset in the section of this header -
endOffset
protected final long endOffsetOffset in the section of the end of this header. (exclusive) -
intSize
protected final int intSizesize of integers, 4=int32 or 8=int64 -
dwarfVersion
protected final short dwarfVersionVersion number, as read from the header. Note: Some header types use version numbers that do not match the general dwarfVersion. -
unitNumber
protected final int unitNumberSequential number of this unit
-
-
Constructor Details
-
DWARFUnitHeader
-
DWARFUnitHeader
protected DWARFUnitHeader(DIEContainer dieContainer, long startOffset, long endOffset, int intSize, short version, int unitNumber)
-
-
Method Details
-
read NEW
public static DWARFUnitHeader read(DIEContainer dieContainer, BinaryReader reader, int unitNumber) throws DWARFException, IOException Reads the initial fields found in a unit header.- Parameters:
dieContainer-DIEContainerreader-BinaryReaderstreamunitNumber- ordinal of this item- Returns:
- a unit header (only comp units for now), or null if at end-of-list
- Throws:
DWARFException- if invalid dwarf dataIOException- if error reading data
-
getProgram
-
getDIEContainer NEW
-
getDWARFVersion
public short getDWARFVersion() -
getStartOffset
public long getStartOffset()Returns the byte offset to the start of this unit.- Returns:
- the byte offset to the start of this unit
-
getEndOffset
public long getEndOffset()Returns the byte offset to the end of this unit.- Returns:
- the byte offset to the end of this unit
-
getIntSize
public int getIntSize()Returns either 4 (for DWARF_32) or 8 (for DWARF_64) depending on the current unit format- Returns:
- size of ints in this unit (4 or 8)
-
getUnitNumber
public int getUnitNumber()Return the ordinal number of this unit- Returns:
- ordinal of this unit
-