[Lldb-commits] [lldb] [lldb] Add a MemoryRegionInfo cache at a process stop (PR #202509)

Felipe de Azevedo Piovezan via lldb-commits lldb-commits at lists.llvm.org
Tue Jun 9 00:48:59 PDT 2026


================
@@ -0,0 +1,54 @@
+//===-- MemoryRegionInfoCache.cpp -----------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "lldb/Target/MemoryRegionInfoCache.h"
+#include "lldb/Core/AddressRange.h"
+#include "lldb/Target/MemoryRegionInfo.h"
+#include "lldb/Target/Process.h"
+#include "lldb/Utility/Status.h"
+
+#include "lldb/Utility/LLDBLog.h"
+#include "lldb/Utility/Log.h"
+
+using namespace lldb;
+using namespace lldb_private;
+
+void MemoryRegionInfoCache::Clear() { m_region_infos.Clear(); }
+
+void MemoryRegionInfoCache::Flush(addr_t load_addr, addr_t size) {
+  m_region_infos.Erase(load_addr, size);
+  m_region_infos.Sort();
----------------
felipepiovezan wrote:

why is sorting needed? If it's already sorted, erasing preserves that property

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


More information about the lldb-commits mailing list