From d7373f69cff7df1a9aaa64f18e87964dbb0a7c72 Mon Sep 17 00:00:00 2001 From: Enrico Granata Date: Thu, 31 Oct 2013 18:57:50 +0000 Subject: SBValue::GetValueAsUnsigned()/GetValueAsSigned() should not replicate the Scalar manipulation logic found in ValueObject, but rather just call down to it llvm-svn: 193786 --- lldb/source/Core/ValueObject.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'lldb/source/Core/ValueObject.cpp') 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 -- cgit v1.2.3