On 9 August 2013 12:35, William ML Leslie <[email protected]> wrote:
> On 9 August 2013 11:48, Jonathan S. Shapiro <[email protected]> wrote:
>> That's to strong. First, the backtrace printing mechanism isn't done in a
>> handler. It's done deep in the runtime. Second, it's perfectly fine for
>> unwind code to change the stack pointer. All we need to do to support the
>> backtrace is to save the stack pointer that was current at the time of the
>> most recent exception on that thread.
>
> That doesn't seem sufficient, because all of the stack above the frame
> of the handler can be overwritten by the handler. A pointer into
> space that is available for allocation is not useful.
I guess that if you really want the traceback, we could make you
declare your intent in the handler.
try:
party_time()
# Extended except form declares that it wants a traceback,
# which will be generated if not provided.
# not saying anything about who can create values of type
# TraceBack.
except (e : OutOfBeer, tb : TraceBack):
logger.exception("Party ran dry", tb)
# extended raise form means no traceback needs to be
# generated if the next handler wants one
# not sure if I want the caller to be able to lie, but oh well
raise e, tb
--
William Leslie
Notice:
Likely much of this email is, by the nature of copyright, covered
under copyright law. You absolutely may reproduce any part of it in
accordance with the copyright law of the nation you are reading this
in. Any attempt to deny you those rights would be illegal without
prior contractual agreement.
_______________________________________________
bitc-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/bitc-dev