summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/ValueObject.cpp
diff options
context:
space:
mode:
authorEnrico Granata <egranata@apple.com>2013-05-31 19:18:19 +0000
committerEnrico Granata <egranata@apple.com>2013-05-31 19:18:19 +0000
commitb294fd203764652fe4bb4035a8646612cfc56b34 (patch)
treef6e481bde6134fb13b7ea5d7435318941aa2f368 /lldb/source/Core/ValueObject.cpp
parent8c23472265713dde9f185aba87b5fb73714d8867 (diff)
downloadbcm5719-llvm-b294fd203764652fe4bb4035a8646612cfc56b34.tar.gz
bcm5719-llvm-b294fd203764652fe4bb4035a8646612cfc56b34.zip
<rdar://problem/14035604>
Fixing an issue where formats would not propagate from parents to children in all cases Details follow: an SBValue has children and those are fetched along with their values Now, one calls SBValue::SetFormat() on the parent Technically, the format choices should propagate onto the children (see ValueObject::GetFormat()) But if the children values are already fetched, they won't notice the format change and won't update themselves This commit fixes that by making ValueObject::GetValueAsCString() check if any format change intervened from the previous call to the current one A test case is also added llvm-svn: 183030
Diffstat (limited to 'lldb/source/Core/ValueObject.cpp')
-rw-r--r--lldb/source/Core/ValueObject.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/lldb/source/Core/ValueObject.cpp b/lldb/source/Core/ValueObject.cpp
index 34ceb3a71cb..611a77c7fd0 100644
--- a/lldb/source/Core/ValueObject.cpp
+++ b/lldb/source/Core/ValueObject.cpp
@@ -82,6 +82,7 @@ ValueObject::ValueObject (ValueObject &parent) :
m_synthetic_value(NULL),
m_deref_valobj(NULL),
m_format (eFormatDefault),
+ m_last_format (eFormatDefault),
m_last_format_mgr_revision(0),
m_type_summary_sp(),
m_type_format_sp(),
@@ -127,6 +128,7 @@ ValueObject::ValueObject (ExecutionContextScope *exe_scope,
m_synthetic_value(NULL),
m_deref_valobj(NULL),
m_format (eFormatDefault),
+ m_last_format (eFormatDefault),
m_last_format_mgr_revision(0),
m_type_summary_sp(),
m_type_format_sp(),
@@ -1441,7 +1443,7 @@ ValueObject::GetValueAsCString (lldb::Format format,
const char *
ValueObject::GetValueAsCString ()
{
- if (UpdateValueIfNeeded(true) && m_value_str.empty())
+ if (UpdateValueIfNeeded(true))
{
lldb::Format my_format = GetFormat();
if (my_format == lldb::eFormatDefault)
@@ -1468,13 +1470,17 @@ ValueObject::GetValueAsCString ()
}
}
}
- if (GetValueAsCString(my_format, m_value_str))
+ if (my_format != m_last_format || m_value_str.empty())
{
- if (!m_value_did_change && m_old_value_valid)
+ m_last_format = my_format;
+ if (GetValueAsCString(my_format, m_value_str))
{
- // The value was gotten successfully, so we consider the
- // value as changed if the value string differs
- SetValueDidChange (m_old_value_str != m_value_str);
+ if (!m_value_did_change && m_old_value_valid)
+ {
+ // The value was gotten successfully, so we consider the
+ // value as changed if the value string differs
+ SetValueDidChange (m_old_value_str != m_value_str);
+ }
}
}
}
OpenPOWER on IntegriCloud