summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/ValueObject.cpp
diff options
context:
space:
mode:
authorEnrico Granata <egranata@apple.com>2013-10-31 18:57:50 +0000
committerEnrico Granata <egranata@apple.com>2013-10-31 18:57:50 +0000
commitd7373f69cff7df1a9aaa64f18e87964dbb0a7c72 (patch)
tree77e421d5accf9ac448e1034e23f7ec8e4a6fc0a4 /lldb/source/Core/ValueObject.cpp
parentd3cba699c1a9eb7c98b3a96036ecdea0a16cadd2 (diff)
downloadbcm5719-llvm-d7373f69cff7df1a9aaa64f18e87964dbb0a7c72.tar.gz
bcm5719-llvm-d7373f69cff7df1a9aaa64f18e87964dbb0a7c72.zip
SBValue::GetValueAsUnsigned()/GetValueAsSigned() should not replicate the Scalar manipulation logic found in ValueObject, but rather just call down to it
llvm-svn: 193786
Diffstat (limited to 'lldb/source/Core/ValueObject.cpp')
-rw-r--r--lldb/source/Core/ValueObject.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/lldb/source/Core/ValueObject.cpp b/lldb/source/Core/ValueObject.cpp
index e9aa349d8b2..d39d21a2a0b 100644
--- a/lldb/source/Core/ValueObject.cpp
+++ b/lldb/source/Core/ValueObject.cpp
@@ -1542,6 +1542,27 @@ ValueObject::GetValueAsUnsigned (uint64_t fail_value, bool *success)
return fail_value;
}
+int64_t
+ValueObject::GetValueAsSigned (int64_t fail_value, bool *success)
+{
+ // If our byte size is zero this is an aggregate type that has children
+ if (!GetClangType().IsAggregateType())
+ {
+ Scalar scalar;
+ if (ResolveValue (scalar))
+ {
+ if (success)
+ *success = true;
+ return scalar.SLongLong(fail_value);
+ }
+ // fallthrough, otherwise...
+ }
+
+ if (success)
+ *success = false;
+ return fail_value;
+}
+
// if any more "special cases" are added to ValueObject::DumpPrintableRepresentation() please keep
// this call up to date by returning true for your new special cases. We will eventually move
// to checking this call result before trying to display special cases
OpenPOWER on IntegriCloud