Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^6: B::Xref buggy?

by LanX (Saint)
on Nov 15, 2018 at 15:57 UTC ( [id://1225865]=note: print w/replies, xml ) Need Help??


in reply to Re^5: B::Xref buggy?
in thread B::Xref buggy?

> That doesn't really make any sense.

Let me elaborate:

It's possible to apply a callback to Concise to handle the logic with B::Concise::add_callback

This would make debugging much easier and more intuitive.

I'll try as soon as I have closed other projects in the pipeline.

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

Replies are listed 'Best First'.
Re^7: B::Xref buggy?
by dave_the_m (Monsignor) on Nov 15, 2018 at 16:28 UTC
    It's possible to apply a callback to Concise to handle the logic with B::Concise::add_callback
    That still doesn't make any sense. That just allows a per-node callback to affect how Concise dumps nodes. It doesn't help with scanning the op tree in the correct order to keep track of line numbers. Concise doesn't track line numbers, nor does it allow you to customise the order in which nodes are scanned.

    Xref has all the logic to do that, it just needs tweaking.

    Dave.

      > Concise doesn't track line numbers,

      I'm confused ...did you look at the output I provided?

      This looks pretty much like the lexical order in the source which is needed to track variables and subs.

      and the line numbers are available:

      # 6: print "@row"; #: +line 6 - <;> ex-nextstate(main 7 tst_b_xref2.pl:6) v:*,&,x +*,x&,x$,$

      The -src option dumps the original source line just before every nextstate OP and the line number is available in tst_b_xref2.pl:6

      Could you please provide an example code where this behaviour is broken in the B::Concise output and information is lost?

      Probably I'm unaware of some Perl temporal magic ? ? ?

      Cheers Rolf
      (addicted to the Perl Programming Language :)
      Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

        This looks pretty much like the lexical order in the source which is needed to track variables and subs
        I think that is the heart of your misapprehension. Concise doesn't output ops in source lexical order, apart from happenstance. As a trivial counterexample, this source:
        unless ($var1) { $var2++; } else { $var3++; }
        gives:
        perl -MO=Concise,-exec /tmp/p | grep var 3 <#> gvsv[*var1] s 7 <#> gvsv[*var3] s d <#> gvsv[*var2] s
        Note that var3 comes before var2.

        Dave.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1225865]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2024-03-29 04:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found