VG_(memset)(&arch->vex_shadow, 0, sizeof(VexGuestAMD64State));
/* Put essential stuff into the new state. */
-
+ VG_(printf)("startup rsp 0x%llx rip 0x%llx\n", rsp_at_startup, client_rip);
arch->vex.guest_RSP = rsp_at_startup;
arch->vex.guest_RIP = client_rip;
if (block) {
Int lwp = proxy->lwp;
-VG_(printf)("OINK 503\n");
if(proxy->lwp != 0)
+ /* JEREMY: amd64 hangs here at exit */
do_futex(&proxy->lwp, VKI_FUTEX_WAIT, lwp, NULL, NULL);
-VG_(printf)("OINK 504\n");
if (status)
*status = proxy->exitcode;
ret = True;
} else {
Int flags = __VKI_WCLONE;
Int res;
-VG_(printf)("OINK 506\n");
if (!block)
flags |= VKI_WNOHANG;
res = VG_(waitpid)(proxy->lwp, status, flags);
vg_assert(proxy->tid == tid);
if (proxy->terminating)
return; /* already going away */
-VG_(printf)("OINK 401\n");
+
proxy->terminating = True;
-VG_(printf)("OINK 402\n");
VG_(close)(proxy->topx);
proxy->topx = -1;
-VG_(printf)("OINK 403\n");
/* proxy thread will close proxy->frommain itself */
-VG_(printf)("OINK 404\n");
if (force && lwp != 0) {
/* wouldn't need to force it if it were already dead */
vg_assert(tst->status != VgTs_Empty);
status = -1;
res = False;
-VG_(printf)("OINK 405\n");
/* We need to wait for the PX_Exiting message before doing the
proxy_wait, because if we don't read the results pipe, the proxy
may be blocked writing to it, causing a deadlock with us as we
wait for it to exit. */
sys_wait_results(True, tid, PX_Exiting, True);
-VG_(printf)("OINK 405a\n");
res = proxy_wait(proxy, True, &status);
-VG_(printf)("OINK 406\n");
if ((!res || status != 0) && VG_(clo_verbosity) > 1)
VG_(printf)("proxy %d for tid %d exited status %d, res %d\n",
lwp, tid, status, res);
-VG_(printf)("OINK 407\n");
LWP_free(proxy);
-VG_(printf)("OINK 408\n");
tst->proxy = NULL;
}
void VG_(nuke_all_threads_except) ( ThreadId me )
{
ThreadId tid;
- VG_(printf)("HACK HACK HACK: nuke_all_threads_except\n"); return;
+ if (0) {
+ VG_(printf)("HACK HACK HACK: nuke_all_threads_except\n");
+ return;
+ }
for (tid = 1; tid < VG_N_THREADS; tid++) {
if (tid == me
if (1)
VG_(printf)(
"VG_(nuke_all_threads_except): nuking tid %d\n", tid);
-VG_(printf)("OINK 49\n");
VG_(proxy_delete)(tid, True);
-VG_(printf)("OINK 49a\n");
VG_(threads)[tid].status = VgTs_Empty;
VG_(threads)[tid].associated_mx = NULL;
VG_(threads)[tid].associated_cv = NULL;
VG_(threads)[tid].stack_base = (Addr)NULL;
VG_(threads)[tid].stack_size = 0;
cleanup_after_thread_exited( tid, True );
-VG_(printf)("OINK 4\n");
}
-VG_(printf)("OINK 5\n");
}