[Lldb-commits] [lldb] [lldb] Add memory region info cache to Process (PR #206208)

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Fri Jun 26 16:54:03 PDT 2026


================
@@ -2697,7 +2701,11 @@ addr_t Process::AllocateMemory(size_t size, uint32_t permissions,
     return LLDB_INVALID_ADDRESS;
   }
 
-  return m_allocated_memory_cache.AllocateMemory(size, permissions, error);
+  addr_t alloced_addr =
+      m_allocated_memory_cache.AllocateMemory(size, permissions, error);
+  m_memory_region_infos_cache.Erase(alloced_addr, size);
----------------
JDevlieghere wrote:

If `AllocateMemory` return an `LLDB_INVALID_ADDRESS`, calling Erase will overflow. Let's guard for that in Erase.

https://github.com/llvm/llvm-project/pull/206208


More information about the lldb-commits mailing list