pub fn parse(&self) -> Result<DebugInfo> {
        // vector of all units to work on
        let units = self
            .dwarf
            .units()
            .filter(|h| Ok(h.offset().as_debug_info_offset().is_some()))
            .map(|h| self.dwarf.unit(h))
            .collect::<Vec<_>>()?;

        let results = sync::Mutex::new(UnitResults::new(self));

        let process_unit = |unit: &'i gimli::Unit<Reader<'i>>| {
            let mut unitparser = UnitParser::new(self, unit);
            if unitparser.parse().is_ok() {
                results.lock().unwrap().add_unit(unitparser);
            }
        };
        units.par_iter().for_each(process_unit);

        // now the unitresults object has all of the  types to print, we can throw away the mutex
        let mut results = results.into_inner().unwrap();

        // update serialize_types by replacing them with the types of
        // their "self" parameter
        results.serialize_types = results
            .serialize_types
            .par_iter()
            .filter_map(|o| results.subfunction_to_self(*o))
            .collect::<HashSet<_>>();

        let mut builder = typ::TypeBuilder::new();
        results.serialize_types.iter().for_each(|o| {
            results
                .add_type(&mut builder, *o)
                .map_or_else(|e| eprintln!("{}", e), |_| ())
        });

        results.symbol_types.values().for_each(|o| {
            results
                .add_type(&mut builder, *o)
                .map_or_else(|e| eprintln!("{}", e), |_| ())
        });

        let types = builder
            .iter()
            .filter_map(|o| results.get_typename(*o).map(|n| (n, *o)))
            .collect::<HashMap<String, gimli::DebugInfoOffset>>();

        let syms = results
            .symbol_types
            .iter()
            .map(|(k, v)| (String::from(*k), *v))
            .collect::<HashMap<String, gimli::DebugInfoOffset>>();

        let symtypes = results
            .symbol_types
            .iter()
            .filter_map(|(k, v)| results.get_typename(*v).map(|n| (String::from(*k), n)))
            .collect::<HashMap<String, String>>();

        Ok(DebugInfo {
            types,
            syms,
            symtypes,
            builder,
        })
    }
// do all the work to make the debuginfo parser
do all the work to make the debuginfo parser
do all the work to make the debuginfo parser
pub fn parse(&self) -> Result<DebugInfo> {
        // vector of all units to work on
        let units = self
            .dwarf
            .units()
            .filter(|h| Ok(h.offset().as_debug_info_offset().is_some()))
            .map(|h| self.dwarf.unit(h))
            .collect::<Vec<_>>()?;
        let results = sync::Mutex::new(UnitResults::new(self));
        let process_unit = |unit: &'i gimli::Unit<Reader<'i>>| {
            let mut unitparser = UnitParser::new(self, unit);
            if unitparser.parse().is_ok() {
                results.lock().unwrap().add_unit(unitparser);
            }
        };
        units.par_iter().for_each(process_unit);
        // now the unitresults object has all of the  types to print, we can throw away the mutex
        let mut results = results.into_inner().unwrap();
        // update serialize_types by replacing them with the types of
        // their "self" parameter
        results.serialize_types = results
            .serialize_types
            .par_iter()
            .filter_map(|o| results.subfunction_to_self(*o))
            .collect::<HashSet<_>>();
        let mut builder = typ::TypeBuilder::new();
        results.serialize_types.iter().for_each(|o| {
            results
                .add_type(&mut builder, *o)
                .map_or_else(|e| eprintln!("{}", e), |_| ())
        });
        results.symbol_types.values().for_each(|o| {
            results
                .add_type(&mut builder, *o)
                .map_or_else(|e| eprintln!("{}", e), |_| ())
        });
        let types = builder
            .iter()
            .filter_map(|o| results.get_typename(*o).map(|n| (n, *o)))
            .collect::<HashMap<String, gimli::DebugInfoOffset>>();
        let syms = results
            .symbol_types
            .iter()
            .map(|(k, v)| (String::from(*k), *v))
            .collect::<HashMap<String, gimli::DebugInfoOffset>>();
        let symtypes = results
            .symbol_types
            .iter()
            .filter_map(|(k, v)| results.get_typename(*v).map(|n| (String::from(*k), n)))
            .collect::<HashMap<String, String>>();
        Ok(DebugInfo {
            types,
            syms,
            symtypes,
            builder,
        })
    }
pub fn parse ( & self ) -> Result < DebugInfo > { // vector of all units to work on let units = self . dwarf . units ( ) . filter ( | h | Ok ( h . offset ( ) . as_debug_info_offset ( ) . is_some ( ) ) ) . map ( | h | self . dwarf . unit ( h ) ) . collect :: < Vec < _ > > ( ) ? ; let results = sync :: Mutex :: new ( UnitResults :: new ( self ) ) ; let process_unit = | unit : & ' i gimli :: Unit < Reader < ' i > > | { let mut unitparser = UnitParser :: new ( self , unit ) ; if unitparser . parse ( ) . is_ok ( ) { results . lock ( ) . unwrap ( ) . add_unit ( unitparser ) ; } } ; units . par_iter ( ) . for_each ( process_unit ) ; // now the unitresults object has all of the  types to print, we can throw away the mutex let mut results = results . into_inner ( ) . unwrap ( ) ; // update serialize_types by replacing them with the types of // their "self" parameter results . serialize_types = results . serialize_types . par_iter ( ) . filter_map ( | o | results . subfunction_to_self ( * o ) ) . collect :: < HashSet < _ > > ( ) ; let mut builder = typ :: TypeBuilder :: new ( ) ; results . serialize_types . iter ( ) . for_each ( | o | { results . add_type ( & mut builder , * o ) . map_or_else ( | e | eprintln ! ( " " e ) , | _ | ( ) ) } ) ; results . symbol_types . values ( ) . for_each ( | o | { results . add_type ( & mut builder , * o ) . map_or_else ( | e | eprintln ! ( " " e ) , | _ | ( ) ) } ) ; let types = builder . iter ( ) . filter_map ( | o | results . get_typename ( * o ) . map ( | n | ( n , * o ) ) ) . collect :: < HashMap < String , gimli :: DebugInfoOffset > > ( ) ; let syms = results . symbol_types . iter ( ) . map ( | ( k , v ) | ( String :: from ( * k ) , * v ) ) . collect :: < HashMap < String , gimli :: DebugInfoOffset > > ( ) ; let symtypes = results . symbol_types . iter ( ) . filter_map ( | ( k , v ) | results . get_typename ( * v ) . map ( | n | ( String :: from ( * k ) , n ) ) ) . collect :: < HashMap < String , String > > ( ) ; Ok ( DebugInfo { types , syms , symtypes , builder , } ) }
do all the work to make the debuginfo parser
do all the work to make the debuginfo parser
&self
&self