[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:02 PDT 2026
================
@@ -0,0 +1,46 @@
+//===-- MemoryRegionInfoCache.h ---------------------------------*- C++ -*-===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLDB_TARGET_MEMORYREGIONINFOCACHE_H
+#define LLDB_TARGET_MEMORYREGIONINFOCACHE_H
+
+#include "lldb/Target/MemoryRegionInfo.h"
+#include "lldb/Utility/RangeMap.h"
+
+#include <mutex>
+#include <optional>
+
+namespace lldb_private {
+class MemoryRegionInfoCache {
+public:
+ MemoryRegionInfoCache() : m_region_infos(), m_mutex() {}
+
+ /// Remove all cached entries. Should be called whenever
+ /// Process resumes execution of the inferior.
+ void Clear();
+
+ /// Remove cached information about region containing \p addr, if any.
+ void Erase(lldb::addr_t addr, lldb::addr_t size);
----------------
JDevlieghere wrote:
Nit: Why represent the size as an addr_t? I guess not size_t because that's the host's, so maybe just uint64_t?
```suggestion
void Erase(lldb::addr_t addr, size_t size);
```
https://github.com/llvm/llvm-project/pull/206208
More information about the lldb-commits
mailing list