"Jonathan Worthington" <[EMAIL PROTECTED]> wrote:
What's left? Making this work for when you .include files in PIR. Which
means monkeying with the lexer and IMCC. <shudder>
I've done it and it's available to play with. I'll admit now that, despite
having covered quite a bit of the IMCC codebase while working out the best
way to do this, I'm still no expert on how it works so this may not be
perfect. Anyway, an example of the kinda thing that now works:-
$ cat crash1.pir
# Example
.sub main :main
_test()
.end
.include "crash2.pir"
.sub _test2
_does_not_exist()
.end
$ cat crash2.pir
.sub _test
_test2()
.end
$ parrot crash1.pir
Name '_does_not_exist' not found
current instr.: '_test2' pc 24 (crash1.pir:9)
called from Sub '_test' pc 17 (crash2.pir:2)
called from Sub 'main' pc 7 (crash1.pir:3)
Note how the correct files are named in the backtrace now; before it would
always say crash1.pir no matter what file it was in.
Also fixed some warnings, plus a bug that pre-dated my debug seg work that
meant sometimes a file didn't get a debug segment added to it..
Happy debugging,
Jonathan