[NativeProcessLinux] Refactor PtraceWrapper
Summary:
This changes PtraceWrapper to return an Error, while the actual result is in an pointer parameter
(instead of the other way around). Also made a couple of PtraceWrapper arguments default to zero.
This arrangement makes a lot of the code much simpler.
Test Plan: Tests pass on linux. It compiles on android arm64/mips64.
Reviewers: chaoren, mohit.bhakkad
Subscribers: tberghammer, aemerson, lldb-commits
Differential Revision: http://reviews.llvm.org/D10808
llvm-svn: 241079
diff --git a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.h b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.h
index d72217e..fa87704 100644
--- a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.h
+++ b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.h
@@ -141,8 +141,13 @@
Error
DoOperation(const Operation &op);
- static long
- PtraceWrapper(int req, lldb::pid_t pid, void *addr, void *data, size_t data_size, Error& error);
+ static Error
+ PtraceWrapper(int req,
+ lldb::pid_t pid,
+ void *addr = nullptr,
+ void *data = nullptr,
+ size_t data_size = 0,
+ long *result = nullptr);
protected:
// ---------------------------------------------------------------------