Struct gimli::write::Unit

source ·
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: LineProgram

The line number program for this unit.

§ranges: RangeListTable

A table of range lists used by this unit.

§locations: LocationListTable

A table of location lists used by this unit.

Implementations§

source§

impl Unit

source

pub fn new(encoding: Encoding, line_program: LineProgram) -> Self

Create a new Unit.

source

pub fn encoding(&self) -> Encoding

Return the encoding parameters for this unit.

source

pub fn version(&self) -> u16

Return the DWARF version for this unit.

source

pub fn address_size(&self) -> u8

Return the address size in bytes for this unit.

source

pub fn format(&self) -> Format

Return the DWARF format for this unit.

source

pub fn count(&self) -> usize

Return the number of DebuggingInformationEntrys created for this unit.

This includes entries that no longer have a parent.

source

pub fn root(&self) -> UnitEntryId

Return the id of the root entry.

source

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.

source

pub fn get(&self, id: UnitEntryId) -> &DebuggingInformationEntry

Get a reference to an entry.

§Panics

Panics if id is invalid.

source

pub fn get_mut(&mut self, id: UnitEntryId) -> &mut DebuggingInformationEntry

Get a mutable reference to an entry.

§Panics

Panics if id is invalid.

Trait Implementations§

source§

impl Debug for Unit

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Unit

§

impl RefUnwindSafe for Unit

§

impl Send for Unit

§

impl Sync for Unit

§

impl Unpin for Unit

§

impl UnwindSafe for Unit

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.