aboutsummaryrefslogtreecommitdiff
path: root/lldb/bindings/python
diff options
context:
space:
mode:
authorMed Ismail Bennani <ismail@bennani.ma>2023-08-29 16:22:55 +0100
committerMed Ismail Bennani <ismail@bennani.ma>2023-08-29 16:24:33 +0100
commitf0731d5b61ba798e6d5a63a92d9228010e5a3b50 (patch)
tree8094a2f73d27e1b810a1e33d11b590b979e542c1 /lldb/bindings/python
parentad778a8a0ffd0ab54673c04c196ce8192ea15e6f (diff)
downloadllvm-f0731d5b61ba798e6d5a63a92d9228010e5a3b50.tar.gz
llvm-f0731d5b61ba798e6d5a63a92d9228010e5a3b50.tar.bz2
llvm-f0731d5b61ba798e6d5a63a92d9228010e5a3b50.zip
Re-land "[lldb/docs] Silence warnings when generating website"
This reverts commit 18f1c1ace7a6099f3e8e56cf4b81aa0f64a7dd23 and fix the build failure issues introduced because of the `STRING_EXTENSION_OUTSIDE` swig macros. Differential Revision: https://reviews.llvm.org/D159017 Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
Diffstat (limited to 'lldb/bindings/python')
-rw-r--r--lldb/bindings/python/python-extensions.swig49
-rw-r--r--lldb/bindings/python/python.swig15
2 files changed, 64 insertions, 0 deletions
diff --git a/lldb/bindings/python/python-extensions.swig b/lldb/bindings/python/python-extensions.swig
index cb841af070ad..42dbb194fdc4 100644
--- a/lldb/bindings/python/python-extensions.swig
+++ b/lldb/bindings/python/python-extensions.swig
@@ -289,6 +289,24 @@ class declaration(object):
self.line = line
self.col = col
+ def __eq__(self, other):
+ return not self.__ne__(other)
+
+ def __int__(self):
+ pass
+
+ def __hex__(self):
+ pass
+
+ def __oct__(self):
+ pass
+
+ def __len__(self):
+ pass
+
+ def __iter__(self):
+ pass
+
class value_iter(object):
'''Allows iterating over the children of an :py:class:`SBValue`.'''
def __iter__(self):
@@ -304,8 +322,24 @@ class value_iter(object):
def next(self):
return self.__next__()
+ def __eq__(self, other):
+ return not self.__ne__(other)
+
+ def __int__(self):
+ pass
+
+ def __hex__(self):
+ pass
+
+ def __oct__(self):
+ pass
+
+ def __len__(self):
+ return self.length
+
def __init__(self,value):
self.index = 0
+ self.length = 0
self.sbvalue = value
if type(self.sbvalue) is value:
self.sbvalue = self.sbvalue.sbvalue
@@ -546,6 +580,21 @@ class SBSyntheticValueProvider(object):
def has_children(self):
return False
+ def __int__(self):
+ pass
+
+ def __hex__(self):
+ pass
+
+ def __oct__(self):
+ pass
+
+ def __len__(self):
+ return self.num_children()
+
+ def __iter__(self):
+ '''Iterate over all children in a lldb.SBSyntheticValueProvider object.'''
+ return lldb_iter(self, 'num_children', 'get_child_at_index')
%}
diff --git a/lldb/bindings/python/python.swig b/lldb/bindings/python/python.swig
index 278c0eed2bab..5ca5ce1b59d0 100644
--- a/lldb/bindings/python/python.swig
+++ b/lldb/bindings/python/python.swig
@@ -106,6 +106,21 @@ def lldb_iter(obj, getsize, getelem):
elem = getattr(obj, getelem)
for i in range(size()):
yield elem(i)
+
+def __int__(self):
+ pass
+
+def __hex__(self):
+ pass
+
+def __oct__(self):
+ pass
+
+def __len__(self):
+ pass
+
+def __iter__(self):
+ pass
%}
%include <std_string.i>