Author: Jacob Lalonde
Date: 2025-02-03T11:26:03-08:00
New Revision: a3321ea5d60f10ee1abe03fa95b08095ced61c76

URL: 
https://github.com/llvm/llvm-project/commit/a3321ea5d60f10ee1abe03fa95b08095ced61c76
DIFF: 
https://github.com/llvm/llvm-project/commit/a3321ea5d60f10ee1abe03fa95b08095ced61c76.diff

LOG: [LLDB][Documentation] Add a doc string to sbprocess to show MemoryRegions 
is iterable (#125557)

My colleague, @lukejriddle made the SBMemoryRegionList object iterable
in #117358. This isn't documented anywhere and so I added a blurb about
it to SBProcess.

Added: 
    

Modified: 
    lldb/bindings/interface/SBProcessDocstrings.i

Removed: 
    


################################################################################
diff  --git a/lldb/bindings/interface/SBProcessDocstrings.i 
b/lldb/bindings/interface/SBProcessDocstrings.i
index 1b98a79e4f6d36..b5b22052a60944 100644
--- a/lldb/bindings/interface/SBProcessDocstrings.i
+++ b/lldb/bindings/interface/SBProcessDocstrings.i
@@ -258,3 +258,14 @@ SBProcess supports thread iteration. For example (from 
test/lldbutil.py), ::
     Deallocates the block of memory (previously allocated using
     AllocateMemory) given in the argument."
 ) lldb::SBProcess::DeallocateMemory;
+
+%feature("docstring", "
+    Get a list of all the memory regions associated with this process.
+    ```
+        readable_regions = []
+        for region in process.GetMemoryRegions():
+            if region.IsReadable():
+                readable_regions.append(region)
+    ```
+"
+) lldb::SBProcess::GetMemoryRegions;


        
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to