[go: up one dir, main page]

[][src]Trait gimli::read::Section

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.

Loading content...

Implementors

impl<R: Reader> Section<R> for DebugAbbrev<R>[src]

impl<R: Reader> Section<R> for DebugAddr<R>[src]

impl<R: Reader> Section<R> for DebugAranges<R>[src]

impl<R: Reader> Section<R> for DebugFrame<R>[src]

impl<R: Reader> Section<R> for DebugInfo<R>[src]

impl<R: Reader> Section<R> for DebugLine<R>[src]

impl<R: Reader> Section<R> for DebugLineStr<R>[src]

impl<R: Reader> Section<R> for DebugLoc<R>[src]

impl<R: Reader> Section<R> for DebugLocLists<R>[src]

impl<R: Reader> Section<R> for DebugPubNames<R>[src]

impl<R: Reader> Section<R> for DebugPubTypes<R>[src]

impl<R: Reader> Section<R> for DebugRanges<R>[src]

impl<R: Reader> Section<R> for DebugRngLists<R>[src]

impl<R: Reader> Section<R> for DebugStr<R>[src]

impl<R: Reader> Section<R> for DebugStrOffsets<R>[src]

impl<R: Reader> Section<R> for DebugTypes<R>[src]

impl<R: Reader> Section<R> for EhFrame<R>[src]

impl<R: Reader> Section<R> for EhFrameHdr<R>[src]

Loading content...