llvm-project
e89dc217 - [lldb] Stop a cached read at an invalid range (#218997)

Commit
2 days ago
[lldb] Stop a cached read at an invalid range (#218997) `MemoryCache::Read` refused a read only when its first byte sat in a range the process had recorded as invalid. A read whose interior met such a range was served in full, out of a cache line fetched straight across it, which is what the `FIXME` in that function described: ``` // FIXME: We should do a more thorough check to make sure that we're not // overlapping with any invalid ranges (e.g. Read 0x100 - 0x200 but there's an // invalid range 0x180 - 0x280). ``` With an invalid range at `[0xE010, 0xE020)`, a 64-byte read at `0xE000` returned 64 bytes and a success status. Test the whole requested range for an intersection instead. Report the failure, and shorten the read to the bytes below the range, so a caller gets the readable prefix and an error rather than data the process said is not there. A read starting inside a range still serves nothing.
Author
Parents
Loading