fn first_pass(
        &mut self,
        entry: &gimli::DebuggingInformationEntry<Reader>,
        depth: usize,
    ) -> result::Result<(), gimli::Error> {
        match entry.tag() {
            constants::DW_TAG_variable => {
                if let Some(name) = self.di_parser.get_str_val(entry, constants::DW_AT_name)? {
                    // if the symbol we see doesnt match our
                    // filter, we dont need to do any more work
                    if !self.di_parser.allowed_by_sym_filter(name) {
                        return Ok(());
                    }

                    let offset = get_type(&self.unit, entry)?;
                    self.symbol_types.insert(name, offset);
                }
            }
            constants::DW_TAG_namespace => {
                if let Some(namespace) = self.di_parser.get_str_val(entry, constants::DW_AT_name)? {
                    // add the new namespace part we encountered
                    self.ns_parts.push((namespace, depth));
                    // update the latest namespace Id
                    self.render_namespace(entry.offset());
                } else {
                    return Err(gimli::Error::UnsupportedAttributeForm);
                }
            }
            constants::DW_TAG_subprogram => {
                if let Some(export) = self
                    .di_parser
                    .get_str_val(entry, constants::DW_AT_linkage_name)?
                {
                    let export = demangle(export).to_string();

                    // use heuristics to guess if a function
                    // implements a seriaizer this currently works for
                    // legacy demangling algo, need to confirm it
                    // works for v0 as well
                    if export.contains("impl serde::ser::Serialize for") {
                        // convert the unit offset of this DIE to a debuginfo offset
                        if let Some(di_offset) = unit_to_di(&self.unit, entry.offset()) {
                            self.serialize_types.insert(di_offset);
                        }
                    }
                }
            }
            _ => { /* ignore the rest of the tag types */ }
        }
        Ok(())
    }
// first pass through all of the DIEs in the unit.
first pass through all of the DIEs in the unit.
first pass through all of the DIEs in the unit .
fn first_pass(
        &mut self,
        entry: &gimli::DebuggingInformationEntry<Reader>,
        depth: usize,
    ) -> result::Result<(), gimli::Error> {
        match entry.tag() {
            constants::DW_TAG_variable => {
                if let Some(name) = self.di_parser.get_str_val(entry, constants::DW_AT_name)? {
                    // if the symbol we see doesnt match our
                    // filter, we dont need to do any more work
                    if !self.di_parser.allowed_by_sym_filter(name) {
                        return Ok(());
                    }
                    let offset = get_type(&self.unit, entry)?;
                    self.symbol_types.insert(name, offset);
                }
            }
            constants::DW_TAG_namespace => {
                if let Some(namespace) = self.di_parser.get_str_val(entry, constants::DW_AT_name)? {
                    // add the new namespace part we encountered
                    self.ns_parts.push((namespace, depth));
                    // update the latest namespace Id
                    self.render_namespace(entry.offset());
                } else {
                    return Err(gimli::Error::UnsupportedAttributeForm);
                }
            }
            constants::DW_TAG_subprogram => {
                if let Some(export) = self
                    .di_parser
                    .get_str_val(entry, constants::DW_AT_linkage_name)?
                {
                    let export = demangle(export).to_string();
                    // use heuristics to guess if a function
                    // implements a seriaizer this currently works for
                    // legacy demangling algo, need to confirm it
                    // works for v0 as well
                    if export.contains("impl serde::ser::Serialize for") {
                        // convert the unit offset of this DIE to a debuginfo offset
                        if let Some(di_offset) = unit_to_di(&self.unit, entry.offset()) {
                            self.serialize_types.insert(di_offset);
                        }
                    }
                }
            }
            _ => { /* ignore the rest of the tag types */ }
        }
        Ok(())
    }
fn first_pass ( & mut self , entry : & gimli :: DebuggingInformationEntry < Reader > , depth : usize , ) -> result :: Result < ( ) , gimli :: Error > { match entry . tag ( ) { constants :: DW_TAG_variable => { if let Some ( name ) = self . di_parser . get_str_val ( entry , constants :: DW_AT_name ) ? { // if the symbol we see doesnt match our // filter, we dont need to do any more work if ! self . di_parser . allowed_by_sym_filter ( name ) { return Ok ( ( ) ) ; } let offset = get_type ( & self . unit , entry ) ? ; self . symbol_types . insert ( name , offset ) ; } } constants :: DW_TAG_namespace => { if let Some ( namespace ) = self . di_parser . get_str_val ( entry , constants :: DW_AT_name ) ? { // add the new namespace part we encountered self . ns_parts . push ( ( namespace , depth ) ) ; // update the latest namespace Id self . render_namespace ( entry . offset ( ) ) ; } else { return Err ( gimli :: Error :: UnsupportedAttributeForm ) ; } } constants :: DW_TAG_subprogram => { if let Some ( export ) = self . di_parser . get_str_val ( entry , constants :: DW_AT_linkage_name ) ? { let export = demangle ( export ) . to_string ( ) ; // use heuristics to guess if a function // implements a seriaizer this currently works for // legacy demangling algo, need to confirm it // works for v0 as well if export . contains ( " " ) { // convert the unit offset of this DIE to a debuginfo offset if let Some ( di_offset ) = unit_to_di ( & self . unit , entry . offset ( ) ) { self . serialize_types . insert ( di_offset ) ; } } } } _ => { /* ignore the rest of the tag types */ } } Ok ( ( ) ) }
first pass through all of the DIEs in the unit.
first pass through all of the DIEs in the unit .
&mut self
entry
&gimli::DebuggingInformationEntry<Reader>
depth
usize
&mut self
entry
&gimli::DebuggingInformationEntry<Reader>
depth
usize