| 608 | |
| 609 | |
| 610 | bool SymbolMappingLoader::LoadReference(tinyxml2::XMLElement* ele, Pattern const& pattern, SymbolMappings::Reference& ref) |
| 611 | { |
| 612 | auto type = ele->Attribute("Type"); |
| 613 | if (!type) { |
| 614 | ERR("Mapping reference must have a Type property."); |
| 615 | return false; |
| 616 | } |
| 617 | |
| 618 | if (strcmp(type, "Absolute") == 0) { |
| 619 | ref.Type = SymbolMappings::ReferenceType::kAbsolute; |
| 620 | } else if (strcmp(type, "Indirect") == 0) { |
| 621 | ref.Type = SymbolMappings::ReferenceType::kIndirect; |
| 622 | } else { |
| 623 | ERR("Unsupported mapping reference type: %s", type); |
| 624 | return false; |
| 625 | } |
| 626 | |
| 627 | auto offset = GetOffsetAttribute(ele, pattern, "Offset"); |
| 628 | if (!offset) { |
| 629 | ERR("Mapping reference has invalid Offset value."); |
| 630 | return false; |
| 631 | } |
| 632 | |
| 633 | ref.Offset = *offset; |
| 634 | return true; |
| 635 | } |
| 636 | |
| 637 | bool SymbolMappingLoader::LoadCondition(tinyxml2::XMLElement* ele, Pattern const& pattern, SymbolMappings::Condition& condition) |
| 638 | { |
nothing calls this directly
no test coverage detected