pub struct Unit {
pub line_program: LineProgram,
pub ranges: RangeListTable,
pub locations: LocationListTable,
/* private fields */
}Expand description
A unit’s debugging information.
Fields§
§line_program: LineProgramThe line number program for this unit.
ranges: RangeListTableA table of range lists used by this unit.
locations: LocationListTableA table of location lists used by this unit.
Implementations§
Source§impl Unit
impl Unit
Sourcepub fn new(encoding: Encoding, line_program: LineProgram) -> Self
pub fn new(encoding: Encoding, line_program: LineProgram) -> Self
Create a new Unit.
Sourcepub fn set_encoding(&mut self, encoding: Encoding)
pub fn set_encoding(&mut self, encoding: Encoding)
Set the encoding parameters for this unit.
Sourcepub fn address_size(&self) -> u8
pub fn address_size(&self) -> u8
Return the address size in bytes for this unit.
Sourcepub fn count(&self) -> usize
pub fn count(&self) -> usize
Return the number of DebuggingInformationEntrys created for this unit.
This includes entries that no longer have a parent.
Sourcepub fn root(&self) -> UnitEntryId
pub fn root(&self) -> UnitEntryId
Return the id of the root entry.
Sourcepub fn reserve(&mut self) -> UnitEntryId
pub fn reserve(&mut self) -> UnitEntryId
Reserve a DebuggingInformationEntry in this unit and return its id.
This method is useful when you need an id to construct a DebugInfoRef
before the DIE has been added to the unit.
If the id is used in a reference, it must later be passed to
Self::add_reserved. Until then, the ID must not be used with any other
methods of this unit.
It is valid to reserve an id but never use or add it.
Sourcepub fn add_reserved(
&mut self,
child: UnitEntryId,
parent: UnitEntryId,
tag: DwTag,
)
pub fn add_reserved( &mut self, child: UnitEntryId, parent: UnitEntryId, tag: DwTag, )
Set the parent and tag of a previously reserved DebuggingInformationEntry.
The parent must be within the same unit.
§Panics
Panics if child or parent is invalid, or if child is not a reserved entry.
Sourcepub fn add(&mut self, parent: UnitEntryId, tag: DwTag) -> UnitEntryId
pub fn add(&mut self, parent: UnitEntryId, tag: DwTag) -> UnitEntryId
Add a new DebuggingInformationEntry to this unit and return its id.
The parent must be within the same unit.
§Panics
Panics if parent is invalid.