[Lldb-commits] [lldb] r230817 - Casting pid to ::pid_t when invoking syscall.

Chaoren Lin chaorenl at google.com
Fri Feb 27 16:20:16 PST 2015


Author: chaoren
Date: Fri Feb 27 18:20:16 2015
New Revision: 230817

URL: http://llvm.org/viewvc/llvm-project?rev=230817&view=rev
Log:
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

Modified:
    lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp
    lldb/trunk/source/Plugins/Process/Linux/ProcessMonitor.cpp

Modified: lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp?rev=230817&r1=230816&r2=230817&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp Fri Feb 27 18:20:16 2015
@@ -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.

Modified: lldb/trunk/source/Plugins/Process/Linux/ProcessMonitor.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/ProcessMonitor.cpp?rev=230817&r1=230816&r2=230817&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Linux/ProcessMonitor.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Linux/ProcessMonitor.cpp Fri Feb 27 18:20:16 2015
@@ -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;
 





More information about the lldb-commits mailing list