[Lldb-commits] [lldb] [LLDB][SBSaveCore] Sbsavecore subregions bug (PR #138206)

Jacob Lalonde via lldb-commits lldb-commits at lists.llvm.org
Thu May 1 15:43:26 PDT 2025


================
@@ -380,6 +380,25 @@ template <typename B, typename S, unsigned N = 0> class RangeVector {
     return nullptr;
   }
 
+  const Entry *FindEntryThatIntersects(const Entry &range) const {
+#ifdef ASSERT_RANGEMAP_ARE_SORTED
+    assert(IsSorted());
+#endif
+    if (!m_entries.empty()) {
+      typename Collection::const_iterator begin = m_entries.begin();
+      typename Collection::const_iterator end = m_entries.end();
+      typename Collection::const_iterator pos =
+          std::lower_bound(begin, end, range, BaseLessThan);
+
+      while (pos != begin && pos[-1].DoesIntersect(range))
----------------
Jlalond wrote:

I'm open to `std::prev`, but I mostly copied the examples from the other functions which did `pos[-1]`. 

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


More information about the lldb-commits mailing list