in reply to Perl Debugger: setting a breakpoint in another file with 'b'

I see that Re: Specifying a Filename in a Breakpoint in the Perl Debugger offers a workaround, which looks pretty helpful and straightforward.

I'd still like to be able to use the "b filename:line [condition]" syntax, too, though, so I hope this node won't be considered a unjustified use of electrons (ww)!

Replies are listed 'Best First'.
Re^2: Perl Debugger: setting a breakpoint in another file with 'b'
by LanX (Saint) on May 16, 2015 at 11:40 UTC
    > &break_on_filename_line

    it's an internal routine which is only called by other routines, not from the command loop parser (which is a pretty messed up sequence of reqexes spawning hundreds of lines)

    however you can call it directly by yourself

    DB<3> &DB::break_on_filename_line('/tmp/sub.pl',4) DB<4> L /tmp/sub.pl: 4: print __FILE__,":",__LINE__; break if (1)

    which poses a problem if the file isn't already loaded.

    > I'd still like to be able to use the b filename:line [condition] syntax

    you can use the aliasing mechanism to define your own command for "break_on_filename_line" and put it into your .perldb rc-file.

    Cheers Rolf
    (addicted to the Perl Programming Language and ☆☆☆☆ :)
    Je suis Charlie!