pub fn load_dwarf_from_file(object: object::File) -> Result<Dwarf<borrow::Cow<[u8]>>> {
    // Load a section and return as `Cow<[u8]>`.
    let load_section = |id: gimli::SectionId| -> Result<borrow::Cow<[u8]>, gimli::Error> {
        match object.section_by_name(id.name()) {
            Some(ref section) => Ok(section
                .uncompressed_data()
                .unwrap_or(borrow::Cow::Borrowed(&[][..]))),
            None => Ok(borrow::Cow::Borrowed(&[][..])),
        }
    };

    // Load a supplementary section. We don't have a supplementary object file,
    // so always return an empty slice.
    let load_section_sup = |_| Ok(borrow::Cow::Borrowed(&[][..]));

    // Load all of the sections.
    Ok(gimli::Dwarf::load(&load_section, &load_section_sup)?)
}
/// Loads a DWARF object from file
///
/// * `object` - The file to read
Loads a DWARF object from file
`object` - The file to read
Loads a DWARF object from file ` object ` - The file to read
pub fn load_dwarf_from_file(object: object::File) -> Result<Dwarf<borrow::Cow<[u8]>>> {
    // Load a section and return as `Cow<[u8]>`.
    let load_section = |id: gimli::SectionId| -> Result<borrow::Cow<[u8]>, gimli::Error> {
        match object.section_by_name(id.name()) {
            Some(ref section) => Ok(section
                .uncompressed_data()
                .unwrap_or(borrow::Cow::Borrowed(&[][..]))),
            None => Ok(borrow::Cow::Borrowed(&[][..])),
        }
    };
    // Load a supplementary section. We don't have a supplementary object file,
    // so always return an empty slice.
    let load_section_sup = |_| Ok(borrow::Cow::Borrowed(&[][..]));
    // Load all of the sections.
    Ok(gimli::Dwarf::load(&load_section, &load_section_sup)?)
}
pub fn load_dwarf_from_file ( object : object :: File ) -> Result < Dwarf < borrow :: Cow < [ u8 ] > > > { // Load a section and return as `Cow<[u8]>`. let load_section = | id : gimli :: SectionId | -> Result < borrow :: Cow < [ u8 ] > , gimli :: Error > { match object . section_by_name ( id . name ( ) ) { Some ( ref section ) => Ok ( section . uncompressed_data ( ) . unwrap_or ( borrow :: Cow :: Borrowed ( & [ ] [ .. ] ) ) ) , None => Ok ( borrow :: Cow :: Borrowed ( & [ ] [ .. ] ) ) , } } ; // Load a supplementary section. We don't have a supplementary object file, // so always return an empty slice. let load_section_sup = | _ | Ok ( borrow :: Cow :: Borrowed ( & [ ] [ .. ] ) ) ; // Load all of the sections. Ok ( gimli :: Dwarf :: load ( & load_section , & load_section_sup ) ? ) }
Loads a DWARF object from file
 `object` - The file to read
Loads a DWARF object from file ` object ` - The file to read
object
object::File
object
object::File