diff --git a/lldb/include/lldb/Core/ValueObject.h b/lldb/include/lldb/Core/ValueObject.h --- a/lldb/include/lldb/Core/ValueObject.h +++ b/lldb/include/lldb/Core/ValueObject.h @@ -733,17 +733,13 @@ } void SetSyntheticChildren(const lldb::SyntheticChildrenSP &synth_sp) { - llvm::errs() << "set synthetic children called\n"; - llvm::errs() << "synth_sp: " << synth_sp.get() << "\n"; if (synth_sp.get() == m_synthetic_children_sp.get()) return; ClearUserVisibleData(eClearUserVisibleDataItemsSyntheticChildren); - llvm::errs() << "actually set m_synthetic_children_sp\n"; m_synthetic_children_sp = synth_sp; } lldb::SyntheticChildrenSP GetSyntheticChildren() { - llvm::errs() << "inside get synthetic children\n"; UpdateFormatsIfNeeded(); return m_synthetic_children_sp; } diff --git a/lldb/include/lldb/Core/ValueObjectSyntheticFilter.h b/lldb/include/lldb/Core/ValueObjectSyntheticFilter.h --- a/lldb/include/lldb/Core/ValueObjectSyntheticFilter.h +++ b/lldb/include/lldb/Core/ValueObjectSyntheticFilter.h @@ -66,7 +66,7 @@ bool HasSyntheticValue() override { return false; } - bool IsSynthetic() override { llvm::errs() << "is synthetic\n"; return true; } + bool IsSynthetic() override { return true; } void CalculateSyntheticValue() override {} diff --git a/lldb/source/Core/ValueObject.cpp b/lldb/source/Core/ValueObject.cpp --- a/lldb/source/Core/ValueObject.cpp +++ b/lldb/source/Core/ValueObject.cpp @@ -218,10 +218,8 @@ SetValueFormat(DataVisualization::GetFormat(*this, eNoDynamicValues)); SetSummaryFormat( DataVisualization::GetSummaryFormat(*this, GetDynamicValueType())); - llvm::errs() << "about to call SetSyntheticChildren\n"; SetSyntheticChildren( DataVisualization::GetSyntheticChildren(*this, GetDynamicValueType())); - llvm::errs() << "SetSyntheticChildren call finished\n"; } return any_change; @@ -546,6 +544,7 @@ CompilerType child_compiler_type; ExecutionContext exe_ctx(GetExecutionContextRef()); + child_compiler_type = GetCompilerType().GetChildCompilerTypeAtIndex( &exe_ctx, idx, transparent_pointers, omit_empty_base_classes, ignore_array_bounds, child_name_str, child_byte_size, child_byte_offset, @@ -1169,6 +1168,7 @@ Stream &s, ValueObjectRepresentationStyle val_obj_display, Format custom_format, PrintableRepresentationSpecialCases special, bool do_dump_error) { + // If the ValueObject has an error, we might end up dumping the type, which // is useful, but if we don't even have a type, then don't examine the object // further as that's not meaningful, only the error is. @@ -1813,7 +1813,6 @@ } void ValueObject::CalculateSyntheticValue() { - llvm::errs() << "calculatesyntheticvalue\n"; TargetSP target_sp(GetTargetSP()); if (target_sp && !target_sp->GetEnableSyntheticValue()) { m_synthetic_value = nullptr; @@ -1824,20 +1823,14 @@ if (!UpdateFormatsIfNeeded() && m_synthetic_value) return; - llvm::errs() << "1\n"; if (m_synthetic_children_sp.get() == nullptr) return; - llvm::errs() << "2\n"; - if (current_synth_sp == m_synthetic_children_sp && m_synthetic_value) return; - llvm::errs() << "3\n"; - m_synthetic_value = new ValueObjectSynthetic(*this, m_synthetic_children_sp); - llvm::errs() << "set synthetic children\n"; } void ValueObject::CalculateDynamicValue(DynamicValueType use_dynamic) { @@ -2674,6 +2667,7 @@ uint64_t language_flags = 0; ExecutionContext exe_ctx(GetExecutionContextRef()); + child_compiler_type = compiler_type.GetChildCompilerTypeAtIndex( &exe_ctx, 0, transparent_pointers, omit_empty_base_classes, ignore_array_bounds, child_name_str, child_byte_size, child_byte_offset, diff --git a/lldb/source/DataFormatters/DataVisualization.cpp b/lldb/source/DataFormatters/DataVisualization.cpp --- a/lldb/source/DataFormatters/DataVisualization.cpp +++ b/lldb/source/DataFormatters/DataVisualization.cpp @@ -52,7 +52,6 @@ lldb::SyntheticChildrenSP DataVisualization::GetSyntheticChildren(ValueObject &valobj, lldb::DynamicValueType use_dynamic) { - llvm::errs() << "inside get synthetic children2\n"; return GetFormatManager().GetSyntheticChildren(valobj, use_dynamic); } diff --git a/lldb/source/DataFormatters/FormatManager.cpp b/lldb/source/DataFormatters/FormatManager.cpp --- a/lldb/source/DataFormatters/FormatManager.cpp +++ b/lldb/source/DataFormatters/FormatManager.cpp @@ -588,13 +588,9 @@ ImplSP FormatManager::GetHardcoded(FormattersMatchData &match_data) { ImplSP retval_sp; for (lldb::LanguageType lang_type : match_data.GetCandidateLanguages()) { - llvm::errs() << "lang type: " << lang_type << "\n"; if (LanguageCategory *lang_category = GetCategoryForLanguage(lang_type)) { - llvm::errs() << "lang_category: " << lang_category << "\n"; - if (lang_category->GetHardcoded(*this, match_data, retval_sp)) { - llvm::errs() << "lang_category->GetHardcoded succeeded\n"; + if (lang_category->GetHardcoded(*this, match_data, retval_sp)) return retval_sp; - } } } return retval_sp; @@ -612,12 +608,9 @@ template ImplSP FormatManager::Get(ValueObject &valobj, lldb::DynamicValueType use_dynamic) { - llvm::errs() << "format manager get\n"; - llvm::errs() << "valobj dynamic value type: " << valobj.DoesProvideSyntheticValue() << "\n"; FormattersMatchData match_data(valobj, use_dynamic); if (ImplSP retval_sp = GetCached(match_data)) return retval_sp; - llvm::errs() << "ckpt 1\n"; Log *log = GetLog(LLDBLog::DataFormatters); @@ -632,8 +625,6 @@ } } } - llvm::errs() << "ckpt 2\n"; - LLDB_LOGF(log, FORMAT_LOG("Search failed. Giving hardcoded a chance.")); return GetHardcoded(match_data); @@ -687,7 +678,6 @@ lldb::SyntheticChildrenSP FormatManager::GetSyntheticChildren(ValueObject &valobj, lldb::DynamicValueType use_dynamic) { - llvm::errs() << "format manager get synthetic children\n"; return Get(valobj, use_dynamic); } diff --git a/lldb/source/DataFormatters/LanguageCategory.cpp b/lldb/source/DataFormatters/LanguageCategory.cpp --- a/lldb/source/DataFormatters/LanguageCategory.cpp +++ b/lldb/source/DataFormatters/LanguageCategory.cpp @@ -71,20 +71,16 @@ template <> auto &LanguageCategory::GetHardcodedFinder() { - llvm::errs() << "get hardedcoded finder type formatn\n"; return m_hardcoded_formats; } template <> auto &LanguageCategory::GetHardcodedFinder() { - llvm::errs() << "get hardedcoded finder type summary\n"; return m_hardcoded_summaries; } template <> auto &LanguageCategory::GetHardcodedFinder() { - llvm::errs() << "get hardedcoded finder synthetic children\n"; - return m_hardcoded_synthetics; } @@ -94,19 +90,14 @@ bool LanguageCategory::GetHardcoded(FormatManager &fmt_mgr, FormattersMatchData &match_data, ImplSP &retval_sp) { - llvm::errs() << "languagecategory::GetHardcoded\n"; - if (!IsEnabled()) { - llvm::errs() << "not enabled\n"; + if (!IsEnabled()) return false; - } ValueObject &valobj(match_data.GetValueObject()); lldb::DynamicValueType use_dynamic(match_data.GetDynamicValueType()); - llvm::errs() << "language category checkpoint\n"; + for (auto &candidate : GetHardcodedFinder()) { - llvm::errs() << "looking at candidates\n;"; if (auto result = candidate(valobj, use_dynamic, fmt_mgr)) { - llvm::errs() << "result\n"; retval_sp = result; break; }