summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Core')
-rw-r--r--lldb/source/Core/Debugger.cpp3
-rw-r--r--lldb/source/Core/FormatManager.cpp26
-rw-r--r--lldb/source/Core/ValueObject.cpp9
-rw-r--r--lldb/source/Core/ValueObjectSyntheticFilter.cpp14
4 files changed, 36 insertions, 16 deletions
diff --git a/lldb/source/Core/Debugger.cpp b/lldb/source/Core/Debugger.cpp
index 6b93aa971a0..d7f1460e7fb 100644
--- a/lldb/source/Core/Debugger.cpp
+++ b/lldb/source/Core/Debugger.cpp
@@ -1164,7 +1164,8 @@ Debugger::FormatPrompt
if (*var_name_begin == 's')
{
- valobj = valobj->GetSyntheticValue().get();
+ if (!valobj->IsSynthetic())
+ valobj = valobj->GetSyntheticValue().get();
if (!valobj)
break;
var_name_begin++;
diff --git a/lldb/source/Core/FormatManager.cpp b/lldb/source/Core/FormatManager.cpp
index 0496780724a..693ae263c96 100644
--- a/lldb/source/Core/FormatManager.cpp
+++ b/lldb/source/Core/FormatManager.cpp
@@ -639,18 +639,24 @@ FormatManager::LoadSTLFormatters()
SyntheticChildren::Flags stl_synth_flags;
stl_synth_flags.SetCascades(true).SetSkipPointers(false).SetSkipReferences(false);
- gnu_category_sp->GetRegexSyntheticNavigator()->Add(RegularExpressionSP(new RegularExpression("^(std::)?vector<.+>$")),
+ gnu_category_sp->GetRegexSyntheticNavigator()->Add(RegularExpressionSP(new RegularExpression("^std::vector<.+>(( )?&)?$")),
SyntheticChildrenSP(new TypeSyntheticImpl(stl_synth_flags,
"gnu_libstdcpp.StdVectorSynthProvider")));
- gnu_category_sp->GetRegexSyntheticNavigator()->Add(RegularExpressionSP(new RegularExpression("^(std::)?map<.+> >$")),
+ gnu_category_sp->GetRegexSyntheticNavigator()->Add(RegularExpressionSP(new RegularExpression("^std::map<.+> >(( )?&)?$")),
SyntheticChildrenSP(new TypeSyntheticImpl(stl_synth_flags,
"gnu_libstdcpp.StdMapSynthProvider")));
- gnu_category_sp->GetRegexSyntheticNavigator()->Add(RegularExpressionSP(new RegularExpression("^(std::)?list<.+>$")),
+ gnu_category_sp->GetRegexSyntheticNavigator()->Add(RegularExpressionSP(new RegularExpression("^std::list<.+>(( )?&)?$")),
SyntheticChildrenSP(new TypeSyntheticImpl(stl_synth_flags,
"gnu_libstdcpp.StdListSynthProvider")));
stl_summary_flags.SetDontShowChildren(false);
- gnu_category_sp->GetRegexSummaryNavigator()->Add(RegularExpressionSP(new RegularExpression("^(std::)?vector<.+>$")),
+ gnu_category_sp->GetRegexSummaryNavigator()->Add(RegularExpressionSP(new RegularExpression("^std::vector<.+>(( )?&)?$")),
+ TypeSummaryImplSP(new StringSummaryFormat(stl_summary_flags,
+ "size=${svar%#}")));
+ gnu_category_sp->GetRegexSummaryNavigator()->Add(RegularExpressionSP(new RegularExpression("^std::map<.+> >(( )?&)?$")),
+ TypeSummaryImplSP(new StringSummaryFormat(stl_summary_flags,
+ "size=${svar%#}")));
+ gnu_category_sp->GetRegexSummaryNavigator()->Add(RegularExpressionSP(new RegularExpression("^std::list<.+>(( )?&)?$")),
TypeSummaryImplSP(new StringSummaryFormat(stl_summary_flags,
"size=${svar%#}")));
#endif
@@ -682,22 +688,22 @@ FormatManager::LoadLibcxxFormatters()
SyntheticChildren::Flags stl_synth_flags;
stl_synth_flags.SetCascades(true).SetSkipPointers(false).SetSkipReferences(false);
- libcxx_category_sp->GetRegexSyntheticNavigator()->Add(RegularExpressionSP(new RegularExpression("^(std::__1::)vector<.+>$")),
+ libcxx_category_sp->GetRegexSyntheticNavigator()->Add(RegularExpressionSP(new RegularExpression("^std::__1::vector<.+>(( )?&)?$")),
SyntheticChildrenSP(new TypeSyntheticImpl(stl_synth_flags,
"libcxx.stdvector_SynthProvider")));
- libcxx_category_sp->GetRegexSyntheticNavigator()->Add(RegularExpressionSP(new RegularExpression("^(std::__1::)list<.+>$")),
+ libcxx_category_sp->GetRegexSyntheticNavigator()->Add(RegularExpressionSP(new RegularExpression("^std::__1::list<.+>(( )?&)?$")),
SyntheticChildrenSP(new TypeSyntheticImpl(stl_synth_flags,
"libcxx.stdlist_SynthProvider")));
- libcxx_category_sp->GetRegexSyntheticNavigator()->Add(RegularExpressionSP(new RegularExpression("^(std::__1::)map<.+> >$")),
+ libcxx_category_sp->GetRegexSyntheticNavigator()->Add(RegularExpressionSP(new RegularExpression("^std::__1::map<.+> >(( )?&)?$")),
SyntheticChildrenSP(new TypeSyntheticImpl(stl_synth_flags,
"libcxx.stdmap_SynthProvider")));
stl_summary_flags.SetDontShowChildren(false);
- libcxx_category_sp->GetRegexSummaryNavigator()->Add(RegularExpressionSP(new RegularExpression("^(std::__1::)vector<.+>$")),
+ libcxx_category_sp->GetRegexSummaryNavigator()->Add(RegularExpressionSP(new RegularExpression("^std::__1::vector<.+>(( )?&)?")),
TypeSummaryImplSP(new StringSummaryFormat(stl_summary_flags, "size=${svar%#}")));
- libcxx_category_sp->GetRegexSummaryNavigator()->Add(RegularExpressionSP(new RegularExpression("^(std::__1::)list<.+>$")),
+ libcxx_category_sp->GetRegexSummaryNavigator()->Add(RegularExpressionSP(new RegularExpression("^std::__1::list<.+>(( )?&)?$")),
TypeSummaryImplSP(new StringSummaryFormat(stl_summary_flags, "size=${svar%#}")));
- libcxx_category_sp->GetRegexSummaryNavigator()->Add(RegularExpressionSP(new RegularExpression("^(std::__1::)map<.+> >$")),
+ libcxx_category_sp->GetRegexSummaryNavigator()->Add(RegularExpressionSP(new RegularExpression("^std::__1::map<.+> >(( )?&)?$")),
TypeSummaryImplSP(new StringSummaryFormat(stl_summary_flags, "size=${svar%#}")));
#endif
}
diff --git a/lldb/source/Core/ValueObject.cpp b/lldb/source/Core/ValueObject.cpp
index e072b491652..57f887b20f6 100644
--- a/lldb/source/Core/ValueObject.cpp
+++ b/lldb/source/Core/ValueObject.cpp
@@ -572,6 +572,7 @@ ValueObject::GetChildMemberWithName (const ConstString &name, bool can_create)
uint32_t
ValueObject::GetNumChildren ()
{
+ UpdateValueIfNeeded();
if (!m_children_count_valid)
{
SetNumChildren (CalculateNumChildren());
@@ -2009,6 +2010,13 @@ ValueObject::CalculateSyntheticValue (bool use_synthetic)
if (use_synthetic == false)
return;
+ TargetSP target_sp(GetTargetSP());
+ if (target_sp && (target_sp->GetEnableSyntheticValue() == false || target_sp->GetSuppressSyntheticValue() == true))
+ {
+ m_synthetic_value = NULL;
+ return;
+ }
+
if (!UpdateFormatsIfNeeded(m_last_format_mgr_dynamic) && m_synthetic_value)
return;
@@ -3317,6 +3325,7 @@ DumpValueObject_Impl (Stream &s,
ValueObject* synth_valobj;
ValueObjectSP synth_valobj_sp = valobj->GetSyntheticValue (options.m_use_synthetic);
synth_valobj = (synth_valobj_sp ? synth_valobj_sp.get() : valobj);
+
uint32_t num_children = synth_valobj->GetNumChildren();
bool print_dotdotdot = false;
if (num_children)
diff --git a/lldb/source/Core/ValueObjectSyntheticFilter.cpp b/lldb/source/Core/ValueObjectSyntheticFilter.cpp
index 6d9337b623c..56eb9f6c56e 100644
--- a/lldb/source/Core/ValueObjectSyntheticFilter.cpp
+++ b/lldb/source/Core/ValueObjectSyntheticFilter.cpp
@@ -25,7 +25,7 @@ ValueObjectSynthetic::ValueObjectSynthetic (ValueObject &parent, lldb::Synthetic
m_synth_filter_ap(filter->GetFrontEnd(parent)),
m_children_byindex(),
m_name_toindex(),
- m_children_count(UINT32_MAX)
+ m_synthetic_children_count(UINT32_MAX)
{
#ifdef LLDB_CONFIGURATION_DEBUG
std::string new_name(parent.GetName().AsCString());
@@ -56,9 +56,9 @@ uint32_t
ValueObjectSynthetic::CalculateNumChildren()
{
UpdateValueIfNeeded();
- if (m_children_count < UINT32_MAX)
- return m_children_count;
- return (m_children_count = m_synth_filter_ap->CalculateNumChildren());
+ if (m_synthetic_children_count < UINT32_MAX)
+ return m_synthetic_children_count;
+ return (m_synthetic_children_count = m_synth_filter_ap->CalculateNumChildren());
}
clang::ASTContext *
@@ -99,7 +99,11 @@ ValueObjectSynthetic::UpdateValue ()
// filter said that cached values are stale
m_children_byindex.clear();
m_name_toindex.clear();
- m_children_count = UINT32_MAX;
+ // usually, an object's value can change but this does not alter its children count
+ // for a synthetic VO that might indeed happen, so we need to tell the upper echelons
+ // that they need to come back to us asking for children
+ m_children_count_valid = false;
+ m_synthetic_children_count = UINT32_MAX;
}
SetValueIsValid(true);
OpenPOWER on IntegriCloud