Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

breakpoint on builtin functions?

2 views
Skip to first unread message

bugbear

unread,
Nov 5, 2009, 5:37:33 AM11/5/09
to
I am trying to use the Perl debugger.

My program (using MANY Cpan modules) is generating
output to screen which I do not desire.

I thought - easy; run up the debugger,
put a breakpoint on "print", let 'er go,
stacktrace, job done.

Sadly...

I loaded my program under the debugger, and...

DB<4> b print
Subroutine main::print not found.

Should I be qualifying the name "print"
in some way, or can breakpoints only be put on "pure" perl?

The debugger sets breakpoints on my program's own
functions perfectly well.

BugBear

Ilya Zakharevich

unread,
Nov 5, 2009, 5:09:43 PM11/5/09
to
On 2009-11-05, bugbear <bugbear@trim_papermule.co.uk_trim> wrote:
> I am trying to use the Perl debugger.
>
> My program (using MANY Cpan modules) is generating
> output to screen which I do not desire.
>
> I thought - easy; run up the debugger,
> put a breakpoint on "print", let 'er go,
> stacktrace, job done.
>
> Sadly...
>
> I loaded my program under the debugger, and...
>
> DB<4> b print
> Subroutine main::print not found.

If you never use indirect argument to print, override the builtin, and
set the breakpoint on the overriding Perl function. (At least in
5.8.*, the functions using indirect argument are not easily overridable.)

Hope this helps,
Ilya

0 new messages