diff options
Diffstat (limited to 'lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp')
| -rw-r--r-- | lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp b/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp index 839fc33c8d9..feba3af8fcf 100644 --- a/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp +++ b/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp @@ -159,8 +159,10 @@ static size_t DoReadMemory(lldb::pid_t pid, lldb::addr_t vm_addr, void *buf, pi_desc.piod_addr = buf; pi_desc.piod_len = size; - if (PTRACE(PT_IO, pid, (caddr_t)&pi_desc, 0) < 0) + if (PTRACE(PT_IO, pid, (caddr_t)&pi_desc, 0) < 0) { error.SetErrorToErrno(); + return 0; + } return pi_desc.piod_len; } @@ -173,8 +175,10 @@ static size_t DoWriteMemory(lldb::pid_t pid, lldb::addr_t vm_addr, pi_desc.piod_addr = (void *)buf; pi_desc.piod_len = size; - if (PTRACE(PT_IO, pid, (caddr_t)&pi_desc, 0) < 0) + if (PTRACE(PT_IO, pid, (caddr_t)&pi_desc, 0) < 0) { error.SetErrorToErrno(); + return 0; + } return pi_desc.piod_len; } |

