size_t NameToDIE::FindAllEntriesForCompileUnit(dw_offset_t cu_offset, DIEArray &info_array) const { const size_t initial_size = info_array.size(); const uint32_t size = m_map.GetSize(); for (uint32_t i = 0; i < size; ++i) { const DIERef &die_ref = m_map.GetValueAtIndexUnchecked(i); if (cu_offset == die_ref.cu_offset) info_array.push_back(die_ref); } return info_array.size() - initial_size; }
size_t DWARFMappedHash::MemoryTable::FindCompleteObjCClassByName (const char *name, DIEArray &die_offsets, bool must_be_implementation) { DIEInfoArray die_info_array; if (FindByName(name, die_info_array)) { if (must_be_implementation && GetHeader().header_data.ContainsAtom (eAtomTypeTypeFlags)) { // If we have two atoms, then we have the DIE offset and // the type flags so we can find the objective C class // efficiently. DWARFMappedHash::ExtractTypesFromDIEArray (die_info_array, UINT32_MAX, eTypeFlagClassIsImplementation, die_offsets); } else { // We don't only want the one true definition, so try and see // what we can find, and only return class or struct DIEs. // If we do have the full implementation, then return it alone, // else return all possible matches. const bool return_implementation_only_if_available = true; DWARFMappedHash::ExtractClassOrStructDIEArray (die_info_array, return_implementation_only_if_available, die_offsets); } } return die_offsets.size(); }