17 return !(region_one->GetRangeEnd() < region_two->GetRangeBase() ||
18 region_two->GetRangeEnd() < region_one->GetRangeBase());
22 return region_one->GetRangeBase() == region_two->GetRangeEnd() ||
23 region_one->GetRangeEnd() == region_two->GetRangeBase();
32 return region_one->data.lldb_permissions == region_two->data.lldb_permissions;
40 for (
size_t i = this->
GetSize() - 1; i > 0; i--) {
43 if (
Overlaps(region_one, region_two)) {
50 "Memory region at {0}::{1} has different permssions than "
51 "overlapping region at {2}::{3}",
52 region_one->GetRangeBase(), region_one->GetRangeEnd(),
53 region_two->GetRangeBase(), region_two->GetRangeEnd());
61 std::min(region_one->GetRangeBase(), region_two->GetRangeBase());
63 std::max(region_one->GetRangeEnd(), region_two->GetRangeEnd()) - base;
65 region_two->SetRangeBase(base);
66 region_two->SetByteSize(byte_size);
71 llvm::AddressRange range(base, base + byte_size);
74 region_two->data = core_range;
76 if (!this->
Erase(i, i + 1)) {
78 "Core file memory ranges mutated outside of "
79 "CalculateCoreFileSaveRanges");
static llvm::raw_ostream & error(Stream &strm)
static bool OnlyIntersects(const Entry *region_one, const Entry *region_two)
static bool Overlaps(const Entry *region_one, const Entry *region_two)
static bool IntersectHelper(const Entry *region_one, const Entry *region_two)
static bool PermissionsMatch(const Entry *region_one, const Entry *region_two)
Status FinalizeCoreFileSaveRanges()
Finalize and merge all overlapping ranges in this collection.
Entry * GetMutableEntryAtIndex(size_t i)
bool Erase(uint32_t start, uint32_t end)
static Status FromErrorStringWithFormat(const char *format,...) __attribute__((format(printf
static Status static Status FromErrorStringWithFormatv(const char *format, Args &&...args)
A class that represents a running process on the host machine.
uint32_t lldb_permissions
The address range to save into the core file.