[Lldb-commits] [lldb] r149564 - /lldb/trunk/scripts/Python/python-extensions.swig

Greg Clayton gclayton at apple.com
Wed Feb 1 16:12:47 PST 2012


Author: gclayton
Date: Wed Feb  1 18:12:47 2012
New Revision: 149564

URL: http://llvm.org/viewvc/llvm-project?rev=149564&view=rev
Log:
When outputting hex values use unsigned integer values so we don't get
negative hex values. Also added a very rudimentary version of the == and !=
operators to the lldb.value helper class.


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=149564&r1=149563&r2=149564&view=diff
==============================================================================
--- lldb/trunk/scripts/Python/python-extensions.swig (original)
+++ lldb/trunk/scripts/Python/python-extensions.swig Wed Feb  1 18:12:47 2012
@@ -515,10 +515,15 @@
         return float (self.sbvalue.GetValueAsSigned())
         
     def __oct__(self):
-        return '0%o' % self.sbvalue.GetValueAsSigned()
+        return '0%o' % self.sbvalue.GetValueAsUnsigned()
         
     def __hex__(self):
-        return '0x%x' % self.sbvalue.GetValueAsSigned()
+        return '0x%x' % self.sbvalue.GetValueAsUnsigned()
 
+    def __eq__(self, other):
+        return self.sbvalue.GetValueAsUnsigned() == self.sbvalue.GetValueAsUnsigned()
+                                                                    
+    def __neq__(self, other):
+        return not self.__eq__(other)
 %}
 





More information about the lldb-commits mailing list