[EMAIL PROTECTED]:
# $i = 0;
# while ($i < 1000) {
#   $i++;
# }
# 
# With linenumber information enabled this would translate to 
# something like this
# 
#       setline 1
#       set I0,0
# LOOP: setline 2
#       lt I0, 1000, DONE
#       setline 3
#       add I0,1
#       branch LOOP
# DONE: setline 5
# 
# This is inefficient, because there are two setlines in the loops.

That example is quite oversimplified.  A more correct one would be
something like:

        setfile "foo.pl"
        setline 1
        enter
        new P0, .PerlInt
        assign P0, 0
LOOP:
        setline 2
        lt P0, 1000, DONE
        enter
        setline 3
        add P0, 1
        leave
        branch LOOP
DONE:
        setline 5
        leave

When you include all the scoping operations and change the I to a P
(which is more realistic), it's not as big a deal, especially since a
vtable dispatch is much more expensive than an assignment to
interpreter->current_line or whatever.  Still, I can see your point.

# This can be implemented in 2 ways:
# - Create our own debugging format
# - Use an already existing one
# The first way might be more fun, but I think the second one 
# would be better. IMHO we should use DWARF-2. The Mono Project 
# does something similar.

Can you justify these?  Parrot may want to support file names in
different character sets, which I doubt much of anything else handles
correctly.  And if we choose to use an existing format, why DWARF-2?

--Brent Dax <[EMAIL PROTECTED]>
@roles=map {"Parrot $_"} qw(embedding regexen Configure)

Wire telegraph is a kind of a very, very long cat. You pull his tail in
New York and his head is meowing in Los Angeles. And radio operates
exactly the same way. The only difference is that there is no cat.
    --Albert Einstein (explaining radio)

Reply via email to