Пример #1
0
bool
LanguageCategory::Get (ValueObject& valobj,
                       lldb::DynamicValueType dynamic,
                       FormattersMatchVector matches,
                       lldb::SyntheticChildrenSP& format_sp)
{
    if (!m_category_sp)
        return false;
    
    if (!IsEnabled())
        return false;

    ConstString type_name = FormatManager::GetTypeForCache(valobj, dynamic);
    if (type_name)
    {
        if (m_format_cache.GetSynthetic(type_name, format_sp))
            return format_sp.get() != nullptr;
    }
    bool result = m_category_sp->Get(valobj, matches, format_sp);
    if (type_name && (!format_sp || !format_sp->NonCacheable()))
    {
        m_format_cache.SetSynthetic(type_name, format_sp);
    }
    return result;
}
Пример #2
0
ValueObjectSynthetic::ValueObjectSynthetic (ValueObject &parent, lldb::SyntheticChildrenSP filter) :
    ValueObject(parent),
    m_address (),
    m_type_sp(),
    m_use_synthetic (lldb::eUseSyntheticFilter),
    m_synth_sp(filter),
    m_synth_filter(filter->GetFrontEnd(parent.GetSP())),
    m_children_byindex(),
    m_name_toindex()
{
    SetName (parent.GetName());
}
Пример #3
0
bool
LanguageCategory::GetHardcoded (ValueObject& valobj,
                                lldb::DynamicValueType use_dynamic,
                                FormatManager& fmt_mgr,
                                lldb::SyntheticChildrenSP& format_sp)
{
    if (!IsEnabled())
        return false;

    ConstString type_name = FormatManager::GetTypeForCache(valobj, use_dynamic);
    
    for (auto& candidate : m_hardcoded_synthetics)
    {
        if ((format_sp = candidate(valobj, use_dynamic, fmt_mgr)))
            break;
    }
    if (type_name && (!format_sp || !format_sp->NonCacheable()))
    {
        m_format_cache.SetSynthetic(type_name, format_sp);
    }
    return format_sp.get() != nullptr;
}
Пример #4
0
ValueObjectSynthetic::ValueObjectSynthetic (ValueObject &parent, lldb::SyntheticChildrenSP filter) :
    ValueObject(parent),
    m_synth_sp(filter),
    m_synth_filter_ap(filter->GetFrontEnd(parent)),
    m_children_byindex(),
    m_name_toindex(),
    m_synthetic_children_count(UINT32_MAX)
{
#ifdef LLDB_CONFIGURATION_DEBUG
    std::string new_name(parent.GetName().AsCString());
    new_name += "$$__synth__";
    SetName (ConstString(new_name.c_str()));
#else
    SetName(parent.GetName());
#endif
}