Try to parse the pdb into the DebugInfo
(
&mut self,
progress: Box<dyn Fn(usize, usize) -> Result<()> + 'a>,
)
| 163 | |
| 164 | /// Try to parse the pdb into the DebugInfo |
| 165 | pub fn try_parse_info( |
| 166 | &mut self, |
| 167 | progress: Box<dyn Fn(usize, usize) -> Result<()> + 'a>, |
| 168 | ) -> Result<()> { |
| 169 | self.parse_types(Self::split_progress(&progress, 0, &[1.0, 3.0, 0.5, 0.5]))?; |
| 170 | for (name, ty) in self.named_types.iter() { |
| 171 | self.debug_info.add_type(name, ty.as_ref(), &[]); // TODO : Components |
| 172 | } |
| 173 | |
| 174 | info!( |
| 175 | "PDB found {} types (before resolving NTRs)", |
| 176 | self.named_types.len() |
| 177 | ); |
| 178 | |
| 179 | if self |
| 180 | .settings |
| 181 | .get_bool_with_opts("pdb.features.parseSymbols", &mut self.settings_query_opts) |
| 182 | { |
| 183 | let (symbols, functions) = |
| 184 | self.parse_symbols(Self::split_progress(&progress, 1, &[1.0, 3.0, 0.5, 0.5]))?; |
| 185 | |
| 186 | if self.settings.get_bool_with_opts( |
| 187 | "pdb.features.createMissingNamedTypes", |
| 188 | &mut self.settings_query_opts, |
| 189 | ) { |
| 190 | self.resolve_missing_ntrs( |
| 191 | &symbols, |
| 192 | Self::split_progress(&progress, 2, &[1.0, 3.0, 0.5, 0.5]), |
| 193 | )?; |
| 194 | self.resolve_missing_ntrs( |
| 195 | &functions, |
| 196 | Self::split_progress(&progress, 3, &[1.0, 3.0, 0.5, 0.5]), |
| 197 | )?; |
| 198 | } |
| 199 | |
| 200 | info!("PDB found {} types", self.named_types.len()); |
| 201 | info!("PDB found {} data variables", symbols.len()); |
| 202 | info!("PDB found {} functions", functions.len()); |
| 203 | |
| 204 | let allow_void = self.settings.get_bool_with_opts( |
| 205 | "pdb.features.allowVoidGlobals", |
| 206 | &mut self.settings_query_opts, |
| 207 | ); |
| 208 | |
| 209 | let min_confidence_type = Conf::new(Type::void(), MIN_CONFIDENCE); |
| 210 | for sym in symbols { |
| 211 | match sym { |
| 212 | ParsedSymbol::Data(ParsedDataSymbol { |
| 213 | address, |
| 214 | name, |
| 215 | type_, |
| 216 | .. |
| 217 | }) => { |
| 218 | let real_type = type_.as_ref().unwrap_or(&min_confidence_type); |
| 219 | |
| 220 | if real_type.contents.type_class() == TypeClass::VoidTypeClass { |
| 221 | if !allow_void { |
| 222 | self.log(|| { |
no test coverage detected