|
From: <sv...@va...> - 2009-07-23 00:06:39
|
Author: njn
Date: 2009-07-23 01:06:16 +0100 (Thu, 23 Jul 2009)
New Revision: 10537
Log:
Add support for __pthread_kill(). This hopefully fixes bug 201016.
Modified:
trunk/coregrind/m_syswrap/priv_syswrap-darwin.h
trunk/coregrind/m_syswrap/syswrap-darwin.c
trunk/include/vki/vki-darwin.h
trunk/memcheck/tests/darwin/scalar.c
Modified: trunk/coregrind/m_syswrap/priv_syswrap-darwin.h
===================================================================
--- trunk/coregrind/m_syswrap/priv_syswrap-darwin.h 2009-07-22 22:41:38 UTC (rev 10536)
+++ trunk/coregrind/m_syswrap/priv_syswrap-darwin.h 2009-07-23 00:06:16 UTC (rev 10537)
@@ -383,7 +383,7 @@
// NYI munlockall 325
// 326
DECL_TEMPLATE(darwin, issetugid); // 327
-// NYI __pthread_kill 328
+DECL_TEMPLATE(darwin, __pthread_kill); // 328
DECL_TEMPLATE(darwin, __pthread_sigmask); // 329
// NYI __sigwait 330
DECL_TEMPLATE(darwin, __disable_threadsignal); // 331
Modified: trunk/coregrind/m_syswrap/syswrap-darwin.c
===================================================================
--- trunk/coregrind/m_syswrap/syswrap-darwin.c 2009-07-22 22:41:38 UTC (rev 10536)
+++ trunk/coregrind/m_syswrap/syswrap-darwin.c 2009-07-23 00:06:16 UTC (rev 10537)
@@ -1563,6 +1563,13 @@
}
+PRE(__pthread_kill)
+{
+ PRINT("__pthread_kill ( %ld, %ld )", ARG1, ARG2);
+ PRE_REG_READ2(long, "__pthread_kill", vki_pthread_t*, thread, int, sig);
+}
+
+
PRE(__pthread_sigmask)
{
// GrP fixme
@@ -7437,7 +7444,7 @@
// _____(__NR_munlockall),
_____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(326)), // ???
MACX_(__NR_issetugid, issetugid),
-// _____(__NR___pthread_kill),
+ MACX_(__NR___pthread_kill, __pthread_kill),
MACX_(__NR___pthread_sigmask, __pthread_sigmask),
// _____(__NR___sigwait),
MACX_(__NR___disable_threadsignal, __disable_threadsignal),
Modified: trunk/include/vki/vki-darwin.h
===================================================================
--- trunk/include/vki/vki-darwin.h 2009-07-22 22:41:38 UTC (rev 10536)
+++ trunk/include/vki/vki-darwin.h 2009-07-23 00:06:16 UTC (rev 10537)
@@ -71,6 +71,7 @@
#define vki_clock_t clock_t
#define vki_u_int32_t u_int32_t
#define vki_u_int16_t u_int16_t
+#define vki_pthread_t pthread_t
// valgrind special
Modified: trunk/memcheck/tests/darwin/scalar.c
===================================================================
--- trunk/memcheck/tests/darwin/scalar.c 2009-07-22 22:41:38 UTC (rev 10536)
+++ trunk/memcheck/tests/darwin/scalar.c 2009-07-23 00:06:16 UTC (rev 10537)
@@ -576,7 +576,10 @@
GO_UNIMP(326, "unused");
// __NR_issetugid 327
- // __NR___pthread_kill 328
+
+ GO(__NR___pthread_kill, 328, "2s 0m");
+ SY(__NR___pthread_kill, x0, x0); FAIL;
+
// __NR___pthread_sigmask 329
// __NR___sigwait 330
// __NR_sigwait 330) // GrP fixme hack
@@ -730,7 +733,7 @@
//SY(__NR_stime); // (Not yet handled by Valgrind) FAIL;
// __NR_ptrace 26
- // XXX: memory pointed to be arg3 goes unchecked... otherwise would be 2m
+ // XXX: memory pointed to by arg3 goes unchecked... otherwise would be 2m
GO(__NR_ptrace, "4s 1m");
SY(__NR_ptrace, x0+PTRACE_GETREGS, x0, x0, x0); FAIL;
|