summaryrefslogtreecommitdiffstats
path: root/lldb/scripts/Python/python-extensions.swig
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2012-02-02 00:12:47 +0000
committerGreg Clayton <gclayton@apple.com>2012-02-02 00:12:47 +0000
commit43484c5cd7b0654d7812a1b486f2733a593d7966 (patch)
tree77c196a12eccd520fe44d85a9c83f53585b52b39 /lldb/scripts/Python/python-extensions.swig
parent2badba5f272f304bde790a5c92fbbb56654006bf (diff)
downloadbcm5719-llvm-43484c5cd7b0654d7812a1b486f2733a593d7966.tar.gz
bcm5719-llvm-43484c5cd7b0654d7812a1b486f2733a593d7966.zip
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
Diffstat (limited to 'lldb/scripts/Python/python-extensions.swig')
-rw-r--r--lldb/scripts/Python/python-extensions.swig9
1 files changed, 7 insertions, 2 deletions
diff --git a/lldb/scripts/Python/python-extensions.swig b/lldb/scripts/Python/python-extensions.swig
index 13ed5578b11..1cf6519b390 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)
%}
OpenPOWER on IntegriCloud