Set an arbitrary breakpoint in the debugger
I am using the interactive perl debugger (mostly perl -d script
)
I have a script that has quite a few imported modules and I need to debug a problem.
What I am doing is launch the debugger and step through the lines, stepping in where needed.
But this is tedious as I have to go through many lines of code and function calls.
Question: Let's say that after going through the lines of code, I end up entering a function of A::B::C::foo()
some module where the problem I am debugging is.
Is there a way to set a breakpoint in this function at the start of a debug session so that I go there right away instead of looping through the code line by line until I get there?
I know that I can add a breakpoint in the same file as my debugger, but how do I add a breakpoint on a line that is outside the debug area at the moment (to some arbitrary file / module that the debugger will eventually have reached)?
Note:
Just to clarify: this doesn't look like what A::B::C::foo()
's in the X script line. Ultimately it gets called after traversing the chain of calls to other functions in many modules
source to share