pub struct DwarfUnit {
pub unit: Unit,
pub line_strings: LineStringTable,
pub strings: StringTable,
}
Expand description
Writable DWARF information for a single unit.
Fields§
§unit: Unit
A unit. This is primarily stored in the .debug_info
section,
but also contains information that is stored in other sections.
line_strings: LineStringTable
A table of strings that will be stored in the .debug_line_str
section.
strings: StringTable
A table of strings that will be stored in the .debug_str
section.
Implementations§
Source§impl DwarfUnit
impl DwarfUnit
Sourcepub fn new(encoding: Encoding) -> Self
pub fn new(encoding: Encoding) -> Self
Create a new DwarfUnit
.
Note: you should set self.unit.line_program
after creation.
This cannot be done earlier because it may need to reference
self.line_strings
.
Sourcepub fn write<W: Writer>(&mut self, sections: &mut Sections<W>) -> Result<()>
pub fn write<W: Writer>(&mut self, sections: &mut Sections<W>) -> Result<()>
Write the DWARf information to the given sections.
Sourcepub fn get_line_string<'a>(&'a self, string: &'a LineString) -> &'a [u8] ⓘ
pub fn get_line_string<'a>(&'a self, string: &'a LineString) -> &'a [u8] ⓘ
Get a reference to the data for a line string.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DwarfUnit
impl RefUnwindSafe for DwarfUnit
impl Send for DwarfUnit
impl Sync for DwarfUnit
impl Unpin for DwarfUnit
impl UnwindSafe for DwarfUnit
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more