]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
For the CLIENT_CALLn client requests, we must pass in the ThreadId as the
authorNicholas Nethercote <njn@valgrind.org>
Sun, 13 Mar 2005 23:07:30 +0000 (23:07 +0000)
committerNicholas Nethercote <njn@valgrind.org>
Sun, 13 Mar 2005 23:07:30 +0000 (23:07 +0000)
first argument to the function.  This seemingly got lost in the CVS+SVN
merge, which meant that any function called with these client requests was
getting totally mixed-up arguments.  Since TL_(malloc)() and friends are
called this way, this was affecting all tools that replace malloc(), ie.
Memcheck, Addrcheck, Helgrind, Massif.

Massif is now working again for me as a result of this fix.  I haven't tried
the other tools yet.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3349

coregrind/vg_scheduler.c

index efd881d77e31be1ed16b0b33badcf7cf1770a4a7..d344aa6f5583f024d5c040d5b8787f305a241c48 100644 (file)
@@ -976,35 +976,35 @@ void do_client_request ( ThreadId tid )
    switch (req_no) {
 
       case VG_USERREQ__CLIENT_CALL0: {
-         UWord (*f)(void) = (void*)arg[1];
+         UWord (*f)(ThreadId) = (void*)arg[1];
         if (f == NULL)
            VG_(message)(Vg_DebugMsg, "VG_USERREQ__CLIENT_CALL0: func=%p\n", f);
         else
-           SET_CLCALL_RETVAL(tid, f ( ), (Addr)f);
+           SET_CLCALL_RETVAL(tid, f ( tid ), (Addr)f);
          break;
       }
       case VG_USERREQ__CLIENT_CALL1: {
-         UWord (*f)(UWord) = (void*)arg[1];
+         UWord (*f)(ThreadId, UWord) = (void*)arg[1];
         if (f == NULL)
            VG_(message)(Vg_DebugMsg, "VG_USERREQ__CLIENT_CALL1: func=%p\n", f);
         else
-           SET_CLCALL_RETVAL(tid, f ( arg[2] ), (Addr)f );
+           SET_CLCALL_RETVAL(tid, f ( tid, arg[2] ), (Addr)f );
          break;
       }
       case VG_USERREQ__CLIENT_CALL2: {
-         UWord (*f)(UWord, UWord) = (void*)arg[1];
+         UWord (*f)(ThreadId, UWord, UWord) = (void*)arg[1];
         if (f == NULL)
            VG_(message)(Vg_DebugMsg, "VG_USERREQ__CLIENT_CALL2: func=%p\n", f);
         else
-           SET_CLCALL_RETVAL(tid, f ( arg[2], arg[3] ), (Addr)f );
+           SET_CLCALL_RETVAL(tid, f ( tid, arg[2], arg[3] ), (Addr)f );
          break;
       }
       case VG_USERREQ__CLIENT_CALL3: {
-         UWord (*f)(UWord, UWord, UWord) = (void*)arg[1];
+         UWord (*f)(ThreadId, UWord, UWord, UWord) = (void*)arg[1];
         if (f == NULL)
            VG_(message)(Vg_DebugMsg, "VG_USERREQ__CLIENT_CALL3: func=%p\n", f);
         else
-           SET_CLCALL_RETVAL(tid, f ( arg[2], arg[3], arg[4] ), (Addr)f );
+           SET_CLCALL_RETVAL(tid, f ( tid, arg[2], arg[3], arg[4] ), (Addr)f );
          break;
       }