[comp.unix.programmer] reexecuting a killed program

wsherman@ncsa.uiuc.edu (William Sherman -Visualization) (12/06/90)

I have two similar questions reguarding the reexecution of a program
whose state has been saved (core file or otherwise).  The reexecution
should start where the program left off, with all the variables and
memory intact.

Question 1:  Can (and how) one send a signal to a program causing
	a core dump that can later be run by rejoining the core with
	the executable (either through dbx or some other program).
	Are there any restrictions as to what a program can be in
	the process of doing when signaled?  I've tried sending
	a quit (signal 3), which produces a core dump, but dbx won't
	let me do a continue.

Question 2:  This one I know can be done, because Kyoto Common Lisp
	does it.  But after looking at the source, I wasn't able to
	decipher what was going on.  What I want is for a program
	to save itself, such that it creates an executable file which
	when run is basically in the same state as when saved.  KCL
	does this so that all the user data structures (and therefore
	functions) are exactly as they were.  In fact, the basic KCL
	executable has already had this done once.  So, to restate
	the problem: how does a program save itself into a file that
	simply needs to be executed for the user to be right back
	where he/she was when the program was saved.  (Note, actually
	terminating the program at this point is optional.)

--
/************************************************************************/
/* Bill Sherman								*/
/* National Center for Supercomputing Applications			*/
/* University of Illinois						*/
/* Champaign-Urbana							*/
/*									*/
/* Internet: wsherman@ncsa.uiuc.edu					*/
/*									*/
/*   "You want to do mankind a real service?  Tell funnier jokes."	*/
/* 		Og							*/
/************************************************************************/

src@scuzzy.in-berlin.de (Heiko Blume) (12/08/90)

wsherman@ncsa.uiuc.edu (William Sherman -Visualization) writes:

>I have two similar questions reguarding the reexecution of a program
>whose state has been saved (core file or otherwise).  The reexecution
>should start where the program left off, with all the variables and
>memory intact.

if you have the *unstripped* executable and the core file you
can use 'undump new.binary a.out.file core.file'. there is
a undump in the TeX distribution.


however i think you'll have trouble with programs using
curses etc, haven't tried, though.
-- 
      Heiko Blume <-+-> src@scuzzy.in-berlin.de <-+-> (+49 30) 691 88 93
                    public source archive [HST V.42bis]:
        scuzzy Any ACU,f 38400 6919520 gin:--gin: nuucp sword: nuucp
                     uucp scuzzy!/src/README /your/home