Date: Tue, 11 Nov 2008 08:04:08 GMT From: Peter Wemm <peter@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 152800 for review Message-ID: <200811110804.mAB848dc020854@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=152800 Change 152800 by peter@peter_freefall on 2008/11/11 08:03:33 Get a little closer to 32 bit libthr functionality. Put the client's startup args on the correct stack. Affected files ... .. //depot/projects/valgrind/coregrind/m_syswrap/syswrap-x86-freebsd.c#14 edit Differences ... ==== //depot/projects/valgrind/coregrind/m_syswrap/syswrap-x86-freebsd.c#14 (text+ko) ==== @@ -355,15 +355,15 @@ VG_(sigprocmask)(VKI_SIG_SETMASK, &blockall, &savedmask); /* Set the client state for scheduler to run libthr's trampoline */ - ctst->arch.vex.guest_ESP = (Addr)tp.stack_base + tp.stack_size - 4; + ctst->arch.vex.guest_ESP = (Addr)tp.stack_base + tp.stack_size - 8; ctst->arch.vex.guest_EIP = (Addr)tp.start_func; + *(UWord *)(ctst->arch.vex.guest_ESP + 4) = (UWord)tp.arg; /* Client arg */ + *(UWord *)(ctst->arch.vex.guest_ESP + 0) = 0; /* fake return addr */ /* Set up valgrind's trampoline on its own stack */ stk = ML_(allocstack)(ctid); tp.stack_base = (void *)ctst->os_state.valgrind_stack_base; tp.stack_size = (Addr)stk - (Addr)tp.stack_base; - *(UWord *)(stk - 4) = (UWord)tp.arg; /* Client arg */ - *(UWord *)(stk - 8) = 0xdeadc0de; /* fake return addr */ /* This is for thr_new() to run valgrind's trampoline */ tp.start_func = (void *)ML_(start_thread_NORETURN); tp.arg = &VG_(threads)[ctid]; @@ -383,6 +383,7 @@ POST_MEM_WRITE((Addr)tp.parent_tid, sizeof(long)); POST_MEM_WRITE((Addr)tp.child_tid, sizeof(long)); + POST_MEM_WRITE((Addr)ctst->arch.vex.guest_ESP, 8); /* Thread creation was successful; let the child have the chance to run */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200811110804.mAB848dc020854>