From: Nicholas Nethercote Date: Sun, 13 Mar 2005 23:07:30 +0000 (+0000) Subject: For the CLIENT_CALLn client requests, we must pass in the ThreadId as the X-Git-Tag: svn/VALGRIND_3_0_0~969 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d485938fb4db05e5abf3d5d9bc1946cc493fdf1a;p=thirdparty%2Fvalgrind.git For the CLIENT_CALLn client requests, we must pass in the ThreadId as the 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 --- diff --git a/coregrind/vg_scheduler.c b/coregrind/vg_scheduler.c index efd881d77e..d344aa6f55 100644 --- a/coregrind/vg_scheduler.c +++ b/coregrind/vg_scheduler.c @@ -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; }