diff options
author | Enrico Granata <egranata@apple.com> | 2012-05-08 21:49:57 +0000 |
---|---|---|
committer | Enrico Granata <egranata@apple.com> | 2012-05-08 21:49:57 +0000 |
commit | a777dc2abe4525b34a0e9d6433b41ea9728b27a2 (patch) | |
tree | 00053fd31f78442d475ae5e73849528ab838f81f /lldb/source/API/SBDebugger.cpp | |
parent | f534e91882d71423b63814cb8a2384ec02507fa9 (diff) | |
download | bcm5719-llvm-a777dc2abe4525b34a0e9d6433b41ea9728b27a2.tar.gz bcm5719-llvm-a777dc2abe4525b34a0e9d6433b41ea9728b27a2.zip |
<rdar://problem/11338654> Fixing a bug where having a summary for a bitfield without a format specified would in certain cases crash LLDB - This has also led to refactoring the by-type accessors for the data formatter subsystem. These now belong in our internal layer, and are just invoked by the public API stratum
llvm-svn: 156429
Diffstat (limited to 'lldb/source/API/SBDebugger.cpp')
-rw-r--r-- | lldb/source/API/SBDebugger.cpp | 66 |
1 files changed, 9 insertions, 57 deletions
diff --git a/lldb/source/API/SBDebugger.cpp b/lldb/source/API/SBDebugger.cpp index 8eea87af239..be5190d8932 100644 --- a/lldb/source/API/SBDebugger.cpp +++ b/lldb/source/API/SBDebugger.cpp @@ -1146,75 +1146,27 @@ SBDebugger::GetFormatForType (SBTypeNameSpecifier type_name) SBTypeSummary SBDebugger::GetSummaryForType (SBTypeNameSpecifier type_name) { - SBTypeSummary summary_chosen; - uint32_t num_categories = GetNumCategories(); - SBTypeCategory category_sb; - uint32_t prio_category = UINT32_MAX; - for (uint32_t category_id = 0; - category_id < num_categories; - category_id++) - { - category_sb = GetCategoryAtIndex(category_id); - if (category_sb.GetEnabled() == false) - continue; - SBTypeSummary summary_current = category_sb.GetSummaryForType(type_name); - if (summary_current.IsValid() && (summary_chosen.IsValid() == false || (prio_category > category_sb.m_opaque_sp->GetEnabledPosition()))) - { - prio_category = category_sb.m_opaque_sp->GetEnabledPosition(); - summary_chosen = summary_current; - } - } - return summary_chosen; + if (type_name.IsValid() == false) + return SBTypeSummary(); + return SBTypeSummary(DataVisualization::GetSummaryForType(type_name.GetSP())); } #endif // LLDB_DISABLE_PYTHON SBTypeFilter SBDebugger::GetFilterForType (SBTypeNameSpecifier type_name) { - SBTypeFilter filter_chosen; - uint32_t num_categories = GetNumCategories(); - SBTypeCategory category_sb; - uint32_t prio_category = UINT32_MAX; - for (uint32_t category_id = 0; - category_id < num_categories; - category_id++) - { - category_sb = GetCategoryAtIndex(category_id); - if (category_sb.GetEnabled() == false) - continue; - SBTypeFilter filter_current = category_sb.GetFilterForType(type_name); - if (filter_current.IsValid() && (filter_chosen.IsValid() == false || (prio_category > category_sb.m_opaque_sp->GetEnabledPosition()))) - { - prio_category = category_sb.m_opaque_sp->GetEnabledPosition(); - filter_chosen = filter_current; - } - } - return filter_chosen; + if (type_name.IsValid() == false) + return SBTypeFilter(); + return SBTypeFilter(DataVisualization::GetFilterForType(type_name.GetSP())); } #ifndef LLDB_DISABLE_PYTHON SBTypeSynthetic SBDebugger::GetSyntheticForType (SBTypeNameSpecifier type_name) { - SBTypeSynthetic synth_chosen; - uint32_t num_categories = GetNumCategories(); - SBTypeCategory category_sb; - uint32_t prio_category = UINT32_MAX; - for (uint32_t category_id = 0; - category_id < num_categories; - category_id++) - { - category_sb = GetCategoryAtIndex(category_id); - if (category_sb.GetEnabled() == false) - continue; - SBTypeSynthetic synth_current = category_sb.GetSyntheticForType(type_name); - if (synth_current.IsValid() && (synth_chosen.IsValid() == false || (prio_category > category_sb.m_opaque_sp->GetEnabledPosition()))) - { - prio_category = category_sb.m_opaque_sp->GetEnabledPosition(); - synth_chosen = synth_current; - } - } - return synth_chosen; + if (type_name.IsValid() == false) + return SBTypeSynthetic(); + return SBTypeSynthetic(DataVisualization::GetSyntheticForType(type_name.GetSP())); } #endif // LLDB_DISABLE_PYTHON |