Trait gimli::write::Writer [−][src]
A trait for writing the data to a DWARF section.
All write operations append to the section unless otherwise specified.
Associated Types
Loading content...Required methods
fn endian(&self) -> Self::Endian
[src]
Return the endianity of bytes that are written.
fn len(&self) -> usize
[src]
Return the current section length.
This may be used as an offset for future write_at
calls.
fn write(&mut self, bytes: &[u8]) -> Result<()>
[src]
Write a slice.
fn write_at(&mut self, offset: usize, bytes: &[u8]) -> Result<()>
[src]
Write a slice at a given offset.
The write must not extend past the current section length.
Provided methods
fn write_address(&mut self, address: Address, size: u8) -> Result<()>
[src]
Write an address.
If the writer supports relocations, then it must provide its own implementation of this method.
fn write_eh_pointer(
&mut self,
address: Address,
eh_pe: DwEhPe,
size: u8
) -> Result<()>
[src]
&mut self,
address: Address,
eh_pe: DwEhPe,
size: u8
) -> Result<()>
Write an address with a .eh_frame
pointer encoding.
The given size is only used for DW_EH_PE_absptr
formats.
If the writer supports relocations, then it must provide its own implementation of this method.
fn write_eh_pointer_data(
&mut self,
val: u64,
format: DwEhPe,
size: u8
) -> Result<()>
[src]
&mut self,
val: u64,
format: DwEhPe,
size: u8
) -> Result<()>
Write a value with a .eh_frame
pointer format.
The given size is only used for DW_EH_PE_absptr
formats.
This must not be used directly for values that may require relocation.
fn write_offset(
&mut self,
val: usize,
_section: SectionId,
size: u8
) -> Result<()>
[src]
&mut self,
val: usize,
_section: SectionId,
size: u8
) -> Result<()>
Write an offset that is relative to the start of the given section.
If the writer supports relocations, then it must provide its own implementation of this method.
fn write_offset_at(
&mut self,
offset: usize,
val: usize,
_section: SectionId,
size: u8
) -> Result<()>
[src]
&mut self,
offset: usize,
val: usize,
_section: SectionId,
size: u8
) -> Result<()>
Write an offset that is relative to the start of the given section.
If the writer supports relocations, then it must provide its own implementation of this method.
fn write_reference(&mut self, _symbol: usize, _size: u8) -> Result<()>
[src]
Write a reference to a symbol.
If the writer supports symbols, then it must provide its own implementation of this method.
fn write_u8(&mut self, val: u8) -> Result<()>
[src]
Write a u8.
fn write_u16(&mut self, val: u16) -> Result<()>
[src]
Write a u16.
fn write_u32(&mut self, val: u32) -> Result<()>
[src]
Write a u32.
fn write_u64(&mut self, val: u64) -> Result<()>
[src]
Write a u64.
fn write_u8_at(&mut self, offset: usize, val: u8) -> Result<()>
[src]
Write a u8 at the given offset.
fn write_u16_at(&mut self, offset: usize, val: u16) -> Result<()>
[src]
Write a u16 at the given offset.
fn write_u32_at(&mut self, offset: usize, val: u32) -> Result<()>
[src]
Write a u32 at the given offset.
fn write_u64_at(&mut self, offset: usize, val: u64) -> Result<()>
[src]
Write a u64 at the given offset.
fn write_udata(&mut self, val: u64, size: u8) -> Result<()>
[src]
Write unsigned data of the given size.
Returns an error if the value is too large for the size. This must not be used directly for values that may require relocation.
fn write_sdata(&mut self, val: i64, size: u8) -> Result<()>
[src]
Write signed data of the given size.
Returns an error if the value is too large for the size. This must not be used directly for values that may require relocation.
fn write_udata_at(&mut self, offset: usize, val: u64, size: u8) -> Result<()>
[src]
Write a word of the given size at the given offset.
Returns an error if the value is too large for the size. This must not be used directly for values that may require relocation.
fn write_uleb128(&mut self, val: u64) -> Result<()>
[src]
Write an unsigned LEB128 encoded integer.
fn write_sleb128(&mut self, val: i64) -> Result<()>
[src]
Read an unsigned LEB128 encoded integer.
fn write_initial_length(
&mut self,
format: Format
) -> Result<InitialLengthOffset>
[src]
&mut self,
format: Format
) -> Result<InitialLengthOffset>
Write an initial length according to the given DWARF format.
This will only write a length of zero, since the length isn’t
known yet, and a subsequent call to write_initial_length_at
will write the actual length.
fn write_initial_length_at(
&mut self,
offset: InitialLengthOffset,
length: u64,
format: Format
) -> Result<()>
[src]
&mut self,
offset: InitialLengthOffset,
length: u64,
format: Format
) -> Result<()>
Write an initial length at the given offset according to the given DWARF format.
write_initial_length
must have previously returned the offset.