[Lldb-commits] [lldb] r165344 - /lldb/trunk/scripts/Python/python-extensions.swig
Enrico Granata
egranata at apple.com
Fri Oct 5 16:20:59 PDT 2012
Author: enrico
Date: Fri Oct 5 18:20:58 2012
New Revision: 165344
URL: http://llvm.org/viewvc/llvm-project?rev=165344&view=rev
Log:
<rdar://problem/12442990> Fix the implementation of lldb.value.__eq__
Modified:
lldb/trunk/scripts/Python/python-extensions.swig
Modified: lldb/trunk/scripts/Python/python-extensions.swig
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/python-extensions.swig?rev=165344&r1=165343&r2=165344&view=diff
==============================================================================
--- lldb/trunk/scripts/Python/python-extensions.swig (original)
+++ lldb/trunk/scripts/Python/python-extensions.swig Fri Oct 5 18:20:58 2012
@@ -690,7 +690,15 @@
return '0x%x' % self.sbvalue.GetValueAsUnsigned()
def __eq__(self, other):
- return self.sbvalue.GetValueAsUnsigned() == self.sbvalue.GetValueAsUnsigned()
+ self_err = SBError()
+ other_err = SBError()
+ self_val = self.sbvalue.GetValueAsUnsigned(self_err)
+ if self_err.fail:
+ raise ValueError("unable to extract value of self")
+ other_val = other.sbvalue.GetValueAsUnsigned(other_err)
+ if other_err.fail:
+ raise ValueError("unable to extract value of other")
+ return self_val == other_val
def __neq__(self, other):
return not self.__eq__(other)
More information about the lldb-commits
mailing list