Path: utzoo!attcan!uunet!mailrus!accuvax.nwu.edu!bob From: bob@accuvax.nwu.edu (Bob Hablutzel) Newsgroups: comp.sys.mac.programmer Subject: Re: Tail patches Message-ID: <1629@accuvax.nwu.edu> Date: 19 Nov 89 15:18:35 GMT References: <1459@sequent.cs.qmc.ac.uk> <36250@apple.Apple.COM> <5056@internal.Apple.COM> <1989Nov7.212837.5146@oracle.com> <26596@santra.UUCP> <5148@internal.Apple.COM> <26693@santra.UUCP> <5250@internal.Apple.COM> <26788@santra.UUCP> Sender: news@accuvax.nwu.edu Reply-To: bob@accuvax.nwu.edu (Bob Hablutzel) Organization: Northwestern Univ. Evanston, Il. Lines: 31 In article <26788@santra.UUCP> jmunkki@kampi.hut.fi (Juri Munkki) writes: >(comments on my scheme to make comefroms and tailpatches co-exist:) >In article <5250@internal.Apple.COM> lsr@Apple.COM (Larry Rosenstein) writes: >>Suppose trap X needs a come-from patch to fix a bug. You propose that >>when you make a call to X, the trap dispatcher branch directly to the >>come-from patch. The patch can do its thing, and then branch to the >>address defined in the trap table. This allows the come-from trap to get >>control first, when there's no possibility of the stack being messed up. > >Right. The trap dispatcher is not changed. The only new things are >a patched SetTrapAddress/GetTrapAddress (and the N-versions of those) >and a new secondary dispatch table. > An INIT I wrote, FreshStart, does do come-from patches, and impliments exactly this notion. Any patch to the 8 or so traps that I'm worried about don't actually change the trap dispatch table, but rather the internal variable I keep for the "original" trap address. (It's initialized when I put in my patch in the first place). It seems to work OK for INITs (FreshStart is an INIT manager, and so it running the INITs. I know if a patch is for an INIT or not). I still have problems with applications that tail-patch. MPW, for example. Notice, though, that my code has to have some notion of my patches; this is not a general purpose fix, and I'd be happier if I didn't have to do it. (It added two patches I had to make JUST FOR COMPATABILITY!) I agree with Apple (and I agreed with Apple _BEFORE_ I took a job there): tail patching is a pain in the ass. Bob Hablutzel (Wildwood Software, RIP) BOB@NUACC.ACNS.NWU.EDU Disclaimer: As of tomorrow, I work for Apple. I speak for myself. If you care: I'll still work on FreshStart.