develooper Front page | perl.perl5.porters | Postings from April 2006

Re: [perl #38966] debugger can't breakpoint until module loaded

Thread Previous | Thread Next
April 26, 2006 09:41
Re: [perl #38966] debugger can't breakpoint until module loaded
Message ID:
On Wednesday 26 April 2006 07:38, Albert Cahalan wrote:
> On 4/25/06, Rafael Garcia-Suarez via RT <> wrote:
> > Albert Cahalan wrote:
> > > Unlike gdb debugging C programs, the perl debugger is unable to place
> > > breakpoints on things that don't yet exist. By this I mean functions
> > > found in libraries that have yet to be loaded. It seems I have to 
> > > find where the libraries get loaded, breakpoint that, single step, then
> > > breakpoint what I want. This is awful, especially when dealing with
> > > unfamiliar code.
> >
> > Doesn't the command "b postpone <subname>" work for you ? (See online
> > help by typing "h b" in the debugger)
> Oh, OK. With gdb, the debugger just asks. That is nicer behavior.
> So consider this bug report as an enhancement request for
> gdb-like behavior. I'd rather let the debugger take care of tracking
> whether or not "postpone " should be used.
> The less the user needs to do, the less needs to be documented.
You mean if you want to set a breakpoint on a subroutine, but you have spelt 
it incorrectly, you want the debugger to read your mind, and to remain silent 
on the basis that you _might_ have spelt it correctly, and you _might_ be 
going to load it some time in the future.  The debugger behaves correctly and 
warns the unfortunate user of the failed breakpoint setting, while providing 
for the case where they might actually know what they are doing with the 
tools they are using.

On the other hand, if you really want your code to behave as if it knew what 
you meant, at all times and without ever asking, I suggest you use the 
Symbol::Approx::Sub module from Dave Cross - that will almost certainly do 
what it _thinks_ you meant, every time you misspell something.  It's 
especially useful in production code...


Richard Foley
Ciao - shorter than aufwiedersehen

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About