https://github.com/Jlalond created https://github.com/llvm/llvm-project/pull/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. >From 9abe2bf9c55ecfb56ed7e46ddbdaa998be6e6fc7 Mon Sep 17 00:00:00 2001 From: Jacob Lalonde <jalalo...@fb.com> Date: Mon, 3 Feb 2025 10:59:25 -0800 Subject: [PATCH] Add a doc string to sbprocess to show MemoryRegions is iterable --- lldb/bindings/interface/SBProcessDocstrings.i | 11 +++++++++++ 1 file changed, 11 insertions(+) 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