aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChaoren Lin <chaorenl@google.com>2015-02-28 00:20:16 +0000
committerChaoren Lin <chaorenl@google.com>2015-02-28 00:20:16 +0000
commitc934659736c7ae546fbcf7c8f546e152955bc1be (patch)
tree59a3c2bef2e8f487c8e43d3ec7642ffcfd1c3856
parentcd187f033e9cc5b4904be20a47041763fbbc95e8 (diff)
downloadllvm-c934659736c7ae546fbcf7c8f546e152955bc1be.zip
llvm-c934659736c7ae546fbcf7c8f546e152955bc1be.tar.gz
llvm-c934659736c7ae546fbcf7c8f546e152955bc1be.tar.bz2
Casting pid to ::pid_t when invoking syscall.
Summary: syscalls involving pid/tid on 32 bit binaries are failing with "Invalid argument" because the uint64_t arguments are too wide. Reviewers: clayborg, ovyalov, sivachandra Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D7963 llvm-svn: 230817
-rw-r--r--lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp3
-rw-r--r--lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp3
2 files changed, 4 insertions, 2 deletions
diff --git a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
index 61d498f..198addd 100644
--- a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+++ b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
@@ -123,7 +123,8 @@
// Try to define a macro to encapsulate the tgkill syscall
// fall back on kill() if tgkill isn't available
-#define tgkill(pid, tid, sig) syscall(SYS_tgkill, pid, tid, sig)
+#define tgkill(pid, tid, sig) \
+ syscall(SYS_tgkill, static_cast<::pid_t>(pid), static_cast<::pid_t>(tid), sig)
// We disable the tracing of ptrace calls for integration builds to
// avoid the additional indirection and checks.
diff --git a/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp b/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp
index b2754bc..4616163 100644
--- a/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp
+++ b/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp
@@ -88,7 +88,8 @@
// Try to define a macro to encapsulate the tgkill syscall
// fall back on kill() if tgkill isn't available
-#define tgkill(pid, tid, sig) syscall(SYS_tgkill, pid, tid, sig)
+#define tgkill(pid, tid, sig) \
+ syscall(SYS_tgkill, static_cast<::pid_t>(pid), static_cast<::pid_t>(tid), sig)
using namespace lldb_private;