-
Notifications
You must be signed in to change notification settings - Fork 14.5k
[LLDB] Update SBMemoryRegionInfo doc strings to document len and str #149903
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
base: main
Are you sure you want to change the base?
Conversation
Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be notified. If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it is probably because you do not have write permissions for the repository. In which case you can instead tag reviewers by name in a comment by using If you have received no comments on your PR for a week, you can request a review by "ping"ing the PR by adding a comment “Ping”. The common courtesy "ping" rate is once a week. Please remember that you are asking for valuable time from other developers. If you have further questions, they may be answered by the LLVM GitHub User Guide. You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums. |
@llvm/pr-subscribers-lldb Author: None (barsolo2000) ChangesUpdated SBMemoryRegionInfo doc strings:
Full diff: https://github.com/llvm/llvm-project/pull/149903.diff 1 Files Affected:
diff --git a/lldb/bindings/interface/SBMemoryRegionInfoDocstrings.i b/lldb/bindings/interface/SBMemoryRegionInfoDocstrings.i
index d7c68baf100e2..6b7f4a32ed17e 100644
--- a/lldb/bindings/interface/SBMemoryRegionInfoDocstrings.i
+++ b/lldb/bindings/interface/SBMemoryRegionInfoDocstrings.i
@@ -1,31 +1,47 @@
-%feature("docstring",
-"API clients can get information about memory regions in processes."
-) lldb::SBMemoryRegionInfo;
+% feature("docstring",
+ "API clients can get information about memory regions in processes.
+
+ When printed using str(), the memory region info is formatted as:
+ '[Hex start - Hex End] RWX' ")
+ lldb::SBMemoryRegionInfo;
%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
+ 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("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(
+ "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("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("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("docstring", "
+ Return the size of pages in this memory region .0 will be
+ returned if this information was unavailable."
+ ) lldb::SBMemoryRegionInfo::GetPageSize();
%feature("docstring", "
- Return the size of pages in this memory region. 0 will be returned
- if this information was unavailable."
-) lldb::SBMemoryRegionInfo::GetPageSize();
+ takes a SBStream parameter 'description' where it will write the output to.
+ The function will formats the memory region information into a string with Memory region info
+ [Hex start - Hex End) and premission flags R/W/X.
+ Returns a boolean value indicating success or failure.
+
+ alternatively, to get the size of the memory region is to use
+ the len() function on the SBMemoryRegionInfo object.
+ The function function will return the size of the memory region"
+) lldb::SBMemoryRegionInfo::GetDescription;
|
Now that we include Doxygen comments in the docstring (#147617), should we move these into the C++ header? |
@JDevlieghere How would we go about documenting some of the python methods |
Since those are Python specific they should remain docstrings in the |
Updated SBMemoryRegionInfo doc strings: