Hi,
A while back I posted an RFC about changing the PASM/PIR debug segment so it
would be able to give useful info about PBCs produced from multiple files.
Today I've done a couple of ci's that have put this change into effect, with
the small change to the original plan that filenames are not stored in the
debug segment but rather as strings in the constant segment (at leo's
suggestion).
Note that this has invalidated any existing packfiles. But that's pretty
regular these days, what with all this deprecation. ;-)
I also updated pbc_merge to take advantage of the changes.
$ type crash1.pir
.sub main
_test()
.end
$ type crash2.pir
.sub _test
_nonexistent()
.end
$ parrot -o crash1.pbc crash1.pir
$ parrot -o crash2.pbc crash2.pir
$ pbc_merge -o crash.pbc crash1.pbc crash2.pbc
$ parrot crash.pbc
Name '_nonexistent' not found
current instr.: '_test' pc 14 (crash2.pir:2)
called from Sub 'main' pc 7 (crash1.pir:2)
The important bit is the last two lines - notice how we can now report both
file names in the backtrace.
What's left? Making this work for when you .include files in PIR. Which
means monkeying with the lexer and IMCC. <shudder>
Enjoy,
Jonathan