summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/ValueObject.cpp
diff options
context:
space:
mode:
authorEnrico Granata <granata.enrico@gmail.com>2011-08-04 01:41:02 +0000
committerEnrico Granata <granata.enrico@gmail.com>2011-08-04 01:41:02 +0000
commit6fd87d5d33c677badffcab70b60e8dcc169de07e (patch)
treecbfbcdc89fc62be7c2d37d5e33883d9704ab8e08 /lldb/source/Core/ValueObject.cpp
parentb224db72b02a17981bec61c71c02566b542f9667 (diff)
downloadbcm5719-llvm-6fd87d5d33c677badffcab70b60e8dcc169de07e.tar.gz
bcm5719-llvm-6fd87d5d33c677badffcab70b60e8dcc169de07e.zip
APIs to GetValueAsSigned/Unsigned() in SBValue now also accept an SBError parameter to give more info about any problem
The synthetic children providers now use the new (safer) APIs to get the values of objects As a side effect, fixed an issue in ValueObject where ResolveValue() was not always updating the value before reading it llvm-svn: 136861
Diffstat (limited to 'lldb/source/Core/ValueObject.cpp')
-rw-r--r--lldb/source/Core/ValueObject.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/lldb/source/Core/ValueObject.cpp b/lldb/source/Core/ValueObject.cpp
index c9310753d96..fce00f6d4f3 100644
--- a/lldb/source/Core/ValueObject.cpp
+++ b/lldb/source/Core/ValueObject.cpp
@@ -331,12 +331,17 @@ ValueObject::GetValue() const
bool
ValueObject::ResolveValue (Scalar &scalar)
{
- ExecutionContext exe_ctx;
- ExecutionContextScope *exe_scope = GetExecutionContextScope();
- if (exe_scope)
- exe_scope->CalculateExecutionContext(exe_ctx);
- scalar = m_value.ResolveValue(&exe_ctx, GetClangAST ());
- return scalar.IsValid();
+ if (UpdateValueIfNeeded(false)) // make sure that you are up to date before returning anything
+ {
+ ExecutionContext exe_ctx;
+ ExecutionContextScope *exe_scope = GetExecutionContextScope();
+ if (exe_scope)
+ exe_scope->CalculateExecutionContext(exe_ctx);
+ scalar = m_value.ResolveValue(&exe_ctx, GetClangAST ());
+ return scalar.IsValid();
+ }
+ else
+ return false;
}
bool
OpenPOWER on IntegriCloud