Skip to content

Commit 3bcf7f7

Browse files
authored
Merge pull request #8563 from jasonmolenda/cp/fix-swig-docstrings-and-add-api-docs-6.0
Cp/fix swig docstrings and add api docs 6.0
2 parents 7496505 + 6f460b1 commit 3bcf7f7

File tree

6 files changed

+637
-429
lines changed

6 files changed

+637
-429
lines changed

lldb/bindings/interface/SBMemoryRegionInfoDocstrings.i

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,30 @@
22
"API clients can get information about memory regions in processes."
33
) lldb::SBMemoryRegionInfo;
44

5-
%feature("autodoc", "
6-
GetRegionEnd(SBMemoryRegionInfo self) -> lldb::addr_t
5+
%feature("docstring", "
76
Returns whether this memory region has a list of modified (dirty)
87
pages available or not. When calling GetNumDirtyPages(), you will
98
have 0 returned for both \"dirty page list is not known\" and
109
\"empty dirty page list\" (that is, no modified pages in this
1110
memory region). You must use this method to disambiguate."
1211
) lldb::SBMemoryRegionInfo::HasDirtyMemoryPageList;
1312

14-
%feature("autodoc", "
15-
GetNumDirtyPages(SBMemoryRegionInfo self) -> uint32_t
13+
%feature("docstring", "
1614
Return the number of dirty (modified) memory pages in this
1715
memory region, if available. You must use the
1816
SBMemoryRegionInfo::HasDirtyMemoryPageList() method to
1917
determine if a dirty memory list is available; it will depend
2018
on the target system can provide this information."
2119
) lldb::SBMemoryRegionInfo::GetNumDirtyPages;
2220

23-
%feature("autodoc", "
24-
GetDirtyPageAddressAtIndex(SBMemoryRegionInfo self, uint32_t idx) -> lldb::addr_t
21+
%feature("docstring", "
2522
Return the address of a modified, or dirty, page of memory.
2623
If the provided index is out of range, or this memory region
2724
does not have dirty page information, LLDB_INVALID_ADDRESS
2825
is returned."
2926
) lldb::SBMemoryRegionInfo::GetDirtyPageAddressAtIndex;
3027

31-
%feature("autodoc", "
32-
GetPageSize(SBMemoryRegionInfo self) -> int
28+
%feature("docstring", "
3329
Return the size of pages in this memory region. 0 will be returned
3430
if this information was unavailable."
3531
) lldb::SBMemoryRegionInfo::GetPageSize();

lldb/bindings/interface/SBProcessDocstrings.i

Lines changed: 69 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,18 @@ SBProcess supports thread iteration. For example (from test/lldbutil.py), ::
2020
"
2121
) lldb::SBProcess;
2222

23-
%feature("autodoc", "
23+
%feature("docstring", "
2424
Writes data into the current process's stdin. API client specifies a Python
2525
string as the only argument."
2626
) lldb::SBProcess::PutSTDIN;
2727

28-
%feature("autodoc", "
28+
%feature("docstring", "
2929
Reads data from the current process's stdout stream. API client specifies
3030
the size of the buffer to read data into. It returns the byte buffer in a
3131
Python string."
3232
) lldb::SBProcess::GetSTDOUT;
3333

34-
%feature("autodoc", "
34+
%feature("docstring", "
3535
Reads data from the current process's stderr stream. API client specifies
3636
the size of the buffer to read data into. It returns the byte buffer in a
3737
Python string."
@@ -47,34 +47,34 @@ SBProcess supports thread iteration. For example (from test/lldbutil.py), ::
4747
"See SBTarget.Launch for argument description and usage."
4848
) lldb::SBProcess::RemoteLaunch;
4949

50-
%feature("autodoc", "
50+
%feature("docstring", "
5151
Returns the INDEX'th thread from the list of current threads. The index
5252
of a thread is only valid for the current stop. For a persistent thread
5353
identifier use either the thread ID or the IndexID. See help on SBThread
5454
for more details."
5555
) lldb::SBProcess::GetThreadAtIndex;
5656

57-
%feature("autodoc", "
57+
%feature("docstring", "
5858
Returns the thread with the given thread ID."
5959
) lldb::SBProcess::GetThreadByID;
6060

61-
%feature("autodoc", "
61+
%feature("docstring", "
6262
Returns the thread with the given thread IndexID."
6363
) lldb::SBProcess::GetThreadByIndexID;
6464

65-
%feature("autodoc", "
65+
%feature("docstring", "
6666
Returns the currently selected thread."
6767
) lldb::SBProcess::GetSelectedThread;
6868

69-
%feature("autodoc", "
69+
%feature("docstring", "
7070
Lazily create a thread on demand through the current OperatingSystem plug-in, if the current OperatingSystem plug-in supports it."
7171
) lldb::SBProcess::CreateOSPluginThread;
7272

73-
%feature("autodoc", "
73+
%feature("docstring", "
7474
Returns the process ID of the process."
7575
) lldb::SBProcess::GetProcessID;
7676

77-
%feature("autodoc", "
77+
%feature("docstring", "
7878
Returns an integer ID that is guaranteed to be unique across all process instances. This is not the process ID, just a unique integer for comparison and caching purposes."
7979
) lldb::SBProcess::GetUniqueID;
8080

@@ -95,7 +95,7 @@ SBProcess supports thread iteration. For example (from test/lldbutil.py), ::
9595
will always increase, but may increase by more than one per stop."
9696
) lldb::SBProcess::GetStopID;
9797

98-
%feature("autodoc", "
98+
%feature("docstring", "
9999
Reads memory from the current process's address space and removes any
100100
traps that may have been inserted into the memory. It returns the byte
101101
buffer in a Python string. Example: ::
@@ -105,7 +105,7 @@ SBProcess supports thread iteration. For example (from test/lldbutil.py), ::
105105
new_bytes = bytearray(content)"
106106
) lldb::SBProcess::ReadMemory;
107107

108-
%feature("autodoc", "
108+
%feature("docstring", "
109109
Writes memory to the current process's address space and maintains any
110110
traps that might be present due to software breakpoints. Example: ::
111111
@@ -116,8 +116,8 @@ SBProcess supports thread iteration. For example (from test/lldbutil.py), ::
116116
print('SBProcess.WriteMemory() failed!')"
117117
) lldb::SBProcess::WriteMemory;
118118

119-
%feature("autodoc", "
120-
Reads a NULL terminated C string from the current process's address space.
119+
%feature("docstring", "
120+
Reads a NUL terminated C string from the current process's address space.
121121
It returns a python string of the exact length, or truncates the string if
122122
the maximum character limit is reached. Example: ::
123123
@@ -131,7 +131,7 @@ SBProcess supports thread iteration. For example (from test/lldbutil.py), ::
131131
) lldb::SBProcess::ReadCStringFromMemory;
132132

133133

134-
%feature("autodoc", "
134+
%feature("docstring", "
135135
Reads an unsigned integer from memory given a byte size and an address.
136136
Returns the unsigned integer that was read. Example: ::
137137
@@ -145,7 +145,7 @@ SBProcess supports thread iteration. For example (from test/lldbutil.py), ::
145145
) lldb::SBProcess::ReadUnsignedFromMemory;
146146

147147

148-
%feature("autodoc", "
148+
%feature("docstring", "
149149
Reads a pointer from memory from an address and returns the value. Example: ::
150150
151151
# Read a pointer from address 0x1000
@@ -158,24 +158,24 @@ SBProcess supports thread iteration. For example (from test/lldbutil.py), ::
158158
) lldb::SBProcess::ReadPointerFromMemory;
159159

160160

161-
%feature("autodoc", "
161+
%feature("docstring", "
162162
Returns the implementation object of the process plugin if available. None
163163
otherwise."
164164
) lldb::SBProcess::GetScriptedImplementation;
165165

166-
%feature("autodoc", "
166+
%feature("docstring", "
167167
Returns the process' extended crash information."
168168
) lldb::SBProcess::GetExtendedCrashInformation;
169169

170-
%feature("autodoc", "
170+
%feature("docstring", "
171171
Load the library whose filename is given by image_spec looking in all the
172172
paths supplied in the paths argument. If successful, return a token that
173173
can be passed to UnloadImage and fill loaded_path with the path that was
174174
successfully loaded. On failure, return
175175
lldb.LLDB_INVALID_IMAGE_TOKEN."
176176
) lldb::SBProcess::LoadImageUsingPaths;
177177

178-
%feature("autodoc", "
178+
%feature("docstring", "
179179
Return the number of different thread-origin extended backtraces
180180
this process can support as a uint32_t.
181181
When the process is stopped and you have an SBThread, lldb may be
@@ -184,12 +184,12 @@ SBProcess supports thread iteration. For example (from test/lldbutil.py), ::
184184
queue)."
185185
) lldb::SBProcess::GetNumExtendedBacktraceTypes;
186186

187-
%feature("autodoc", "
187+
%feature("docstring", "
188188
Takes an index argument, returns the name of one of the thread-origin
189189
extended backtrace methods as a str."
190190
) lldb::SBProcess::GetExtendedBacktraceTypeAtIndex;
191191

192-
%feature("autodoc", "
192+
%feature("docstring", "
193193
Get information about the process.
194194
Valid process info will only be returned when the process is alive,
195195
use IsValid() to check if the info returned is valid. ::
@@ -199,7 +199,48 @@ SBProcess supports thread iteration. For example (from test/lldbutil.py), ::
199199
process_info.GetProcessID()"
200200
) lldb::SBProcess::GetProcessInfo;
201201

202-
%feature("autodoc", "
202+
%feature("docstring", "
203+
Get the current address mask in this Process of a given type.
204+
There are lldb.eAddressMaskTypeCode and lldb.eAddressMaskTypeData address
205+
masks, and on most Targets, the the Data address mask is more general
206+
because there are no alignment restrictions, as there can be with Code
207+
addresses.
208+
lldb.eAddressMaskTypeAny may be used to get the most general mask.
209+
The bits which are not used for addressing are set to 1 in the returned
210+
mask.
211+
In an unusual environment with different address masks for high and low
212+
memory, this may also be specified. This is uncommon, default is
213+
lldb.eAddressMaskRangeLow."
214+
) lldb::SBProcess::GetAddressMask;
215+
216+
%feature("docstring", "
217+
Set the current address mask in this Process for a given type,
218+
lldb.eAddressMaskTypeCode or lldb.eAddressMaskTypeData. Bits that are not
219+
used for addressing should be set to 1 in the mask.
220+
When setting all masks, lldb.eAddressMaskTypeAll may be specified.
221+
In an unusual environment with different address masks for high and low
222+
memory, this may also be specified. This is uncommon, default is
223+
lldb.eAddressMaskRangeLow."
224+
) lldb::SBProcess::SetAddressMask;
225+
226+
%feature("docstring", "
227+
Set the number of low bits relevant for addressing in this Process
228+
for a given type, lldb.eAddressMaskTypeCode or lldb.eAddressMaskTypeData.
229+
When setting all masks, lldb.eAddressMaskTypeAll may be specified.
230+
In an unusual environment with different address masks for high and low
231+
memory, the address range may also be specified. This is uncommon,
232+
default is lldb.eAddressMaskRangeLow."
233+
) lldb::SBProcess::SetAddressableBits;
234+
235+
%feature("docstring", "
236+
Given a virtual address, clear the bits that are not used for addressing
237+
(and may be used for metadata, memory tagging, point authentication, etc).
238+
By default the most general mask, lldb.eAddressMaskTypeAny is used to
239+
process the address, but lldb.eAddressMaskTypeData and
240+
lldb.eAddressMaskTypeCode may be specified if the type of address is known."
241+
) lldb::SBProcess::FixAddress;
242+
243+
%feature("docstring", "
203244
Allocates a block of memory within the process, with size and
204245
access permissions specified in the arguments. The permissions
205246
argument is an or-combination of zero or more of
@@ -209,7 +250,11 @@ SBProcess supports thread iteration. For example (from test/lldbutil.py), ::
209250
lldb.LLDB_INVALID_ADDRESS if the allocation failed."
210251
) lldb::SBProcess::AllocateMemory;
211252

212-
%feature("autodoc", "
253+
%feature("docstring", "Get default process broadcaster class name (lldb.process)."
254+
) lldb::SBProcess::GetBroadcasterClass;
255+
256+
257+
%feature("docstring", "
213258
Deallocates the block of memory (previously allocated using
214259
AllocateMemory) given in the argument."
215260
) lldb::SBProcess::DeallocateMemory;

lldb/bindings/interface/SBQueueDocstrings.i

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
"Represents a libdispatch queue in the process."
33
) lldb::SBQueue;
44

5-
%feature("autodoc", "
5+
%feature("docstring", "
66
Returns an lldb::queue_id_t type unique identifier number for this
77
queue that will not be used by any other queue during this process'
88
execution. These ID numbers often start at 1 with the first
99
system-created queues and increment from there."
1010
) lldb::SBQueue::GetQueueID;
1111

12-
%feature("autodoc", "
12+
%feature("docstring", "
1313
Returns an lldb::QueueKind enumerated value (e.g. eQueueKindUnknown,
1414
eQueueKindSerial, eQueueKindConcurrent) describing the type of this
1515
queue."

0 commit comments

Comments
 (0)