[Lldb-commits] [lldb] Revert "[LLDB] Reappply SBSaveCore AddMemoryList" (PR #107731)
Jason Molenda via lldb-commits
lldb-commits at lists.llvm.org
Mon Sep 9 15:37:28 PDT 2024
jasonmolenda wrote:
Took a quick peek at what debugserver is sending back. For this program there are 68 separate memory regions. There are 593 dirty pages across those 68 regions, pagesize is 16384 so 9715712 bytes of dirty memory (what we see lldb dumping currently). This entry,
```
< 90> read packet: $start:16f604000;size:7fc000;permissions:rw;dirty-pages:16fdf8000,16fdfc000;type:stack;#00
```
gives us a CoreFileMemoryRange of
```
[0] = {
lldb_private::RangeData<unsigned long long, unsigned long long, lldb_private::CoreFileMemoryRange> = {
lldb_private::Range<unsigned long long, unsigned long long> = (base = 6171885568, size = 6171918336)
```
which is quite large. Maybe one of these functions is taking an address & a size, instead of a start address and an end address.
```
for (addr_t page_addr : *dirty_page_list) {
if (range.empty()) {
// No range yet, initialize the range with the current dirty page.
range = llvm::AddressRange(page_addr, page_addr + page_size);
} else {
if (range.end() == page_addr) {
// Combine consective ranges.
range = llvm::AddressRange(range.start(), page_addr + page_size);
} else {
// Add previous contiguous range and init the new range with the
// current dirty page.
ranges.Append(range.start(), range.end(), {range, lldb_permissions});
range = llvm::AddressRange(page_addr, page_addr + page_size);
}
}
```
https://github.com/llvm/llvm-project/pull/107731
More information about the lldb-commits
mailing list