aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbarsolo2000 <barsolo@meta.com>2025-08-01 09:36:48 -0700
committerGitHub <noreply@github.com>2025-08-01 09:36:48 -0700
commit3d098f78bfa82bfae5242402d4b8201b1ec38d06 (patch)
tree2adc471b78e25b9fb51a67fb0ae64fb8a9c057a9
parent17327482f045b7119e116320db3e9c12fcf250ae (diff)
downloadllvm-3d098f78bfa82bfae5242402d4b8201b1ec38d06.zip
llvm-3d098f78bfa82bfae5242402d4b8201b1ec38d06.tar.gz
llvm-3d098f78bfa82bfae5242402d4b8201b1ec38d06.tar.bz2
[LLDB] Update SBMemoryRegionInfo doc strings to document len and str (#149903)
Updated SBMemoryRegionInfo doc strings: - Added detailed documentation for the GetDescription() method. - Included information about the overwritten len() and str() functions for the SBMemoryRegionInfo type, explaining their behavior and usage. --------- Co-authored-by: Bar Soloveychik <barsolo@fb.com>
-rw-r--r--lldb/bindings/interface/SBMemoryRegionInfoDocstrings.i15
-rw-r--r--lldb/include/lldb/API/SBMemoryRegionInfo.h11
2 files changed, 25 insertions, 1 deletions
diff --git a/lldb/bindings/interface/SBMemoryRegionInfoDocstrings.i b/lldb/bindings/interface/SBMemoryRegionInfoDocstrings.i
index d7c68baf..99fe91b 100644
--- a/lldb/bindings/interface/SBMemoryRegionInfoDocstrings.i
+++ b/lldb/bindings/interface/SBMemoryRegionInfoDocstrings.i
@@ -1,5 +1,10 @@
%feature("docstring",
-"API clients can get information about memory regions in processes."
+"API clients can get information about memory regions in processes.
+
+For Python users, `len()` is overriden to output the size of the memory region in bytes.
+For Python users, `str()` is overriden with the results of the GetDescription function-
+ produces a formatted string that describes a memory range in the form:
+ [Hex start - Hex End) with associated permissions (RWX)"
) lldb::SBMemoryRegionInfo;
%feature("docstring", "
@@ -29,3 +34,11 @@
Return the size of pages in this memory region. 0 will be returned
if this information was unavailable."
) lldb::SBMemoryRegionInfo::GetPageSize();
+
+%feature("docstring", "
+ Takes an SBStream parameter to write output to,
+ formatted [Hex start - Hex End) with associated permissions (RWX).
+ If the function results false, no output will be written.
+ If results true, the output will be written to the stream.
+ "
+) lldb::SBMemoryRegionInfo::GetDescription; \ No newline at end of file
diff --git a/lldb/include/lldb/API/SBMemoryRegionInfo.h b/lldb/include/lldb/API/SBMemoryRegionInfo.h
index f9a5dc9..dc5aa08 100644
--- a/lldb/include/lldb/API/SBMemoryRegionInfo.h
+++ b/lldb/include/lldb/API/SBMemoryRegionInfo.h
@@ -115,6 +115,17 @@ public:
bool operator!=(const lldb::SBMemoryRegionInfo &rhs) const;
+ /// writes a description of the memory region to a SBStream.
+ ///
+ /// \param[in,out] description
+ /// A stream object where the description will be written.
+ ///
+ /// \return
+ /// Returns true if the description was successfully written,
+ /// false otherwise.
+ ///
+ /// The description format is: [Hex start - Hex End) with associated
+ /// permissions (RWX)
bool GetDescription(lldb::SBStream &description);
private: