Implement temporary detach and re-attach for ProcControlAPI.
authorDaniel McNulty <mcnulty@cs.wisc.edu>
Fri, 20 May 2011 16:34:55 +0000 (11:34 -0500)
committerDaniel McNulty <mcnulty@cs.wisc.edu>
Fri, 20 May 2011 16:34:55 +0000 (11:34 -0500)
commitb6cceede231e903b3f10fa7bb5165bcdb99213c9
tree5cd8e4731d4ce6cdb0de3250e877d2e29990d088
parent6c52b23bd1821f471f446f0ec09a8c9743a7ef6c
Implement temporary detach and re-attach for ProcControlAPI.

This feature required a new state for int_process and int_thread:
detached. A temporary detach suspends all breakpoints, sets the
process state and state of threads to detached. Unlike normal detach,
the int_process is not cleaned up after the detach completes.

Control methods for Process and Thread have been modified to check
whether the process/thread is detached before performing the operation.
If it is detached, an error condition is returned and the last error
is set to err_detached.

A reattach is similar to an attach except for the following differences:
* since all int_threads already exist, a different path is needed in the
  post attach handling to make sure the threads are issued low-level
  attaches. int_process::post_attach now takes a boolean that
  specifies whether we are doing an attach or re-attach.
* We need to issue thread destruction events for threads that no longer
  exist in the process
* The breakpoints that were suspended need to be resumed (i.e. written
  back into memory).

This commit also includes a new ProcControlAPI test: pc_temp_detach.
This test basically includes a mutatee that triggers some periodic
events. The mutator temporarily detaches from the mutatee, makes
sure it doesn't get these events. It then re-attaches to the
mutatee and reads some state out of the mutatee to verify that the
events did occur.
39 files changed:
proccontrol/h/PCErrors.h
proccontrol/h/Process.h
proccontrol/src/freebsd.C
proccontrol/src/freebsd.h
proccontrol/src/handler.C
proccontrol/src/int_process.h
proccontrol/src/int_thread_db.C
proccontrol/src/int_thread_db.h
proccontrol/src/linux.C
proccontrol/src/process.C
testsuite/amd64-unknown-freebsd7.2/make.mutators.gen
testsuite/amd64-unknown-freebsd7.2/make.solo_mutatee.gen
testsuite/amd64-unknown-freebsd7.2/test_info_new.gen.C
testsuite/amd64-unknown-freebsd7.2/tuples
testsuite/i386-unknown-freebsd7.2/make.mutators.gen
testsuite/i386-unknown-freebsd7.2/make.solo_mutatee.gen
testsuite/i386-unknown-freebsd7.2/test_info_new.gen.C
testsuite/i386-unknown-freebsd7.2/tuples
testsuite/i386-unknown-linux2.4/make.mutators.gen
testsuite/i386-unknown-linux2.4/make.solo_mutatee.gen
testsuite/i386-unknown-linux2.4/test_info_new.gen.C
testsuite/i386-unknown-linux2.4/tuples
testsuite/ppc32_linux/make.mutators.gen
testsuite/ppc32_linux/make.solo_mutatee.gen
testsuite/ppc32_linux/test_info_new.gen.C
testsuite/ppc32_linux/tuples
testsuite/ppc64_linux/make.mutators.gen
testsuite/ppc64_linux/make.solo_mutatee.gen
testsuite/ppc64_linux/test_info_new.gen.C
testsuite/ppc64_linux/tuples
testsuite/src/mutatee_util.c
testsuite/src/mutatee_util.h
testsuite/src/proccontrol/pc_temp_detach.C [new file with mode: 0644]
testsuite/src/proccontrol/pc_temp_detach_mutatee.c [new file with mode: 0644]
testsuite/src/specification/spec-grouped.pl
testsuite/x86_64-unknown-linux2.4/make.mutators.gen
testsuite/x86_64-unknown-linux2.4/make.solo_mutatee.gen
testsuite/x86_64-unknown-linux2.4/test_info_new.gen.C
testsuite/x86_64-unknown-linux2.4/tuples