Trait gimli::Section
[−]
[src]
pub trait Section<R: Reader>: From<R> { fn section_name() -> &'static str; }
A convenience trait for loading DWARF sections from object files. To be used like:
use gimli::{DebugInfo, EndianBuf, LittleEndian, Reader, Section}; fn load_section<R, S, F>(loader: F) -> S where R: Reader, S: Section<R>, F: FnOnce(&'static str) -> R { let data = loader(S::section_name()); S::from(data) } let buf = [0x00, 0x01, 0x02, 0x03]; let reader = EndianBuf::new(&buf, LittleEndian); let debug_info: DebugInfo<_> = load_section(|_: &'static str| reader);
Required Methods
fn section_name() -> &'static str
Returns the ELF section name for this type.
Implementors
impl<R: Reader> Section<R> for DebugFrame<R>
impl<R: Reader> Section<R> for EhFrameHdr<R>
impl<R: Reader> Section<R> for EhFrame<R>
impl<R: Reader> Section<R> for DebugAbbrev<R>
impl<R: Reader> Section<R> for DebugAranges<R>
impl<R: Reader> Section<R> for DebugLine<R>
impl<R: Reader> Section<R> for DebugLoc<R>
impl<R: Reader> Section<R> for DebugPubNames<R>
impl<R: Reader> Section<R> for DebugPubTypes<R>
impl<R: Reader> Section<R> for DebugRanges<R>
impl<R: Reader> Section<R> for DebugStr<R>
impl<R: Reader> Section<R> for DebugInfo<R>
impl<R: Reader> Section<R> for DebugTypes<R>