in reply to Re^2: using perldb (neither 'b compile' nor 'b postpone' seem to work)
in thread using perldb

I can only help with one of the cases: If you to qualify b compile db_demo_postpone::testsub3, then this particular case seems to work (because that's the name under which it is compiled). Importing it into the main namespace doesn't compile. I also would sort of expect that *testsub2 = sub {...} doesn't work, because it is compiled as an anonymous sub, and only then pushed into the symbol table. For the rest of the cases I have no clue.

My own experience with b postpone was never very successful. For a start, there's no feedback when you mistype the subroutine or package name (and I mistype often). And then, I never found out in which cases it would actually work (or whether it has just stopped working in recent Perls).

That's why I ended up with my brute-force method: Whenever b Foo::bar tells me that the method isn't found, I just call it and then, if the call seems to actually call something, try again. With the debugger's command history, that's even less typing than postpone.

  • Comment on Re^3: using perldb (neither 'b compile' nor 'b postpone' seem to work)

Replies are listed 'Best First'.
Re^4: using perldb (neither 'b compile' nor 'b postpone' seem to work)
by LanX (Saint) on Sep 03, 2021 at 16:21 UTC
    Thanks for your feedback.

    I now have the impressions that the b compile breaks actually work, they just stop at the point of compilation (sic) not execution.

    I can actually see that postponed breaks are translated to breaks listed with 'L', at least when giving full qualified subnames. They are just not breaking ...

    What's making it weirder is that those commands seem to interfere with each other, so I should better untangle the test cases...

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery

      I'm still testing and didn't come to a conclusion why it's broken, but I wanted to give a feedback now:

      b postpone PKG::SUBNAME is definitely translated into b SUBNAME after a require or use . Inspecting the breakpoints with L shows exactly the same effect like a manual b SUBNAME after the require.

      Difference is that the former just don't break. (???)

      I'll try to generate an automated test, probably someone can run it via perlbrew on different versions. (I need a way to direct the output into a parsable variable)

      I'll also try to look into the internal DB::data-structures of perl5db.pl

      Cheers Rolf
      (addicted to the Perl Programming Language :)
      Wikisyntax for the Monastery

        « I'll try to generate an automated test, probably someone can run it via perlbrew on different versions.»

        Why not.

        1. Post which versions you want
        2. Post the automated test(s)
        3. I’ll run it/them
        4. Feel free to correct me if I’m wrong

        As I tested some of BUK‘s stuff I see no reason why I shouldn’t do that for you. As it is for the good cause.

        «The Crux of the Biscuit is the Apostrophe»