mirror of
https://git.suyu.dev/suyu/breakpad.git
synced 2026-01-07 06:58:20 +01:00
Extend ContainedRangeMap and StaticContainedRangeMap
This adds a new mode in ContainedRangeMap which allows existance of equal ranges. Among those equal ranges, the most recently added range is the innermost range. This also adds a function to ContainedRangeMap and StaticContainedRangeMap to allow users get a vector of entries that contains given address from innermost to outermost ranges. Change-Id: I84c1f2e49ffcaf8238df60e41498730103d1ead6 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3291137 Reviewed-by: Joshua Peraza <jperaza@chromium.org>
This commit is contained in:
parent
4ee9854be5
commit
4458a5965a
6 changed files with 240 additions and 45 deletions
|
|
@ -87,6 +87,23 @@ bool StaticContainedRangeMap<AddressType, EntryType>::RetrieveRange(
|
|||
return true;
|
||||
}
|
||||
|
||||
template <typename AddressType, typename EntryType>
|
||||
bool StaticContainedRangeMap<AddressType, EntryType>::RetrieveRanges(
|
||||
const AddressType& address,
|
||||
std::vector<const EntryType*>& entries) const {
|
||||
MapConstIterator iterator = map_.lower_bound(address);
|
||||
if (iterator == map_.end())
|
||||
return false;
|
||||
const char* memory_child =
|
||||
reinterpret_cast<const char*>(iterator.GetValuePtr());
|
||||
StaticContainedRangeMap child_map(memory_child);
|
||||
if (address < child_map.base_)
|
||||
return false;
|
||||
child_map.RetrieveRanges(address, entries);
|
||||
entries.push_back(child_map.entry_ptr_);
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace google_breakpad
|
||||
|
||||
#endif // PROCESSOR_STATIC_CONTAINED_RANGE_MAP_INL_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue