Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.1 6/24/83; site utah-gr.UUCP
Path: utzoo!watmath!clyde!burl!ulysses!allegra!bellcore!decvax!genrad!teddy!panda!talcott!harvard!seismo!utah-cs!utah-gr!thomas
From: thomas@utah-gr.UUCP (Spencer W. Thomas)
Newsgroups: net.unix-wizards
Subject: Re: Virtual machines (undump program)
Message-ID: <1296@utah-gr.UUCP>
Date: Wed, 9-Jan-85 22:00:48 EST
Article-I.D.: utah-gr.1296
Posted: Wed Jan  9 22:00:48 1985
Date-Received: Sat, 12-Jan-85 07:18:05 EST
References: <7152@brl-tgr.ARPA>
Reply-To: thomas@utah-gr.UUCP (Spencer W. Thomas)
Organization: Univ of Utah CS Dept
Lines: 36
Summary: 

In article <7152@brl-tgr.ARPA> BostonU SysMgr  writes:
>	We were distributed with our laser printer software a
>	UNIX (4.2 dependent probably) program called 'undump.c'
>	What it seems to do quite reliably is take a 'core'
>	and turn it back into an a.out which will start up as
>	it was at the time of the core dump (eg. after a SIGQUIT.)
>
>	I tried it on our EMACS and it almost works. EMACS certainly
>	starts up in the state it was dumped (EMACS goes through
>	a long, complicated and very necessary init phase.) The
>	obvious problem (here's the rub!) is that it won't re-read
>	the command line (argc,argv). 

Mea culpa!  I wrote undump a long time ago to help out the local lisp
folks.  Then I wrote a subroutine called unexec which takes a snapshot
of a running program.  Undump was originally written on 4.1, but was
ported to V7, at least (and probably others).  Unexec() is more
OS dependent, but has been ported to some other Unix versions (I think -
I've pretty much lost track of its evolution at this point).

Back when (Gosling) Emacs didn't have compiled mlisp, I converted our
emacs to use unexec.  I had to add "if (!Once){...}" to all the one-time
initialization code, but it worked fine after that.  I don't understand
the problem with not reading argc, argv again, unless the undump you got
is fancier than mine - I didn't save pc or stack, so you always
re-entered the program through main.  If yours saves full state, I might
be interested to see it.

In any case, if there is enough interest (time to get a bigger mailbox),
I can post both again (I did it once, but that was years ago).  (But I
can't post the emacs mods - they're long lost.)

-- 
=Spencer
	({ihnp4,decvax}!utah-cs!thomas, thomas@utah-cs.ARPA)
		<<< Silly quote of the week >>>