summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/ValueObject.cpp
diff options
context:
space:
mode:
authorJohnny Chen <johnny.chen@apple.com>2012-06-05 19:37:43 +0000
committerJohnny Chen <johnny.chen@apple.com>2012-06-05 19:37:43 +0000
commit3f476c4a7263180f2aaeea7415c9b5b269d3f681 (patch)
treef223ad7806227b598d97b208b79dd8bb3f846cd9 /lldb/source/Core/ValueObject.cpp
parentbaa1ac260bf5cc2b5bcbabaeccef15029b9d9e76 (diff)
downloadbcm5719-llvm-3f476c4a7263180f2aaeea7415c9b5b269d3f681.tar.gz
bcm5719-llvm-3f476c4a7263180f2aaeea7415c9b5b269d3f681.zip
rdar://problem/11597911
Fix confusing error message about "expression did not evaluate to an address" when doing 'watchpoint set expression". Instead of using 0 as the fail_value when invoking ValueObject::GetValueAsUnsigned(), modify the API to take an addition bool pointer (defaults to NULL) to indicate success/failure of value conversion. llvm-svn: 158016
Diffstat (limited to 'lldb/source/Core/ValueObject.cpp')
-rw-r--r--lldb/source/Core/ValueObject.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/lldb/source/Core/ValueObject.cpp b/lldb/source/Core/ValueObject.cpp
index 07af307d755..b3c0a0b8c34 100644
--- a/lldb/source/Core/ValueObject.cpp
+++ b/lldb/source/Core/ValueObject.cpp
@@ -1246,15 +1246,23 @@ ValueObject::GetValueAsCString ()
// if > 8bytes, 0 is returned. this method should mostly be used
// to read address values out of pointers
uint64_t
-ValueObject::GetValueAsUnsigned (uint64_t fail_value)
+ValueObject::GetValueAsUnsigned (uint64_t fail_value, bool *success)
{
// If our byte size is zero this is an aggregate type that has children
if (ClangASTContext::IsAggregateType (GetClangType()) == false)
{
Scalar scalar;
if (ResolveValue (scalar))
+ {
+ if (success)
+ *success = true;
return scalar.GetRawBits64(fail_value);
+ }
+ // fallthrough, otherwise...
}
+
+ if (success)
+ *success = false;
return fail_value;
}
OpenPOWER on IntegriCloud