From 43484c5cd7b0654d7812a1b486f2733a593d7966 Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Thu, 2 Feb 2012 00:12:47 +0000 Subject: [PATCH] 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. llvm-svn: 149564 --- lldb/scripts/Python/python-extensions.swig | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lldb/scripts/Python/python-extensions.swig b/lldb/scripts/Python/python-extensions.swig index 13ed5578b119..1cf6519b390f 100644 --- a/lldb/scripts/Python/python-extensions.swig +++ b/lldb/scripts/Python/python-extensions.swig @@ -515,10 +515,15 @@ class value(object): 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) %}