Skip to content
Commit d14a0de9 authored by Michal Gorny's avatar Michal Gorny
Browse files

[lldb] [Process/NetBSD] Fix handling piod_len from PT_IO calls

Fix bugs in piod_len return value processing in ReadMemory()
and WriteMemory() methods.  In particular, add support for piod_len == 0
indicating EOF, and fix summing bytes_read/bytes_written when PT_IO does
partial reads/writes.

The EOF condition could happen if LLDB attempts to read past
vm.maxaddress, e.g. as a result of RBP containing large (invalid) value.
Previously, the 0 return caused the function to retry reading via PT_IO
indefinitely, effectively deadlooping lldb-server.

Partial reads probably did not occur in practice, yet they would cause
ReadMemory() to return incorrect bytes_read and/or overwrite previously
read data.

WriteMemory() suffered from analoguous problems.

Differential Revision: https://reviews.llvm.org/D61310

llvm-svn: 359572
parent 68924e6b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment