Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!bellcore!decvax!genrad!panda!talcott!harvard!seismo!umcp-cs!cvl!umd5!zben From: zben@umd5.UUCP Newsgroups: net.unix-wizards Subject: Re: Process Execution with Non-Standard Entry Points Message-ID: <835@umd5.UUCP> Date: Thu, 16-Jan-86 20:19:33 EST Article-I.D.: umd5.835 Posted: Thu Jan 16 20:19:33 1986 Date-Received: Sat, 18-Jan-86 08:49:52 EST References: <122@linus.UUCP> <833@umd5.UUCP> Reply-To: zben@umd5.UUCP (Ben Cranston) Distribution: net Organization: U of Md, CSC, College Park, Md Lines: 33 Summary: Much easier solution? In article <833@umd5.UUCP> zben@umd5.UUCP (Ben Cranston) writes: >In article <122@linus.UUCP> jth@linus.UUCP (Joseph T. Healey) writes: >>I am interested in taking a "snapshot" of a running process, stopping ... >> ... Does anyone have any ideas >>about how I can start the execution of a program at an instruction other >>than a function address?? Any insight at all would be appreciated. > >If this turns out to be the problem, save everything explicitly in an area >of the image that you define, and make the ACTUAL entry point in YOUR code >somewhere, and after it has reloaded everything, LEAP to where you would >reenter the code. ... I haven't been working with Unix all that long. My comment about losing the file position was WAY off base, although one would have to ensure that the connected files get reconnected and pipes would have problems. But, it occurs to me that the "setjump/longjump" suite, if available on your machine, does pretty much what you want to do. When you get down into the signal catcher, do a "setjump" before writing the a.out file. Arrange to do a "longjump" back when the program is restarted. Also note that many Unix systems have a "preload" that is inserted by the loader, which usually does some things to set up argc and argv, then calls or leaps to entry point "main". If you have one of these, you may NOT want to change the entry point in the a.out header. Instead, you may want to change the leap or call instruction at the end of the preload to go off to your function that eventually "longjump"s back to the signal handler. Without knowing the hardware or dialect of Unix it is hard to say more. -- "We're taught to cherish what we have | Ben Cranston by what we have no longer..." | zben@umd2.umd.edu ...{seismo!umcp-cs,ihnp4!rlgvax}!cvl!umd5!zben