diff --git a/lldb/include/lldb/DataFormatters/TypeCategory.h b/lldb/include/lldb/DataFormatters/TypeCategory.h index f37c661d56d0ed..513e859815f5ca 100644 --- a/lldb/include/lldb/DataFormatters/TypeCategory.h +++ b/lldb/include/lldb/DataFormatters/TypeCategory.h @@ -332,16 +332,16 @@ class TypeCategoryImpl { return m_enabled_position; } - bool Get(ValueObject &valobj, const FormattersMatchVector &candidates, + bool Get(lldb::LanguageType lang, const FormattersMatchVector &candidates, lldb::TypeFormatImplSP &entry, uint32_t *reason = nullptr); - bool Get(ValueObject &valobj, const FormattersMatchVector &candidates, + bool Get(lldb::LanguageType lang, const FormattersMatchVector &candidates, lldb::TypeSummaryImplSP &entry, uint32_t *reason = nullptr); - bool Get(ValueObject &valobj, const FormattersMatchVector &candidates, + bool Get(lldb::LanguageType lang, const FormattersMatchVector &candidates, lldb::SyntheticChildrenSP &entry, uint32_t *reason = nullptr); - bool Get(ValueObject &valobj, const FormattersMatchVector &candidates, + bool Get(lldb::LanguageType lang, const FormattersMatchVector &candidates, lldb::TypeValidatorImplSP &entry, uint32_t *reason = nullptr); void Clear(FormatCategoryItems items = ALL_ITEM_TYPES); diff --git a/lldb/source/DataFormatters/LanguageCategory.cpp b/lldb/source/DataFormatters/LanguageCategory.cpp index 64a891804c5723..86de2806025426 100644 --- a/lldb/source/DataFormatters/LanguageCategory.cpp +++ b/lldb/source/DataFormatters/LanguageCategory.cpp @@ -48,8 +48,8 @@ bool LanguageCategory::Get(FormattersMatchData &match_data, } ValueObject &valobj(match_data.GetValueObject()); - bool result = - m_category_sp->Get(valobj, match_data.GetMatchesVector(), format_sp); + bool result = m_category_sp->Get(valobj.GetObjectRuntimeLanguage(), + match_data.GetMatchesVector(), format_sp); if (match_data.GetTypeForCache() && (!format_sp || !format_sp->NonCacheable())) { m_format_cache.Set(match_data.GetTypeForCache(), format_sp); @@ -71,8 +71,8 @@ bool LanguageCategory::Get(FormattersMatchData &match_data, } ValueObject &valobj(match_data.GetValueObject()); - bool result = - m_category_sp->Get(valobj, match_data.GetMatchesVector(), format_sp); + bool result = m_category_sp->Get(valobj.GetObjectRuntimeLanguage(), + match_data.GetMatchesVector(), format_sp); if (match_data.GetTypeForCache() && (!format_sp || !format_sp->NonCacheable())) { m_format_cache.Set(match_data.GetTypeForCache(), format_sp); @@ -94,8 +94,8 @@ bool LanguageCategory::Get(FormattersMatchData &match_data, } ValueObject &valobj(match_data.GetValueObject()); - bool result = - m_category_sp->Get(valobj, match_data.GetMatchesVector(), format_sp); + bool result = m_category_sp->Get(valobj.GetObjectRuntimeLanguage(), + match_data.GetMatchesVector(), format_sp); if (match_data.GetTypeForCache() && (!format_sp || !format_sp->NonCacheable())) { m_format_cache.Set(match_data.GetTypeForCache(), format_sp); @@ -117,8 +117,8 @@ bool LanguageCategory::Get(FormattersMatchData &match_data, } ValueObject &valobj(match_data.GetValueObject()); - bool result = - m_category_sp->Get(valobj, match_data.GetMatchesVector(), format_sp); + bool result = m_category_sp->Get(valobj.GetObjectRuntimeLanguage(), + match_data.GetMatchesVector(), format_sp); if (match_data.GetTypeForCache() && (!format_sp || !format_sp->NonCacheable())) { m_format_cache.Set(match_data.GetTypeForCache(), format_sp); diff --git a/lldb/source/DataFormatters/TypeCategory.cpp b/lldb/source/DataFormatters/TypeCategory.cpp index 4f8ea5d4341154..7a04b59b1c8429 100644 --- a/lldb/source/DataFormatters/TypeCategory.cpp +++ b/lldb/source/DataFormatters/TypeCategory.cpp @@ -85,10 +85,10 @@ void TypeCategoryImpl::AddLanguage(lldb::LanguageType lang) { m_languages.push_back(lang); } -bool TypeCategoryImpl::Get(ValueObject &valobj, +bool TypeCategoryImpl::Get(lldb::LanguageType lang, const FormattersMatchVector &candidates, lldb::TypeFormatImplSP &entry, uint32_t *reason) { - if (!IsEnabled() || !IsApplicable(valobj.GetObjectRuntimeLanguage())) + if (!IsEnabled() || !IsApplicable(lang)) return false; if (GetTypeFormatsContainer()->Get(candidates, entry, reason)) return true; @@ -98,10 +98,10 @@ bool TypeCategoryImpl::Get(ValueObject &valobj, return regex; } -bool TypeCategoryImpl::Get(ValueObject &valobj, +bool TypeCategoryImpl::Get(lldb::LanguageType lang, const FormattersMatchVector &candidates, lldb::TypeSummaryImplSP &entry, uint32_t *reason) { - if (!IsEnabled() || !IsApplicable(valobj.GetObjectRuntimeLanguage())) + if (!IsEnabled() || !IsApplicable(lang)) return false; if (GetTypeSummariesContainer()->Get(candidates, entry, reason)) return true; @@ -111,10 +111,10 @@ bool TypeCategoryImpl::Get(ValueObject &valobj, return regex; } -bool TypeCategoryImpl::Get(ValueObject &valobj, +bool TypeCategoryImpl::Get(lldb::LanguageType lang, const FormattersMatchVector &candidates, lldb::SyntheticChildrenSP &entry, uint32_t *reason) { - if (!IsEnabled() || !IsApplicable(valobj.GetObjectRuntimeLanguage())) + if (!IsEnabled() || !IsApplicable(lang)) return false; TypeFilterImpl::SharedPointer filter_sp; uint32_t reason_filter = 0; @@ -158,7 +158,7 @@ bool TypeCategoryImpl::Get(ValueObject &valobj, return false; } -bool TypeCategoryImpl::Get(ValueObject &valobj, +bool TypeCategoryImpl::Get(lldb::LanguageType lang, const FormattersMatchVector &candidates, lldb::TypeValidatorImplSP &entry, uint32_t *reason) { if (!IsEnabled()) diff --git a/lldb/source/DataFormatters/TypeCategoryMap.cpp b/lldb/source/DataFormatters/TypeCategoryMap.cpp index 08f9bc3f1a4dbc..9bbecd9f420bcd 100644 --- a/lldb/source/DataFormatters/TypeCategoryMap.cpp +++ b/lldb/source/DataFormatters/TypeCategoryMap.cpp @@ -197,9 +197,9 @@ void TypeCategoryMap::Get(FormattersMatchData &match_data, ImplSP &retval) { ImplSP current_format; LLDB_LOGF(log, "[%s] Trying to use category %s", __FUNCTION__, category_sp->GetName()); - if (!category_sp->Get(match_data.GetValueObject(), - match_data.GetMatchesVector(), current_format, - &reason_why)) + if (!category_sp->Get( + match_data.GetValueObject().GetObjectRuntimeLanguage(), + match_data.GetMatchesVector(), current_format, &reason_why)) continue; retval = std::move(current_format);