in reply to Re: how to set a breakpoint by a code reference
in thread how to set a breakpoint by a code reference

Hi LanX,

Thank you for your quick reply.

Could you let us know if you make any progress?

This debug feature of Perl can help me a lot.

BR

  • Comment on Re^2: how to set a breakpoint by a code reference

Replies are listed 'Best First'.
Re^3: how to set a breakpoint by a code reference
by LanX (Saint) on Nov 19, 2013 at 02:47 UTC
    Hi

    I inspected the code and sorry it's not implemented.

    In b $var $var is interpreted as a condition and the breakpoint is set at the current point in code.

    Thats why you see something like this after listing breakpoints

    DB<105> L 10: }; break if ($var)

    you may wanna check cmd_b() on your own.

    There is even no trace that it was even attempted to be implemented.

    cmd_b_sub() explicitely ignores references.

    Though I can find the anonymous sub in %DB::sub as

     "main::__ANON__[/tmp/tst.pl:10]" => "/tmp/tst.pl:6-10"

    But I can't connect it to the subref.

    ... hmm wait ...

    well DB::CvGV_name($mysubref) seems to fix it main::__ANON__[/tmp/tst.pl:10]

    ok I will try to fix it, but this will result in a patch. (update see--> Re: how to set a breakpoint by a code reference (workaround))

    Cheers Rolf

    ( addicted to the Perl Programming Language)