mgorny updated this revision to Diff 197325. mgorny retitled this revision from "[lldb] [Process/NetBSD] Fix handling EOF in PT_IO when reading memory" to "[lldb] [Process/NetBSD] Fix handling piod_len when reading memory". mgorny edited the summary of this revision.
CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61310/new/ https://reviews.llvm.org/D61310 Files: lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp Index: lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp =================================================================== --- lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp +++ lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp @@ -695,10 +695,10 @@ io.piod_addr = dst + bytes_read; Status error = NativeProcessNetBSD::PtraceWrapper(PT_IO, GetID(), &io); - if (error.Fail()) + if (error.Fail() || io.piod_len == 0) return error; - bytes_read = io.piod_len; + bytes_read += io.piod_len; io.piod_len = size - bytes_read; } while (bytes_read < size);
Index: lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp =================================================================== --- lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp +++ lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp @@ -695,10 +695,10 @@ io.piod_addr = dst + bytes_read; Status error = NativeProcessNetBSD::PtraceWrapper(PT_IO, GetID(), &io); - if (error.Fail()) + if (error.Fail() || io.piod_len == 0) return error; - bytes_read = io.piod_len; + bytes_read += io.piod_len; io.piod_len = size - bytes_read; } while (bytes_read < size);
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits