| 310 | } |
| 311 | |
| 312 | bool SymbolMappingLoader::LoadMappingsNode(tinyxml2::XMLElement* mappingsNode) |
| 313 | { |
| 314 | auto mapping = mappingsNode->FirstChildElement(); |
| 315 | while (mapping != nullptr) { |
| 316 | if (strcmp(mapping->Name(), "Mapping") == 0) { |
| 317 | SymbolMappings::Mapping sym; |
| 318 | if (LoadMapping(mapping, sym)) { |
| 319 | if (mappings_.Mappings.find(sym.Name) != mappings_.Mappings.end()) { |
| 320 | ERR("Duplicate mapping name: %s", sym.Name.c_str()); |
| 321 | } |
| 322 | |
| 323 | auto it = mappings_.Mappings.insert(std::make_pair(sym.Name, sym)); |
| 324 | mappings_.OrderedMappings.push_back(&it.first->second); |
| 325 | } else { |
| 326 | ERR("Failed to parse mapping '%s'; mapping discarded", sym.Name.c_str()); |
| 327 | } |
| 328 | } else if (strcmp(mapping->Name(), "DllImport") == 0) { |
| 329 | SymbolMappings::DllImport imp; |
| 330 | if (LoadDllImport(mapping, imp)) { |
| 331 | mappings_.DllImports.insert(std::make_pair(imp.Symbol, imp)); |
| 332 | } |
| 333 | } else { |
| 334 | ERR("Unknown element in <Mappings>: '%s'", mapping->Name()); |
| 335 | } |
| 336 | |
| 337 | mapping = mapping->NextSiblingElement(); |
| 338 | } |
| 339 | |
| 340 | return true; |
| 341 | } |
| 342 | |
| 343 | bool SymbolMappingLoader::LoadMapping(tinyxml2::XMLElement* mapping, SymbolMappings::Mapping& sym) |
| 344 | { |
nothing calls this directly
no test coverage detected