From 5559406ae5d21fab0bcd6a07347f4f928d3c7ce8 Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Wed, 4 Sep 2019 18:59:06 +0000 Subject: [PATCH] [Python] Fix whitespace before making changes (NFC) llvm-svn: 370952 --- lldb/scripts/Python/python-extensions.swig | 328 ++++++++++++++--------------- 1 file changed, 164 insertions(+), 164 deletions(-) diff --git a/lldb/scripts/Python/python-extensions.swig b/lldb/scripts/Python/python-extensions.swig index 892e1af..25fec92 100644 --- a/lldb/scripts/Python/python-extensions.swig +++ b/lldb/scripts/Python/python-extensions.swig @@ -46,18 +46,18 @@ return lldb_private::PythonString("").release(); } %clearnothreadallow; - - %pythoncode %{ + + %pythoncode %{ def __eq__(self, rhs): - if not isinstance(rhs, type(self)): - return False - + if not isinstance(rhs, type(self)): + return False + return getattr(_lldb,self.__class__.__name__+"___eq__")(self, rhs) - + def __ne__(self, rhs): - if not isinstance(rhs, type(self)): - return True - + if not isinstance(rhs, type(self)): + return True + return getattr(_lldb,self.__class__.__name__+"___ne__")(self, rhs) %} @@ -97,17 +97,17 @@ } %extend lldb::SBBroadcaster { - %pythoncode %{ + %pythoncode %{ def __eq__(self, rhs): - if not isinstance(rhs, type(self)): - return False - + if not isinstance(rhs, type(self)): + return False + return getattr(_lldb,self.__class__.__name__+"___eq__")(self, rhs) - + def __ne__(self, rhs): - if not isinstance(rhs, type(self)): - return True - + if not isinstance(rhs, type(self)): + return True + return getattr(_lldb,self.__class__.__name__+"___ne__")(self, rhs) %} } @@ -127,7 +127,7 @@ return lldb_private::PythonString("").release(); } %clearnothreadallow; - + /* the write() and flush() calls are not part of the SB API proper, and are solely for Python usage they are meant to make an SBCommandReturnObject into a file-like object so that instructions of the sort print >>sb_command_return_object, "something" @@ -156,17 +156,17 @@ return lldb_private::PythonString("").release(); } %clearnothreadallow; - %pythoncode %{ + %pythoncode %{ def __eq__(self, rhs): - if not isinstance(rhs, type(self)): - return False - + if not isinstance(rhs, type(self)): + return False + return getattr(_lldb,self.__class__.__name__+"___eq__")(self, rhs) - + def __ne__(self, rhs): - if not isinstance(rhs, type(self)): - return True - + if not isinstance(rhs, type(self)): + return True + return getattr(_lldb,self.__class__.__name__+"___ne__")(self, rhs) %} } @@ -217,18 +217,18 @@ return lldb_private::PythonString("").release(); } %clearnothreadallow; - - %pythoncode %{ + + %pythoncode %{ def __eq__(self, rhs): - if not isinstance(rhs, type(self)): - return False - + if not isinstance(rhs, type(self)): + return False + return getattr(_lldb,self.__class__.__name__+"___eq__")(self, rhs) - + def __ne__(self, rhs): - if not isinstance(rhs, type(self)): - return True - + if not isinstance(rhs, type(self)): + return True + return getattr(_lldb,self.__class__.__name__+"___ne__")(self, rhs) %} @@ -296,18 +296,18 @@ return lldb_private::PythonString("").release(); } %clearnothreadallow; - - %pythoncode %{ + + %pythoncode %{ def __eq__(self, rhs): - if not isinstance(rhs, type(self)): - return False - + if not isinstance(rhs, type(self)): + return False + return getattr(_lldb,self.__class__.__name__+"___eq__")(self, rhs) - + def __ne__(self, rhs): - if not isinstance(rhs, type(self)): - return True - + if not isinstance(rhs, type(self)): + return True + return getattr(_lldb,self.__class__.__name__+"___ne__")(self, rhs) %} @@ -359,18 +359,18 @@ return lldb_private::PythonString("").release(); } %clearnothreadallow; - - %pythoncode %{ + + %pythoncode %{ def __eq__(self, rhs): - if not isinstance(rhs, type(self)): - return False - + if not isinstance(rhs, type(self)): + return False + return getattr(_lldb,self.__class__.__name__+"___eq__")(self, rhs) - + def __ne__(self, rhs): - if not isinstance(rhs, type(self)): - return True - + if not isinstance(rhs, type(self)): + return True + return getattr(_lldb,self.__class__.__name__+"___ne__")(self, rhs) %} } @@ -407,18 +407,18 @@ return lldb_private::PythonString("").release(); } %clearnothreadallow; - - %pythoncode %{ + + %pythoncode %{ def __eq__(self, rhs): - if not isinstance(rhs, type(self)): - return False - + if not isinstance(rhs, type(self)): + return False + return getattr(_lldb,self.__class__.__name__+"___eq__")(self, rhs) - + def __ne__(self, rhs): - if not isinstance(rhs, type(self)): - return True - + if not isinstance(rhs, type(self)): + return True + return getattr(_lldb,self.__class__.__name__+"___ne__")(self, rhs) %} } @@ -488,18 +488,18 @@ return lldb_private::PythonString("").release(); } %clearnothreadallow; - - %pythoncode %{ + + %pythoncode %{ def __eq__(self, rhs): - if not isinstance(rhs, type(self)): - return False - + if not isinstance(rhs, type(self)): + return False + return getattr(_lldb,self.__class__.__name__+"___eq__")(self, rhs) - + def __ne__(self, rhs): - if not isinstance(rhs, type(self)): - return True - + if not isinstance(rhs, type(self)): + return True + return getattr(_lldb,self.__class__.__name__+"___ne__")(self, rhs) %} } @@ -534,15 +534,15 @@ %clearnothreadallow; %pythoncode %{ def __eq__(self, rhs): - if not isinstance(rhs, type(self)): - return False - + if not isinstance(rhs, type(self)): + return False + return getattr(_lldb,self.__class__.__name__+"___eq__")(self, rhs) - + def __ne__(self, rhs): - if not isinstance(rhs, type(self)): - return True - + if not isinstance(rhs, type(self)): + return True + return getattr(_lldb,self.__class__.__name__+"___ne__")(self, rhs) %} } @@ -595,17 +595,17 @@ } %clearnothreadallow; - %pythoncode %{ + %pythoncode %{ def __eq__(self, rhs): - if not isinstance(rhs, type(self)): - return False - + if not isinstance(rhs, type(self)): + return False + return getattr(_lldb,self.__class__.__name__+"___eq__")(self, rhs) - + def __ne__(self, rhs): - if not isinstance(rhs, type(self)): - return True - + if not isinstance(rhs, type(self)): + return True + return getattr(_lldb,self.__class__.__name__+"___ne__")(self, rhs) %} } @@ -657,17 +657,17 @@ return lldb_private::PythonString("").release(); } %clearnothreadallow; - %pythoncode %{ + %pythoncode %{ def __eq__(self, rhs): - if not isinstance(rhs, type(self)): - return False - + if not isinstance(rhs, type(self)): + return False + return getattr(_lldb,self.__class__.__name__+"___eq__")(self, rhs) - + def __ne__(self, rhs): - if not isinstance(rhs, type(self)): - return True - + if not isinstance(rhs, type(self)): + return True + return getattr(_lldb,self.__class__.__name__+"___ne__")(self, rhs) %} } @@ -750,17 +750,17 @@ return lldb_private::PythonString("").release(); } %clearnothreadallow; - %pythoncode %{ + %pythoncode %{ def __eq__(self, rhs): - if not isinstance(rhs, type(self)): - return False - + if not isinstance(rhs, type(self)): + return False + return getattr(_lldb,self.__class__.__name__+"___eq__")(self, rhs) - + def __ne__(self, rhs): - if not isinstance(rhs, type(self)): - return True - + if not isinstance(rhs, type(self)): + return True + return getattr(_lldb,self.__class__.__name__+"___ne__")(self, rhs) %} } @@ -779,17 +779,17 @@ return lldb_private::PythonString("").release(); } %clearnothreadallow; - %pythoncode %{ + %pythoncode %{ def __eq__(self, rhs): - if not isinstance(rhs, type(self)): - return False - + if not isinstance(rhs, type(self)): + return False + return getattr(_lldb,self.__class__.__name__+"___eq__")(self, rhs) - + def __ne__(self, rhs): - if not isinstance(rhs, type(self)): - return True - + if not isinstance(rhs, type(self)): + return True + return getattr(_lldb,self.__class__.__name__+"___ne__")(self, rhs) %} } @@ -808,17 +808,17 @@ return lldb_private::PythonString("").release(); } %clearnothreadallow; - %pythoncode %{ + %pythoncode %{ def __eq__(self, rhs): - if not isinstance(rhs, type(self)): - return False - + if not isinstance(rhs, type(self)): + return False + return getattr(_lldb,self.__class__.__name__+"___eq__")(self, rhs) - + def __ne__(self, rhs): - if not isinstance(rhs, type(self)): - return True - + if not isinstance(rhs, type(self)): + return True + return getattr(_lldb,self.__class__.__name__+"___ne__")(self, rhs) %} } @@ -837,17 +837,17 @@ return lldb_private::PythonString("").release(); } %clearnothreadallow; - %pythoncode %{ + %pythoncode %{ def __eq__(self, rhs): - if not isinstance(rhs, type(self)): - return False - + if not isinstance(rhs, type(self)): + return False + return getattr(_lldb,self.__class__.__name__+"___eq__")(self, rhs) - + def __ne__(self, rhs): - if not isinstance(rhs, type(self)): - return True - + if not isinstance(rhs, type(self)): + return True + return getattr(_lldb,self.__class__.__name__+"___ne__")(self, rhs) %} } @@ -945,14 +945,14 @@ class declaration(object): class value_iter(object): def __iter__(self): return self - + def next(self): if self.index >= self.length: raise StopIteration() child_sbvalue = self.sbvalue.GetChildAtIndex(self.index) self.index += 1 return value(child_sbvalue) - + def __init__(self,value): self.index = 0 self.sbvalue = value @@ -965,7 +965,7 @@ class value(object): can be used as a variable would be in code. So if you have a Point structure variable in your code in the current frame named "pt", you can initialize an instance of this class with it: - + pt = lldb.value(lldb.frame.FindVariable("pt")) print pt print pt.x @@ -1005,131 +1005,131 @@ class value(object): def __add__(self, other): return int(self) + int(other) - + def __sub__(self, other): return int(self) - int(other) - + def __mul__(self, other): return int(self) * int(other) - + def __floordiv__(self, other): return int(self) // int(other) - + def __mod__(self, other): return int(self) % int(other) - + def __divmod__(self, other): return int(self) % int(other) - + def __pow__(self, other): return int(self) ** int(other) - + def __lshift__(self, other): return int(self) << int(other) - + def __rshift__(self, other): return int(self) >> int(other) - + def __and__(self, other): return int(self) & int(other) - + def __xor__(self, other): return int(self) ^ int(other) - + def __or__(self, other): return int(self) | int(other) - + def __div__(self, other): return int(self) / int(other) - + def __truediv__(self, other): return int(self) / int(other) - + def __iadd__(self, other): result = self.__add__(other) self.sbvalue.SetValueFromCString (str(result)) return result - + def __isub__(self, other): result = self.__sub__(other) self.sbvalue.SetValueFromCString (str(result)) return result - + def __imul__(self, other): result = self.__mul__(other) self.sbvalue.SetValueFromCString (str(result)) return result - + def __idiv__(self, other): result = self.__div__(other) self.sbvalue.SetValueFromCString (str(result)) return result - + def __itruediv__(self, other): result = self.__truediv__(other) self.sbvalue.SetValueFromCString (str(result)) return result - + def __ifloordiv__(self, other): result = self.__floordiv__(self, other) self.sbvalue.SetValueFromCString (str(result)) return result - + def __imod__(self, other): result = self.__and__(self, other) self.sbvalue.SetValueFromCString (str(result)) return result - + def __ipow__(self, other): result = self.__pow__(self, other) self.sbvalue.SetValueFromCString (str(result)) return result - + def __ipow__(self, other, modulo): result = self.__pow__(self, other, modulo) self.sbvalue.SetValueFromCString (str(result)) return result - + def __ilshift__(self, other): result = self.__lshift__(other) self.sbvalue.SetValueFromCString (str(result)) return result - + def __irshift__(self, other): result = self.__rshift__(other) self.sbvalue.SetValueFromCString (str(result)) return result - + def __iand__(self, other): result = self.__and__(self, other) self.sbvalue.SetValueFromCString (str(result)) return result - + def __ixor__(self, other): result = self.__xor__(self, other) self.sbvalue.SetValueFromCString (str(result)) return result - + def __ior__(self, other): result = self.__ior__(self, other) self.sbvalue.SetValueFromCString (str(result)) return result - + def __neg__(self): return -int(self) - + def __pos__(self): return +int(self) - + def __abs__(self): return abs(int(self)) - + def __invert__(self): return ~int(self) - + def __complex__(self): return complex (int(self)) - + def __int__(self): is_num,is_sign = is_numeric_type(self.sbvalue.GetType().GetCanonicalType().GetBasicType()) if is_num and not is_sign: return self.sbvalue.GetValueAsUnsigned() @@ -1140,10 +1140,10 @@ class value(object): def __float__(self): return float (self.sbvalue.GetValueAsSigned()) - + def __oct__(self): return '0%o' % self.sbvalue.GetValueAsUnsigned() - + def __hex__(self): return '0x%x' % self.sbvalue.GetValueAsUnsigned() -- 2.7.4