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

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

Thread Previous | Thread Next
From:
Albert Cahalan
Date:
April 27, 2006 13:38
Subject:
Re: [perl #38966] debugger can't breakpoint until module loaded
Message ID:
787b0d920604262024r213313f4ia24a76ea9419d411@mail.gmail.com
On 4/26/06, Richard Foley <Richard.Foley@t-online.de> wrote:
> On Wednesday 26 April 2006 07:38, Albert Cahalan wrote:
> > On 4/25/06, Rafael Garcia-Suarez via RT <perlbug-followup@perl.org> 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
> somehow
> > > > 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.

That isn't how gdb works.  Hopefully you have a recent copy of gdb handy.
Give it a try. My version 6.3 gdb does this:

(gdb) break foo
Function "foo" not defined.
Make breakpoint pending on future shared library load? (y or [n]) y

Breakpoint 2 (foo) pending.
(gdb)

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About