Skip to content

Commit 498b59e

Browse files
committed
[lldb/docs] Silence warnings when generating website
This patch does various things to silence the warnings that show up when generating the website documentation. First, this patch adds the missing definition for special member methods in every SBAPI class. If the class cannot implement one of the special member method, we just define it as a null operation (pass). This should fix the following warnings: ``` WARNING: missing attribute __int__ in object lldb.SB* WARNING: missing attribute __len__ in object lldb.SB* WARNING: missing attribute __hex__ in object lldb.SB* WARNING: missing attribute __oct__ in object lldb.SB* WARNING: missing attribute __iter__ in object lldb.SB* ``` Then, it un-skips the various `static` methods that we didn't generate the methods for, since it's not necessary thanks to the automod-api module. Finally, this comments out the `_static` directory in the sphinx config, since we don't need it anymore. Differential Revision: https://reviews.llvm.org/D159017 Signed-off-by: Med Ismail Bennani <[email protected]>
1 parent 9a98ab5 commit 498b59e

File tree

81 files changed

+1756
-89
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+1756
-89
lines changed

lldb/bindings/interface/SBAddressExtensions.i

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ STRING_EXTENSION_OUTSIDE(SBAddress)
77
%pythoncode%{
88
def __eq__(self, other):
99
return not self.__ne__(other)
10+
11+
def __len__(self):
12+
pass
13+
14+
def __iter__(self):
15+
pass
1016
%}
1117

1218
%pythoncode %{
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
STRING_EXTENSION_OUTSIDE(SBAttachInfo)
2+
3+
%extend lldb::SBAttachInfo {
4+
#ifdef SWIGPYTHON
5+
// operator== is a free function, which swig does not handle, so we inject
6+
// our own equality operator here
7+
%pythoncode%{
8+
def __eq__(self, other):
9+
return not self.__ne__(other)
10+
11+
def __int__(self):
12+
pass
13+
14+
def __len__(self):
15+
pass
16+
17+
def __hex__(self):
18+
pass
19+
20+
def __oct__(self):
21+
pass
22+
23+
def __iter__(self):
24+
pass
25+
%}
26+
#endif
27+
}

lldb/bindings/interface/SBBlockExtensions.i

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,21 @@ STRING_EXTENSION_OUTSIDE(SBBlock)
33
%extend lldb::SBBlock {
44
#ifdef SWIGPYTHON
55
%pythoncode %{
6+
def __int__(self):
7+
pass
8+
9+
def __len__(self):
10+
pass
11+
12+
def __hex__(self):
13+
pass
14+
15+
def __oct__(self):
16+
pass
17+
18+
def __iter__(self):
19+
pass
20+
621
def get_range_at_index(self, idx):
722
if idx < self.GetNumRanges():
823
return [self.GetRangeStartAddress(idx), self.GetRangeEndAddress(idx)]

lldb/bindings/interface/SBBreakpointExtensions.i

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,15 @@ STRING_EXTENSION_OUTSIDE(SBBreakpoint)
4444
object.'''
4545
return self.GetNumLocations()
4646

47+
def __int__(self):
48+
pass
49+
50+
def __hex__(self):
51+
pass
52+
53+
def __oct__(self):
54+
pass
55+
4756
locations = property(get_breakpoint_location_list, None, doc='''A read only property that returns a list() of lldb.SBBreakpointLocation objects for this breakpoint.''')
4857
location = property(get_locations_access_object, None, doc='''A read only property that returns an object that can access locations by index (not location ID) (location = bkpt.location[12]).''')
4958
id = property(GetID, None, doc='''A read only property that returns the ID of this breakpoint.''')
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
STRING_EXTENSION_OUTSIDE(SBBreakpointList)
2+
3+
%extend lldb::SBBreakpointList {
4+
#ifdef SWIGPYTHON
5+
// operator== is a free function, which swig does not handle, so we inject
6+
// our own equality operator here
7+
%pythoncode%{
8+
def __eq__(self, other):
9+
return not self.__ne__(other)
10+
11+
def __int__(self):
12+
pass
13+
14+
def __len__(self):
15+
'''Return the number of breakpoints in a lldb.SBBreakpointList object.'''
16+
return self.GetSize()
17+
18+
def __hex__(self):
19+
pass
20+
21+
def __oct__(self):
22+
pass
23+
24+
def __iter__(self):
25+
'''Iterate over all breakpoints in a lldb.SBBreakpointList object.'''
26+
return lldb_iter(self, 'GetSize', 'GetBreakpointAtIndex')
27+
%}
28+
#endif
29+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,27 @@
11
STRING_EXTENSION_LEVEL_OUTSIDE(SBBreakpointLocation, lldb::eDescriptionLevelFull)
2+
3+
%extend lldb::SBBreakpointLocation {
4+
#ifdef SWIGPYTHON
5+
// operator== is a free function, which swig does not handle, so we inject
6+
// our own equality operator here
7+
%pythoncode%{
8+
def __eq__(self, other):
9+
return not self.__ne__(other)
10+
11+
def __int__(self):
12+
pass
13+
14+
def __len__(self):
15+
pass
16+
17+
def __hex__(self):
18+
pass
19+
20+
def __oct__(self):
21+
pass
22+
23+
def __iter__(self):
24+
pass
25+
%}
26+
#endif
27+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,27 @@
11
STRING_EXTENSION_OUTSIDE(SBBreakpointName)
2+
3+
%extend lldb::SBBreakpointName {
4+
#ifdef SWIGPYTHON
5+
// operator== is a free function, which swig does not handle, so we inject
6+
// our own equality operator here
7+
%pythoncode%{
8+
def __eq__(self, other):
9+
return not self.__ne__(other)
10+
11+
def __int__(self):
12+
pass
13+
14+
def __len__(self):
15+
pass
16+
17+
def __hex__(self):
18+
pass
19+
20+
def __oct__(self):
21+
pass
22+
23+
def __iter__(self):
24+
pass
25+
%}
26+
#endif
27+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
STRING_EXTENSION_OUTSIDE(SBBroadcaster)
2+
3+
%extend lldb::SBBroadcaster {
4+
#ifdef SWIGPYTHON
5+
// operator== is a free function, which swig does not handle, so we inject
6+
// our own equality operator here
7+
%pythoncode%{
8+
def __eq__(self, other):
9+
return not self.__ne__(other)
10+
11+
def __int__(self):
12+
pass
13+
14+
def __len__(self):
15+
pass
16+
17+
def __hex__(self):
18+
pass
19+
20+
def __oct__(self):
21+
pass
22+
23+
def __iter__(self):
24+
pass
25+
%}
26+
#endif
27+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
STRING_EXTENSION_OUTSIDE(SBCommandInterpreter)
2+
3+
%extend lldb::SBCommandInterpreter {
4+
#ifdef SWIGPYTHON
5+
// operator== is a free function, which swig does not handle, so we inject
6+
// our own equality operator here
7+
%pythoncode%{
8+
def __eq__(self, other):
9+
return not self.__ne__(other)
10+
11+
def __int__(self):
12+
pass
13+
14+
def __len__(self):
15+
pass
16+
17+
def __hex__(self):
18+
pass
19+
20+
def __oct__(self):
21+
pass
22+
23+
def __iter__(self):
24+
pass
25+
%}
26+
#endif
27+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
STRING_EXTENSION_OUTSIDE(SBCommandInterpreterRunOptions)
2+
3+
%extend lldb::SBCommandInterpreterRunOptions {
4+
#ifdef SWIGPYTHON
5+
// operator== is a free function, which swig does not handle, so we inject
6+
// our own equality operator here
7+
%pythoncode%{
8+
def __eq__(self, other):
9+
return not self.__ne__(other)
10+
11+
def __int__(self):
12+
pass
13+
14+
def __len__(self):
15+
pass
16+
17+
def __hex__(self):
18+
pass
19+
20+
def __oct__(self):
21+
pass
22+
23+
def __iter__(self):
24+
pass
25+
%}
26+
#endif
27+
}

lldb/bindings/interface/SBCommandReturnObjectExtensions.i

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,30 @@
11
STRING_EXTENSION_OUTSIDE(SBCommandReturnObject)
22

33
%extend lldb::SBCommandReturnObject {
4+
#ifdef SWIGPYTHON
5+
// operator== is a free function, which swig does not handle, so we inject
6+
// our own equality operator here
7+
%pythoncode%{
8+
def __eq__(self, other):
9+
return not self.__ne__(other)
10+
11+
def __int__(self):
12+
pass
13+
14+
def __len__(self):
15+
pass
16+
17+
def __hex__(self):
18+
pass
19+
20+
def __oct__(self):
21+
pass
22+
23+
def __iter__(self):
24+
pass
25+
%}
26+
#endif
27+
428
// transfer_ownership does nothing, and is here for compatibility with
529
// old scripts. Ownership is tracked by reference count in the ordinary way.
630

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
STRING_EXTENSION_OUTSIDE(SBCommunication)
2+
3+
%extend lldb::SBCommunication {
4+
#ifdef SWIGPYTHON
5+
// operator== is a free function, which swig does not handle, so we inject
6+
// our own equality operator here
7+
%pythoncode%{
8+
def __eq__(self, other):
9+
return not self.__ne__(other)
10+
11+
def __int__(self):
12+
pass
13+
14+
def __len__(self):
15+
pass
16+
17+
def __hex__(self):
18+
pass
19+
20+
def __oct__(self):
21+
pass
22+
23+
def __iter__(self):
24+
pass
25+
%}
26+
#endif
27+
}

lldb/bindings/interface/SBCompileUnitExtensions.i

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@ STRING_EXTENSION_OUTSIDE(SBCompileUnit)
33
%extend lldb::SBCompileUnit {
44
#ifdef SWIGPYTHON
55
%pythoncode %{
6+
def __int__(self):
7+
pass
8+
9+
def __hex__(self):
10+
pass
11+
12+
def __oct__(self):
13+
pass
14+
615
def __iter__(self):
716
'''Iterate over all line entries in a lldb.SBCompileUnit object.'''
817
return lldb_iter(self, 'GetNumLineEntries', 'GetLineEntryAtIndex')

lldb/bindings/interface/SBDataExtensions.i

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,23 @@ STRING_EXTENSION_OUTSIDE(SBData)
33
%extend lldb::SBData {
44
#ifdef SWIGPYTHON
55
%pythoncode %{
6+
def __eq__(self, other):
7+
return not self.__ne__(other)
8+
9+
def __int__(self):
10+
pass
11+
12+
def __hex__(self):
13+
pass
14+
15+
def __oct__(self):
16+
pass
17+
18+
def __len__(self):
19+
return self.GetByteSize()
20+
21+
def __iter__(self):
22+
pass
623

724
class read_data_helper:
825
def __init__(self, sbdata, readerfunc, item_size):

lldb/bindings/interface/SBDebuggerExtensions.i

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,15 @@ STRING_EXTENSION_OUTSIDE(SBDebugger)
2424
file = sys.stderr
2525
self.SetErrorFile(SBFile.Create(file, borrow=True))
2626

27+
def __int__(self):
28+
pass
29+
30+
def __hex__(self):
31+
pass
32+
33+
def __oct__(self):
34+
pass
35+
2736
def __iter__(self):
2837
'''Iterate over all targets in a lldb.SBDebugger object.'''
2938
return lldb_iter(self, 'GetNumTargets', 'GetTargetAtIndex')

lldb/bindings/interface/SBDeclarationExtensions.i

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,21 @@ STRING_EXTENSION_OUTSIDE(SBDeclaration)
33
%extend lldb::SBDeclaration {
44
#ifdef SWIGPYTHON
55
%pythoncode %{
6+
def __int__(self):
7+
pass
8+
9+
def __hex__(self):
10+
pass
11+
12+
def __oct__(self):
13+
pass
14+
15+
def __len__(self):
16+
pass
17+
18+
def __iter__(self):
19+
pass
20+
621
file = property(GetFileSpec, None, doc='''A read only property that returns an lldb object that represents the file (lldb.SBFileSpec) for this line entry.''')
722
line = property(GetLine, None, doc='''A read only property that returns the 1 based line number for this line entry, a return value of zero indicates that no line information is available.''')
823
column = property(GetColumn, None, doc='''A read only property that returns the 1 based column number for this line entry, a return value of zero indicates that no column information is available.''')

0 commit comments

Comments
 (0)