From 36b5b84cf01caee2daae6993c99f411a73fd0ff2 Mon Sep 17 00:00:00 2001 From: zandy Date: Fri, 29 Oct 1999 22:32:32 +0000 Subject: [PATCH] Don't stop children of mutatees in exec. This is temporary until fork/exec callbacks are implemented for Dyninst. --- dyninstAPI/src/irix.C | 17 ++++++++++++----- dyninstAPI/src/solaris.C | 12 +++++++++--- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/dyninstAPI/src/irix.C b/dyninstAPI/src/irix.C index a9be348..cc73abc 100644 --- a/dyninstAPI/src/irix.C +++ b/dyninstAPI/src/irix.C @@ -39,7 +39,7 @@ * incur to third parties resulting from your use of Paradyn. */ -// $Id: irix.C,v 1.10 1999/08/09 05:50:24 csserra Exp $ +// $Id: irix.C,v 1.11 1999/10/29 22:32:32 zandy Exp $ #include // procfs #include // procfs @@ -384,12 +384,19 @@ bool process::attach() // step 3 - /proc PIOC{SET,RESET}: // a) turn on the kill-on-last-close flag (kills inferior with SIGKILL when // the last writable /proc fd closes) - // b) turn on inherit-on-fork flag (tracing flags inherited when child forks). + // b) turn on inherit-on-fork flag (tracing flags inherited when + // child forks), Paradyn only. // c) turn off run-on-last-close flag (on by default) - // Also, any child of this process will stop at the exit of an exec call. - long flags = PR_FORK; + // Also, any child of this process will stop at the exit of an exec + // call, Paradyn only. + long flags = 0; + /* FIXME: When fork/exec callbacks are implemented for Dyninst, set + PR_FORK for Dyninst, too. It is not set now because otherwise + the child would inherit trap-on-exit from exec. With no way for + a mutator to handle this stop, the child process would remain + stopped indefinitely. */ #ifndef BPATCH_LIBRARY - flags |= PR_KLC; + flags = PR_KLC | PR_FORK; #endif if (ioctl (fd, PIOCSET, &flags) < 0) { perror("process::attach(PIOCSET)"); diff --git a/dyninstAPI/src/solaris.C b/dyninstAPI/src/solaris.C index c4b9339..b5477eb 100644 --- a/dyninstAPI/src/solaris.C +++ b/dyninstAPI/src/solaris.C @@ -39,7 +39,7 @@ * incur to third parties resulting from your use of Paradyn. */ -// $Id: solaris.C,v 1.78 1999/10/19 22:39:38 zandy Exp $ +// $Id: solaris.C,v 1.79 1999/10/29 22:32:32 zandy Exp $ #include "dyninstAPI/src/symtab.h" #include "util/h/headers.h" @@ -548,14 +548,20 @@ bool process::attach() { // Step 3) /proc PIOCSET: // a) turn on the kill-on-last-close flag (kills inferior with SIGKILL when // the last writable /proc fd closes) - // b) turn on inherit-on-fork flag (tracing flags inherited when child forks). + // b) turn on inherit-on-fork flag (tracing flags inherited when + // child forks) in Paradyn only // c) turn on breakpoint trap pc adjustment (x86 only). // Also, any child of this process will stop at the exit of an exec call. //Tempest, do not need to inherit-on-fork long flags ; #ifdef BPATCH_LIBRARY - flags = PR_FORK | PR_BPTADJ; + /* FIXME: When fork/exec callbacks are implemented for Dyninst, set + PR_FORK here, too. It is not set now because otherwise the child + would inherit trap-on-exit from exec. With no way for a mutator + to handle this stop, the child process would remain stopped + indefinitely. */ + flags = PR_BPTADJ; #else if(process::pdFlavor == string("cow")) flags = PR_KLC | PR_BPTADJ; -- 1.8.3.1