Skip to content

Commit 024254e

Browse files
committed
GCF
1 parent 91ce099 commit 024254e

File tree

2 files changed

+24
-22
lines changed

2 files changed

+24
-22
lines changed

lldb/include/lldb/Utility/RangeMap.h

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -380,24 +380,24 @@ template <typename B, typename S, unsigned N = 0> class RangeVector {
380380
return nullptr;
381381
}
382382

383-
const Entry* FindEntryThatIntersects(const Entry &range) const {
384-
#ifdef ASSERT_RANGEMAP_ARE_SORTED
385-
assert(IsSorted());
386-
#endif
387-
if (!m_entries.empty()) {
388-
typename Collection::const_iterator begin = m_entries.begin();
389-
typename Collection::const_iterator end = m_entries.end();
390-
typename Collection::const_iterator pos =
391-
std::lower_bound(begin, end, range, BaseLessThan);
392-
393-
while (pos != begin && pos[-1].DoesIntersect(range))
394-
--pos;
395-
396-
if (pos != end && pos->DoesIntersect(range))
397-
return &(*pos);
398-
}
399-
return nullptr;
383+
const Entry *FindEntryThatIntersects(const Entry &range) const {
384+
#ifdef ASSERT_RANGEMAP_ARE_SORTED
385+
assert(IsSorted());
386+
#endif
387+
if (!m_entries.empty()) {
388+
typename Collection::const_iterator begin = m_entries.begin();
389+
typename Collection::const_iterator end = m_entries.end();
390+
typename Collection::const_iterator pos =
391+
std::lower_bound(begin, end, range, BaseLessThan);
392+
393+
while (pos != begin && pos[-1].DoesIntersect(range))
394+
--pos;
395+
396+
if (pos != end && pos->DoesIntersect(range))
397+
return &(*pos);
400398
}
399+
return nullptr;
400+
}
401401

402402
using const_iterator = typename Collection::const_iterator;
403403
const_iterator begin() const { return m_entries.begin(); }

lldb/source/Target/Process.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6689,9 +6689,11 @@ static void GetCoreFileSaveRangesStackOnly(Process &process,
66896689
}
66906690
}
66916691

6692-
// TODO: We should refactor CoreFileMemoryRanges to use the lldb range type, and then
6693-
// add an intersect method on it, or MemoryRegionInfo.
6694-
static MemoryRegionInfo Intersect(const MemoryRegionInfo &lhs, const Range<lldb::addr_t, lldb::addr_t> &rhs) {
6692+
// TODO: We should refactor CoreFileMemoryRanges to use the lldb range type, and
6693+
// then add an intersect method on it, or MemoryRegionInfo.
6694+
static MemoryRegionInfo
6695+
Intersect(const MemoryRegionInfo &lhs,
6696+
const Range<lldb::addr_t, lldb::addr_t> &rhs) {
66956697
const lldb::addr_t lhs_base = lhs.GetRange().GetRangeBase();
66966698
const lldb::addr_t rhs_base = rhs.GetRangeBase();
66976699
const lldb::addr_t lhs_end = lhs.GetRange().GetRangeEnd();
@@ -6717,8 +6719,8 @@ static void GetUserSpecifiedCoreFileSaveRanges(Process &process,
67176719
for (const auto &range : regions) {
67186720
auto *entry = option_ranges.FindEntryThatIntersects(range.GetRange());
67196721
if (entry) {
6720-
if (entry->GetRangeBase() != range.GetRange().GetRangeBase()
6721-
|| entry->GetRangeEnd() != range.GetRange().GetRangeEnd()) {
6722+
if (entry->GetRangeBase() != range.GetRange().GetRangeBase() ||
6723+
entry->GetRangeEnd() != range.GetRange().GetRangeEnd()) {
67226724
AddRegion(Intersect(range, *entry), true, ranges);
67236725
} else {
67246726
// If they match, add the range directly.

0 commit comments

Comments
 (0)