}
/* Callback for dl_iterate_phdr.
 * Is called by dl_iterate_phdr for every loaded shared lib until something
 * else than 0 is returned by one call of this function.
 */
int collectSymbols(dl_phdr_info * info, size_t, void * data_ptr)
{
    SymbolIndex::Data & data = *reinterpret_cast<SymbolIndex::Data *>(data_ptr);
    collectSymbolsFromProgramHeaders(info, data.symbols, data.resources);
    collectSymbolsFromELF(info, data.symbols, data.objects, data.resources, data.build_id);
    
    return 0;
}
template <typename T>
const T * find(const void * address, const std::vector<T> & vec)
{
    
    auto it = std::lower_bound(vec.begin(), vec.end(), address,
        [](const T & symbol, const void * addr) { return symbol.address_begin <= addr; });
    if (it == vec.begin())
        return nullptr;
    else
        --it; 
    if (address >= it->address_begin && address < it->address_end)
        return &*it;
    else
        return nullptr;
}
}
void SymbolIndex::update()