// returns None if parsing failed
// returns Some(_) if we found a struct
returns None if parsing failed
returns Some(_) if we found a struct
returns None if parsing failed returns Some ( _ ) if we found a struct
fn try_parse_struct(
        &self,
        offset: gimli::DebugInfoOffset,
    ) -> Option<(Vec<&'i str>, Vec<gimli::DebugInfoOffset>)> {
        let (unit, u_offset) = self.di_to_unit(offset)?;
        let mut cursor = unit.entries_at_offset(u_offset).ok()?;
        let mut depth = 0;
        let mut field_names = Vec::new();
        let mut field_vals = Vec::new();
        // skip the first DIE, since that is the struct
        cursor.next_dfs().ok()??;
        while let Some((delta_depth, entry)) = cursor.next_dfs().ok()? {
            depth += delta_depth;
            if depth <= 0 {
                break;
            }
            if entry.tag() == constants::DW_TAG_member {
                field_names.push(
                    self.di_parser
                        .get_str_val(&entry, constants::DW_AT_name)
                        .ok()??,
                );
                field_vals.push(get_type(unit, &entry).ok()?);
            }
        }
        Some((field_names, field_vals))
    }
fn try_parse_struct ( & self , offset : gimli :: DebugInfoOffset , ) -> Option < ( Vec < & ' i str > , Vec < gimli :: DebugInfoOffset > ) > { let ( unit , u_offset ) = self . di_to_unit ( offset ) ? ; let mut cursor = unit . entries_at_offset ( u_offset ) . ok ( ) ? ; let mut depth = 0 ; let mut field_names = Vec :: new ( ) ; let mut field_vals = Vec :: new ( ) ; // skip the first DIE, since that is the struct cursor . next_dfs ( ) . ok ( ) ? ? ; while let Some ( ( delta_depth , entry ) ) = cursor . next_dfs ( ) . ok ( ) ? { depth += delta_depth ; if depth <= 0 { break ; } if entry . tag ( ) == constants :: DW_TAG_member { field_names . push ( self . di_parser . get_str_val ( & entry , constants :: DW_AT_name ) . ok ( ) ? ? , ) ; field_vals . push ( get_type ( unit , & entry ) . ok ( ) ? ) ; } } Some ( ( field_names , field_vals ) ) }
returns None if parsing failed
returns Some(_) if we found a struct
returns None if parsing failed returns Some ( _ ) if we found a struct
&self
offset
gimli::DebugInfoOffset