コード例 #1
0
void
DWARFMappedHash::ExtractClassOrStructDIEArray (const DIEInfoArray &die_info_array,
                                               bool return_implementation_only_if_available,
                                               DIEArray &die_offsets)
{
    const size_t count = die_info_array.size();
    for (size_t i=0; i<count; ++i)
    {
        const dw_tag_t die_tag = die_info_array[i].tag;
        if (die_tag == 0 || die_tag == DW_TAG_class_type || die_tag == DW_TAG_structure_type)
        {
            if (die_info_array[i].type_flags & eTypeFlagClassIsImplementation)
            {
                if (return_implementation_only_if_available)
                {
                    // We found the one true definition for this class, so
                    // only return that
                    die_offsets.clear();                        
                    die_offsets.emplace_back(die_info_array[i].cu_offset, die_info_array[i].offset);
                    return;
                }
                else
                {
                    // Put the one true definition as the first entry so it
                    // matches first
                    die_offsets.emplace(die_offsets.begin(), die_info_array[i].cu_offset, die_info_array[i].offset);
                }
            }
            else
            {
                die_offsets.emplace_back(die_info_array[i].cu_offset, die_info_array[i].offset);
            }
        }
    }
}
コード例 #2
0
void
DWARFMappedHash::ExtractDIEArray (const DIEInfoArray &die_info_array,
                                  const dw_tag_t tag,
                                  const uint32_t qualified_name_hash,
                                  DIEArray &die_offsets)
{
    if (tag == 0)
    {
        ExtractDIEArray (die_info_array, die_offsets);
    }
    else
    {
        const size_t count = die_info_array.size();
        for (size_t i=0; i<count; ++i)
        {
            if (qualified_name_hash != die_info_array[i].qualified_name_hash)
                continue;
            const dw_tag_t die_tag = die_info_array[i].tag;
            bool tag_matches = die_tag == 0 || tag == die_tag;
            if (!tag_matches)
            {
                if (die_tag == DW_TAG_class_type || die_tag == DW_TAG_structure_type)
                    tag_matches = tag == DW_TAG_structure_type || tag == DW_TAG_class_type;
            }
            if (tag_matches)
                die_offsets.emplace_back(die_info_array[i].cu_offset, die_info_array[i].offset);
        }
    }
}
コード例 #3
0
void
DWARFMappedHash::ExtractDIEArray (const DIEInfoArray &die_info_array, DIEArray &die_offsets)
{
    const size_t count = die_info_array.size();
    for (size_t i=0; i<count; ++i)
        die_offsets.emplace_back(die_info_array[i].cu_offset, die_info_array[i].offset);
}
コード例 #4
0
void
DWARFMappedHash::ExtractTypesFromDIEArray (const DIEInfoArray &die_info_array,
                                           uint32_t type_flag_mask,
                                           uint32_t type_flag_value,
                                           DIEArray &die_offsets)
{
    const size_t count = die_info_array.size();
    for (size_t i=0; i<count; ++i)
    {
        if ((die_info_array[i].type_flags & type_flag_mask) == type_flag_value)
            die_offsets.emplace_back(die_info_array[i].cu_offset, die_info_array[i].offset);
    }
}