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

Michał Górny via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 30 09:33:54 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL359572: [lldb] [Process/NetBSD] Fix handling piod_len from PT_IO calls (authored by mgorny, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D61310?vs=197326&id=197352#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61310/new/

https://reviews.llvm.org/D61310

Files:
  lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp


Index: lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
===================================================================
--- lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
+++ lldb/trunk/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);
 
@@ -723,10 +723,10 @@
     io.piod_offs = (void *)(addr + bytes_written);
 
     Status error = NativeProcessNetBSD::PtraceWrapper(PT_IO, GetID(), &io);
-    if (error.Fail())
+    if (error.Fail() || io.piod_len == 0)
       return error;
 
-    bytes_written = io.piod_len;
+    bytes_written += io.piod_len;
     io.piod_len = size - bytes_written;
   } while (bytes_written < size);
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61310.197352.patch
Type: text/x-patch
Size: 1030 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190430/70d947ff/attachment.bin>


More information about the llvm-commits mailing list