================
@@ -0,0 +1,31 @@
+import lldb
+
+SINGLE_INSTANCE_PATTERN = "there_is_only_one_of_me"
+DOUBLE_INSTANCE_PATTERN = "there_is_exactly_two_of_me"
+
+
+def GetAddressRanges(test_base):
+    mem_regions = test_base.process.GetMemoryRegions()
+    test_base.assertTrue(len(mem_regions) > 0, "Make sure there are memory 
regions")
+    addr_ranges = lldb.SBAddressRangeList()
+    for i in range(mem_regions.GetSize()):
+        region_info = lldb.SBMemoryRegionInfo()
+        if not mem_regions.GetMemoryRegionAtIndex(i, region_info):
+            continue
+        if not (region_info.IsReadable() and region_info.IsWritable()):
+            continue
+        if region_info.IsExecutable():
+            continue
+        if not region_info.GetName() or region_info.GetName() != "[heap]":
----------------
mbucko wrote:

The above example doesn't have a name which also satisfies the condition so it 
should work. I mainly wanted to remove regions such as "[stack]" and 
"/some/path/lib.o" ...

https://github.com/llvm/llvm-project/pull/95007
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to