[Lldb-commits] [lldb] r253027 - Remove a broken hack from Scalar::ULongLong and fix a test
Tamas Berghammer via lldb-commits
lldb-commits at lists.llvm.org
Fri Nov 13 02:51:35 PST 2015
Author: tberghammer
Date: Fri Nov 13 04:51:35 2015
New Revision: 253027
URL: http://llvm.org/viewvc/llvm-project?rev=253027&view=rev
Log:
Remove a broken hack from Scalar::ULongLong and fix a test
Change Test-rdar-12481949.py to expect GetValueAsUnsigned() to return
0xffffffff if the variable is an int32_t (signed, 4 byte integer) with
value of -1. The previous expectation where we expected the value to be
0xffffffffffffffff doesn't make sense as nothing explains why we would
treat it as an 8 byte value.
This CL also removes a hack from Scalar::ULongLong what was most likely
added to get this test passing as it only worked in case the value of
the variable is -1 and didn't make any sense even in that case.
Differential revision: http://reviews.llvm.org/D14611
Modified:
lldb/trunk/packages/Python/lldbsuite/test/python_api/rdar-12481949/Test-rdar-12481949.py
lldb/trunk/source/Core/Scalar.cpp
Modified: lldb/trunk/packages/Python/lldbsuite/test/python_api/rdar-12481949/Test-rdar-12481949.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/python_api/rdar-12481949/Test-rdar-12481949.py?rev=253027&r1=253026&r2=253027&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/python_api/rdar-12481949/Test-rdar-12481949.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/python_api/rdar-12481949/Test-rdar-12481949.py Fri Nov 13 04:51:35 2015
@@ -50,5 +50,5 @@ class Radar12481949DataFormatterTestCase
self.assertTrue(self.frame().FindVariable("myvar").GetValueAsSigned() != 0xFFFFFFFFFFFFFFFF, "GetValueAsSigned() does not say 0xFFFFFFFFFFFFFFFF")
self.assertTrue(self.frame().FindVariable("myvar").GetValueAsUnsigned() != -1, "GetValueAsUnsigned() does not say -1")
- self.assertTrue(self.frame().FindVariable("myvar").GetValueAsUnsigned() == 0xFFFFFFFFFFFFFFFF, "GetValueAsUnsigned() says 0xFFFFFFFFFFFFFFFF")
- self.assertTrue(self.frame().FindVariable("myvar").GetValueAsSigned() != 0xFFFFFFFF, "GetValueAsUnsigned() does not say 0xFFFFFFFF")
+ self.assertTrue(self.frame().FindVariable("myvar").GetValueAsUnsigned() == 0xFFFFFFFF, "GetValueAsUnsigned() says 0xFFFFFFFF")
+ self.assertTrue(self.frame().FindVariable("myvar").GetValueAsUnsigned() != 0xFFFFFFFFFFFFFFFF, "GetValueAsUnsigned() does not says 0xFFFFFFFFFFFFFFFF")
Modified: lldb/trunk/source/Core/Scalar.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Scalar.cpp?rev=253027&r1=253026&r2=253027&view=diff
==============================================================================
--- lldb/trunk/source/Core/Scalar.cpp (original)
+++ lldb/trunk/source/Core/Scalar.cpp Fri Nov 13 04:51:35 2015
@@ -1574,8 +1574,6 @@ Scalar::ULongLong(unsigned long long fai
case e_ulonglong:
case e_sint128:
case e_uint128:
- if(m_integer.isAllOnesValue())
- return *(const ulonglong_t *)(llvm::APInt::getAllOnesValue(128)).getRawData();
return *(const ulonglong_t *)m_integer.getRawData();
case e_float:
return (ulonglong_t)m_float.convertToFloat();
More information about the lldb-commits
mailing list