develooper Front page | perl.perl5.porters | Postings from February 2003

Re: wishlist/idea: debug helper

Thread Previous | Thread Next
Mike Guy
February 3, 2003 10:13
Re: wishlist/idea: debug helper
Message ID:
Jarkko Hietaniemi <> wrote
> Wouldn't it be nice if there were a C level function that could be
> called from a C level debugger like gdb and which would show the
> *perl* statement (and filename, linenumber if known) being executed?
> dump.c:Perl_op_dump() exists, but its output is not that nice to read,
> use of B::Deparse might be useful (if available...)

One simple approach would be to ride on the back of  perl -d.
Assuming that the code has been compiled with -d (or al least, the
appropriate bits in $^P are set), it would only be a few lines of C
to get the file/line from the cop and then the input line from the
-d data structures.

> Whether this function belongs in the core (dump.c?) or an extension ...

The above ought to be small enough that someone with your code bloat
experience could easily sneak it into dump.c without too many people
noticing.		:-)

Mike Guy

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