Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/5/84; site umd5.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!seismo!lll-crg!gymble!umcp-cs!cvl!umd5!zben From: zben@umd5.UUCP Newsgroups: net.unix-wizards Subject: Re: Process Execution with Non-Standard Entry Points Message-ID: <833@umd5.UUCP> Date: Thu, 16-Jan-86 05:29:11 EST Article-I.D.: umd5.833 Posted: Thu Jan 16 05:29:11 1986 Date-Received: Fri, 17-Jan-86 07:18:58 EST References: <122@linus.UUCP> Reply-To: zben@umd5.UUCP (Ben Cranston) Distribution: net Organization: U of Md, CSC, College Park, Md Lines: 37 Summary: Some random thoughts In article <122@linus.UUCP> jth@linus.UUCP (Joseph T. Healey) writes: >I am interested in taking a "snapshot" of a running process, stopping execution >and then resuming execution at the instruction after the stop. I have success- >fully copied the state of the text, data and stack segments and constructed a >new a.out header specifying a new entry point (a_entry). > >The program calls a function upon receiving a SIGINT signal and sets the >new (desired) entry point from the saved PC on the stack, however when I try >to run the new program it always segmentation faults. I can specify any >function address in the program as the entry point and the program can be >successfully run. > >I am assuming the since I am trying to start at the saved PC instruction that >it should be on a correct instruction address. 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 I understand you correctly, you are trying to write out a new "a.out" file that, when executed, will pick up where the program that wrote it out left off?... Well, you will lose position on all your files and stuff. You don't mention the exact machine and Unix you are using. On many systems the initial register contents are undefined, or defined to be something (like "stack pointer starts at top of current stack page") not characteristic of a *running* program. 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. A good place for this would be the subroutine that actually writes the a.out file. Of course, I could be *totally* off base... -- "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