]> sourceware.org Git - valgrind.git/commitdiff
Add missing syscall wrapper on Solaris
authorPaul Floyd <pjfloyd@wanadoo.fr>
Mon, 22 Nov 2021 03:12:16 +0000 (04:12 +0100)
committerPaul Floyd <pjfloyd@wanadoo.fr>
Mon, 22 Nov 2021 03:12:16 +0000 (04:12 +0100)
I tried to test drd/tests/pth_mutex_signal on Solaris
(you never know) but encountered a missing syscall
wrapper. So this adds a very basic wrapper for lwp_mutex_unlock.

Also update a Solaris expected that I missed amongst the FreeBSD changes.

coregrind/m_syswrap/syswrap-solaris.c
gdbserver_tests/solaris/nlcontrolc.stdoutB.exp
include/vki/vki-scnums-solaris.h

index 5dba90ac8718f2dde303c4e4696c240cc921eaf8..d1ce0fd6bb1ef9d1d19588cb33ca403f16798cda 100644 (file)
@@ -1067,6 +1067,7 @@ DECL_TEMPLATE(solaris, sys_getpeername);
 DECL_TEMPLATE(solaris, sys_getsockname);
 DECL_TEMPLATE(solaris, sys_getsockopt);
 DECL_TEMPLATE(solaris, sys_setsockopt);
+DECL_TEMPLATE(solaris, sys_lwp_mutex_unlock);
 DECL_TEMPLATE(solaris, sys_lwp_mutex_register);
 DECL_TEMPLATE(solaris, sys_uucopy);
 DECL_TEMPLATE(solaris, sys_umount2);
@@ -10635,6 +10636,21 @@ PRE(sys_lwp_mutex_register)
    PRE_FIELD_READ("lwp_mutex_register(mp->mutex_type)", mp->vki_mutex_type);
 }
 
+PRE(sys_lwp_mutex_unlock)
+{
+   /* int lwp_mutex_unlock(lwp_mutex_t *lp); */
+   vki_lwp_mutex_t *lp = (vki_lwp_mutex_t*)ARG1;
+   PRINT("sys_lwp_mutex_unlock ( %#lx )", ARG1);
+   PRE_REG_READ1(int, "lwp_mutex_unlock", lwp_mutex_t *, lp);
+   PRE_MEM_READ("lwp_mutex_unlock(lp)", (Addr)lp, sizeof(vki_lwp_mutex_t));
+   PRE_MEM_WRITE("lwp_mutex_unlock(lp)", (Addr)lp, sizeof(vki_lwp_mutex_t));
+}
+
+POST(sys_lwp_mutex_unlock)
+{
+   POST_MEM_WRITE(ARG1, sizeof(vki_lwp_mutex_t));
+}
+
 PRE(sys_uucopy)
 {
    /* int uucopy(const void *s1, void *s2, size_t n); */
@@ -11027,6 +11043,7 @@ static SyscallTableEntry syscall_table[] = {
    SOLXY(__NR_getsockname,          sys_getsockname),           /* 244 */
    SOLXY(__NR_getsockopt,           sys_getsockopt),            /* 245 */
    SOLX_(__NR_setsockopt,           sys_setsockopt),            /* 246 */
+   SOLXY(__NR_lwp_mutex_unlock,     sys_lwp_mutex_unlock),      /* 250 */
    SOLX_(__NR_lwp_mutex_register,   sys_lwp_mutex_register),    /* 252 */
    SOLXY(__NR_uucopy,               sys_uucopy),                /* 254 */
    SOLX_(__NR_umount2,              sys_umount2)                /* 255 */
index ca29a44e104f9dd41dccf90bf12afeca65094fd4..d3684dfbf01d701721420324982cb8f5c8e280f1 100644 (file)
@@ -5,8 +5,8 @@ Program received signal SIGTRAP, Trace/breakpoint trap.
 Now threads are burning CPU
 Continuing.
 Program received signal SIGTRAP, Trace/breakpoint trap.
-0x........ in do_burn () at sleepers.c:41
-41        for (i = 0; i < burn; i++) loopnr++;
+do_burn () at sleepers.c:40
+40        for (i = 0; i < burn; i++) loopnr++;
 $1 = 0
 $2 = 0
 $3 = 0
index d043dd8bcc97e9553fac850c0d302e5bbc6327d7..99388091a8137323efc8ea60c7d39518c9baa302 100644 (file)
 //#define __NR_sockconfig                 SYS_sockconfig
 //#define __NR_ntp_gettime                SYS_ntp_gettime
 //#define __NR_ntp_adjtime                SYS_ntp_adjtime
-//#define __NR_lwp_mutex_unlock           SYS_lwp_mutex_unlock
+#define __NR_lwp_mutex_unlock           SYS_lwp_mutex_unlock
 //#define __NR_lwp_mutex_trylock          SYS_lwp_mutex_trylock
 #define __NR_lwp_mutex_register         SYS_lwp_mutex_register
 //#define __NR_cladm                      SYS_cladm
This page took 0.045194 seconds and 5 git commands to generate.