================ @@ -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 _______________________________________________ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
