[LMH]Re: CATCH/THROW?
Steve Krueger
stevelisp@grape-krueger.com
Wed Jul 23 20:12:01 2003
--------------080709050208030907000108
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Alastair,
It's funny to find this request from you tonight, as I was just thinking
today that you'll need to be getting catch/throw/unwind-protect working
real soon now because the system code is full of them.
I think catch/throw/unwind-protect is an area that changed somewhat in
VM2 because the call frame changed.
I don't think I can get too far into it tonight. Just a few facts that
might make it easier to follow:
A catch is an open (in progress and not yet called) frame on the stack
with the function being a special UCODE-ENTRY.
A throw, walks up the stack looking for a matching catch frame and exits it.
An unwind protect is a catch with special handling for throws that don't
match, the unwind clause is executed and then the throwing is continued,
still looking for a matching catch.
Catches provide two paths, a normal exit when the code completes
normally, and a path when a throw transfers to the catch.
I might have some notes on this in Elroy (VM2). In any case, more tomorrow.
-Steve
Nyef wrote:
>On Wed, 23 Jul 2003, Nyef wrote:
>
>
>
>>Hello all.
>>
>>My current WIP for exploiter is running almost all the way through
>>CONFIGURE-NUPI-DISK-SYSTEM. I believe this to be just about at the end of
>>initialize-disk-system.
>>
>>The problem I'm having is with the documentation for the instructions
>>%close-catch-unwind-protect and %unwind-protect-continue.
>>
>>CONFIGURE-NUPI-DISK-SYSTEM starts off with a %open-catch-multiple-value.
>>The
>>
>>
>
>The problem with using both pine and emacs at once is that the emacs
>change-to-other-buffer key sequence sends your email through pine. :-/
>
>Anyway, as I was saying, the restart-pc points to a
>%close-catch-unwind-protect. This same instruction is reached through
>the normal execution of the function.
>
>After the %close-catch-unwind-protect, there is a LONG-PUSHJ, and then a
>%unwind-protect-continue.
>
>My question is, what exactly do %close-catch-unwind-protect and
>%unwind-protect-continue do? SSDN2 doesn't explain
>%unwind-protect-continue or %unwind-protect-cleanup at all...
>
>---------------------------
>All programming can be viewed as an exercise.
>---------------------------
>Alastair Bridgewater
>e-mail: nyef@softhome.net
>
>http://lists.unlambda.com/mailman/listinfo/lispm-hackers
>
>
>
--------------080709050208030907000108
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title></title>
</head>
<body>
Alastair,<br>
<br>
It's funny to find this request from you tonight, as I was just thinking
today that you'll need to be getting catch/throw/unwind-protect working real
soon now because the system code is full of them.<br>
<br>
I think catch/throw/unwind-protect is an area that changed somewhat in VM2
because the call frame changed.<br>
<br>
I don't think I can get too far into it tonight. Just a few facts that might
make it easier to follow:<br>
<br>
A catch is an open (in progress and not yet called) frame on the stack with
the function being a special UCODE-ENTRY.<br>
<br>
A throw, walks up the stack looking for a matching catch frame and exits
it.<br>
<br>
An unwind protect is a catch with special handling for throws that don't
match, the unwind clause is executed and then the throwing is continued,
still looking for a matching catch.<br>
<br>
Catches provide two paths, a normal exit when the code completes normally,
and a path when a throw transfers to the catch.<br>
<br>
I might have some notes on this in Elroy (VM2). In any case, more tomorrow.<br>
<br>
-Steve<br>
<br>
<br>
Nyef wrote:<br>
<blockquote type="cite"
cite="midPine.LNX.4.53.0307232139280.28194@mai.paradiesanalytics.com">
<pre wrap="">On Wed, 23 Jul 2003, Nyef wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Hello all.
My current WIP for exploiter is running almost all the way through
CONFIGURE-NUPI-DISK-SYSTEM. I believe this to be just about at the end of
initialize-disk-system.
The problem I'm having is with the documentation for the instructions
%close-catch-unwind-protect and %unwind-protect-continue.
CONFIGURE-NUPI-DISK-SYSTEM starts off with a %open-catch-multiple-value.
The
</pre>
</blockquote>
<pre wrap=""><!---->
The problem with using both pine and emacs at once is that the emacs
change-to-other-buffer key sequence sends your email through pine. :-/
Anyway, as I was saying, the restart-pc points to a
%close-catch-unwind-protect. This same instruction is reached through
the normal execution of the function.
After the %close-catch-unwind-protect, there is a LONG-PUSHJ, and then a
%unwind-protect-continue.
My question is, what exactly do %close-catch-unwind-protect and
%unwind-protect-continue do? SSDN2 doesn't explain
%unwind-protect-continue or %unwind-protect-cleanup at all...
---------------------------
All programming can be viewed as an exercise.
---------------------------
Alastair Bridgewater
e-mail: <a class="moz-txt-link-abbreviated" href="mailto:nyef@softhome.net">nyef@softhome.net</a>
<a class="moz-txt-link-freetext" href="http://lists.unlambda.com/mailman/listinfo/lispm-hackers">http://lists.unlambda.com/mailman/listinfo/lispm-hackers</a>
</pre>
</blockquote>
<br>
<br>
</body>
</html>
--------------080709050208030907000108--