Looks like the following code:
print "HERE?\n"
set_eh ignore
find_lex lexical, -1, var
clear_eh
Does the following at runtime:
3713 print "HERE?\n"
HERE?
3715 set_eh P20 - P20=Exception_Handler=PMC(0xf8eb30)
3717 find_lex P18, -1, S17 - P18=Array=PMC(0xf8eb48), , S17="b"
And just stops. Exit code 0.
Here's my exception handler:
.namespace [ "_Tcl"]
.emit
__default_handler:
set P4, P5["_invoke_cc"]
set P5, P5["_P5"]
invoke P4
.eom
And here's where I define the invoke pmc used above:
.local pmc ignore
newsub ignore, .Exception_Handler, __default_handler
Any ideas?
exception syntax will change slightly.
> set P4, P5["_invoke_cc"]
especially these constructs (resumable handling).
Please use currently a local handler:
newsub ignore, .Exception_Handler, catch
set_eh ignore
# ops that might fail
clear_eh
catch:
Even better, stuff above 2 handler install lines into a macro, as the
syntax will likely be:
new ignore, .Exception_Handler
push_eh ignore, catch
leo
Of course, it works fine in a simple, single file example.
I've checked everything back in so you can take a look. Once you build tcl, from the top level directory, try:
oolong:~/research/parrot_8075 coke$ cat error.tcl
set a(b) 2
puts $a(b)
This SHOULD trigger the exception handler in languages/tcl/lib/command/set.imc. Instead, the stack trace ends with:
3718 set_eh P20 - P20=Exception_Handler=PMC(0x401b5d8)
3720 find_lex P18, -1, S17 - P18=Array=PMC(0x401b578), , S17="a"
And, again, exit value of 0.
> This SHOULD trigger the exception handler in
> languages/tcl/lib/command/set.imc. Instead, the stack trace ends with:
> 3718 set_eh P20 - P20=Exception_Handler=PMC(0x401b5d8)
> 3720 find_lex P18, -1, S17 - P18=Array=PMC(0x401b578), , S17="a"
> And, again, exit value of 0.
Exception handling is/was wrong, when multiple run loops are involved.
My fix for that was broken. I'll redo that along with the other changes
from Dan's exception paper.
For now the tcl code works, the one test is disabled.
leo