summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/ValueObjectDynamicValue.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2011-05-31 20:18:39 +0000
committerGreg Clayton <gclayton@apple.com>2011-05-31 20:18:39 +0000
commit5ad639415f2108befb023ca44927995c33fc1e23 (patch)
tree8e930fb5dcfd3e17c1386b5b68d06a25d0d46816 /lldb/source/Core/ValueObjectDynamicValue.cpp
parentaf5a89587e139a08d76d7ad83151f891d3ddf88e (diff)
downloadbcm5719-llvm-5ad639415f2108befb023ca44927995c33fc1e23.tar.gz
bcm5719-llvm-5ad639415f2108befb023ca44927995c33fc1e23.zip
Fix dynamic value objects to do the right thing when the
value fails to evaluate. llvm-svn: 132354
Diffstat (limited to 'lldb/source/Core/ValueObjectDynamicValue.cpp')
-rw-r--r--lldb/source/Core/ValueObjectDynamicValue.cpp25
1 files changed, 8 insertions, 17 deletions
diff --git a/lldb/source/Core/ValueObjectDynamicValue.cpp b/lldb/source/Core/ValueObjectDynamicValue.cpp
index a8d48891ab3..0188ad2099f 100644
--- a/lldb/source/Core/ValueObjectDynamicValue.cpp
+++ b/lldb/source/Core/ValueObjectDynamicValue.cpp
@@ -60,11 +60,8 @@ ValueObjectDynamicValue::GetClangType ()
ConstString
ValueObjectDynamicValue::GetTypeName()
{
- // FIXME: Maybe cache the name, but have to clear it out if the type changes...
- if (!UpdateValueIfNeeded())
- return ConstString("<unknown type>");
-
- if (m_type_sp)
+ const bool success = UpdateValueIfNeeded();
+ if (success && m_type_sp)
return ClangASTType::GetClangTypeName (GetClangType());
else
return m_parent->GetTypeName();
@@ -73,10 +70,8 @@ ValueObjectDynamicValue::GetTypeName()
uint32_t
ValueObjectDynamicValue::CalculateNumChildren()
{
- if (!UpdateValueIfNeeded())
- return 0;
-
- if (m_type_sp)
+ const bool success = UpdateValueIfNeeded();
+ if (success && m_type_sp)
return ClangASTContext::GetNumChildren (GetClangAST (), GetClangType(), true);
else
return m_parent->GetNumChildren();
@@ -85,10 +80,8 @@ ValueObjectDynamicValue::CalculateNumChildren()
clang::ASTContext *
ValueObjectDynamicValue::GetClangAST ()
{
- if (!UpdateValueIfNeeded())
- return NULL;
-
- if (m_type_sp)
+ const bool success = UpdateValueIfNeeded();
+ if (success && m_type_sp)
return m_type_sp->GetClangAST();
else
return m_parent->GetClangAST ();
@@ -97,10 +90,8 @@ ValueObjectDynamicValue::GetClangAST ()
size_t
ValueObjectDynamicValue::GetByteSize()
{
- if (!UpdateValueIfNeeded())
- return 0;
-
- if (m_type_sp)
+ const bool success = UpdateValueIfNeeded();
+ if (success && m_type_sp)
return m_value.GetValueByteSize(GetClangAST(), NULL);
else
return m_parent->GetByteSize();
OpenPOWER on IntegriCloud