Process Execution with Non-Standard Entry Points

zben at umd5.UUCP zben at umd5.UUCP
Fri Jan 17 11:19:33 AEST 1986


In article <833 at umd5.UUCP> zben at umd5.UUCP (Ben Cranston) writes:
>In article <122 at linus.UUCP> jth at 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 at umd2.umd.edu
                          ...{seismo!umcp-cs,ihnp4!rlgvax}!cvl!umd5!zben  



More information about the Comp.unix.wizards mailing list