Skip to content

Commit 3d098f7

Browse files
barsolo2000Bar Soloveychik
andauthored
[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 <[email protected]>
1 parent 1732748 commit 3d098f7

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

lldb/bindings/interface/SBMemoryRegionInfoDocstrings.i

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
%feature("docstring",
2-
"API clients can get information about memory regions in processes."
2+
"API clients can get information about memory regions in processes.
3+
4+
For Python users, `len()` is overriden to output the size of the memory region in bytes.
5+
For Python users, `str()` is overriden with the results of the GetDescription function-
6+
produces a formatted string that describes a memory range in the form:
7+
[Hex start - Hex End) with associated permissions (RWX)"
38
) lldb::SBMemoryRegionInfo;
49

510
%feature("docstring", "
@@ -29,3 +34,11 @@
2934
Return the size of pages in this memory region. 0 will be returned
3035
if this information was unavailable."
3136
) lldb::SBMemoryRegionInfo::GetPageSize();
37+
38+
%feature("docstring", "
39+
Takes an SBStream parameter to write output to,
40+
formatted [Hex start - Hex End) with associated permissions (RWX).
41+
If the function results false, no output will be written.
42+
If results true, the output will be written to the stream.
43+
"
44+
) lldb::SBMemoryRegionInfo::GetDescription;

lldb/include/lldb/API/SBMemoryRegionInfo.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,17 @@ class LLDB_API SBMemoryRegionInfo {
115115

116116
bool operator!=(const lldb::SBMemoryRegionInfo &rhs) const;
117117

118+
/// writes a description of the memory region to a SBStream.
119+
///
120+
/// \param[in,out] description
121+
/// A stream object where the description will be written.
122+
///
123+
/// \return
124+
/// Returns true if the description was successfully written,
125+
/// false otherwise.
126+
///
127+
/// The description format is: [Hex start - Hex End) with associated
128+
/// permissions (RWX)
118129
bool GetDescription(lldb::SBStream &description);
119130

120131
private:

0 commit comments

Comments
 (0)