[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:01 PDT 2026
================
@@ -0,0 +1,53 @@
+//===-- 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"
+
+using namespace lldb;
+using namespace lldb_private;
+
+void MemoryRegionInfoCache::Clear() { m_region_infos.Clear(); }
+
+void MemoryRegionInfoCache::Erase(addr_t load_addr, addr_t size) {
+ std::lock_guard<std::recursive_mutex> guard(m_mutex);
+ uint32_t start_idx = m_region_infos.FindEntryIndexThatContains(load_addr);
+ uint32_t end_idx =
+ m_region_infos.FindEntryIndexThatContains(load_addr + size);
----------------
JDevlieghere wrote:
Shouldn't this be `load_addr + size - 1` for the end-of-range lookup?
https://github.com/llvm/llvm-project/pull/206208
More information about the lldb-commits
mailing list