Skip to content

Cp/fix swig docstrings and add api docs 6.0 #8563

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions lldb/bindings/interface/SBMemoryRegionInfoDocstrings.i
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,30 @@
"API clients can get information about memory regions in processes."
) lldb::SBMemoryRegionInfo;

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

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

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

%feature("autodoc", "
GetPageSize(SBMemoryRegionInfo self) -> int
%feature("docstring", "
Return the size of pages in this memory region. 0 will be returned
if this information was unavailable."
) lldb::SBMemoryRegionInfo::GetPageSize();
93 changes: 69 additions & 24 deletions lldb/bindings/interface/SBProcessDocstrings.i
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@ SBProcess supports thread iteration. For example (from test/lldbutil.py), ::
"
) lldb::SBProcess;

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

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

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

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

%feature("autodoc", "
%feature("docstring", "
Returns the thread with the given thread ID."
) lldb::SBProcess::GetThreadByID;

%feature("autodoc", "
%feature("docstring", "
Returns the thread with the given thread IndexID."
) lldb::SBProcess::GetThreadByIndexID;

%feature("autodoc", "
%feature("docstring", "
Returns the currently selected thread."
) lldb::SBProcess::GetSelectedThread;

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

%feature("autodoc", "
%feature("docstring", "
Returns the process ID of the process."
) lldb::SBProcess::GetProcessID;

%feature("autodoc", "
%feature("docstring", "
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."
) lldb::SBProcess::GetUniqueID;

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

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

%feature("autodoc", "
%feature("docstring", "
Writes memory to the current process's address space and maintains any
traps that might be present due to software breakpoints. Example: ::

Expand All @@ -116,8 +116,8 @@ SBProcess supports thread iteration. For example (from test/lldbutil.py), ::
print('SBProcess.WriteMemory() failed!')"
) lldb::SBProcess::WriteMemory;

%feature("autodoc", "
Reads a NULL terminated C string from the current process's address space.
%feature("docstring", "
Reads a NUL terminated C string from the current process's address space.
It returns a python string of the exact length, or truncates the string if
the maximum character limit is reached. Example: ::

Expand All @@ -131,7 +131,7 @@ SBProcess supports thread iteration. For example (from test/lldbutil.py), ::
) lldb::SBProcess::ReadCStringFromMemory;


%feature("autodoc", "
%feature("docstring", "
Reads an unsigned integer from memory given a byte size and an address.
Returns the unsigned integer that was read. Example: ::

Expand All @@ -145,7 +145,7 @@ SBProcess supports thread iteration. For example (from test/lldbutil.py), ::
) lldb::SBProcess::ReadUnsignedFromMemory;


%feature("autodoc", "
%feature("docstring", "
Reads a pointer from memory from an address and returns the value. Example: ::

# Read a pointer from address 0x1000
Expand All @@ -158,24 +158,24 @@ SBProcess supports thread iteration. For example (from test/lldbutil.py), ::
) lldb::SBProcess::ReadPointerFromMemory;


%feature("autodoc", "
%feature("docstring", "
Returns the implementation object of the process plugin if available. None
otherwise."
) lldb::SBProcess::GetScriptedImplementation;

%feature("autodoc", "
%feature("docstring", "
Returns the process' extended crash information."
) lldb::SBProcess::GetExtendedCrashInformation;

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

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

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

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

%feature("autodoc", "
%feature("docstring", "
Get the current address mask in this Process of a given type.
There are lldb.eAddressMaskTypeCode and lldb.eAddressMaskTypeData address
masks, and on most Targets, the the Data address mask is more general
because there are no alignment restrictions, as there can be with Code
addresses.
lldb.eAddressMaskTypeAny may be used to get the most general mask.
The bits which are not used for addressing are set to 1 in the returned
mask.
In an unusual environment with different address masks for high and low
memory, this may also be specified. This is uncommon, default is
lldb.eAddressMaskRangeLow."
) lldb::SBProcess::GetAddressMask;

%feature("docstring", "
Set the current address mask in this Process for a given type,
lldb.eAddressMaskTypeCode or lldb.eAddressMaskTypeData. Bits that are not
used for addressing should be set to 1 in the mask.
When setting all masks, lldb.eAddressMaskTypeAll may be specified.
In an unusual environment with different address masks for high and low
memory, this may also be specified. This is uncommon, default is
lldb.eAddressMaskRangeLow."
) lldb::SBProcess::SetAddressMask;

%feature("docstring", "
Set the number of low bits relevant for addressing in this Process
for a given type, lldb.eAddressMaskTypeCode or lldb.eAddressMaskTypeData.
When setting all masks, lldb.eAddressMaskTypeAll may be specified.
In an unusual environment with different address masks for high and low
memory, the address range may also be specified. This is uncommon,
default is lldb.eAddressMaskRangeLow."
) lldb::SBProcess::SetAddressableBits;

%feature("docstring", "
Given a virtual address, clear the bits that are not used for addressing
(and may be used for metadata, memory tagging, point authentication, etc).
By default the most general mask, lldb.eAddressMaskTypeAny is used to
process the address, but lldb.eAddressMaskTypeData and
lldb.eAddressMaskTypeCode may be specified if the type of address is known."
) lldb::SBProcess::FixAddress;

%feature("docstring", "
Allocates a block of memory within the process, with size and
access permissions specified in the arguments. The permissions
argument is an or-combination of zero or more of
Expand All @@ -209,7 +250,11 @@ SBProcess supports thread iteration. For example (from test/lldbutil.py), ::
lldb.LLDB_INVALID_ADDRESS if the allocation failed."
) lldb::SBProcess::AllocateMemory;

%feature("autodoc", "
%feature("docstring", "Get default process broadcaster class name (lldb.process)."
) lldb::SBProcess::GetBroadcasterClass;


%feature("docstring", "
Deallocates the block of memory (previously allocated using
AllocateMemory) given in the argument."
) lldb::SBProcess::DeallocateMemory;
4 changes: 2 additions & 2 deletions lldb/bindings/interface/SBQueueDocstrings.i
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
"Represents a libdispatch queue in the process."
) lldb::SBQueue;

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

%feature("autodoc", "
%feature("docstring", "
Returns an lldb::QueueKind enumerated value (e.g. eQueueKindUnknown,
eQueueKindSerial, eQueueKindConcurrent) describing the type of this
queue."
Expand Down
Loading