|
Devel::CallTrace - See what your code's doing |
Devel::CallTrace - See what your code's doing
#!/usr/bin/perl -d:CallTrace
package foo;
sub bar { print ``bar\n''; baz(); }
sub baz { print ``boo\n''; }
foo::bar();
There are a number of perl modules in the CPAN that are designed to trace a program's execution as it runs. Each uses a different trick to do its job, but none of them quite met my needs. The technique this module uses is quite simple and seems to be quite robust.
perl will automatically call DB::sub on each subroutine call and leave it up to us to dispatch to where we want to go.
This routine is called with two parameters:
To get at the subroutine that was being called, have a look at $DB::sub
It uses the debugger. How could it not have bugs?
the perldebguts manpage, the DB manpage, a licensed therapist.
the trace manpage - Uses source filters. Scares me.
the Devel::TraceCalls manpage - Very robust API. The code seems to do all sorts of scary magic
the Debug::Trace manpage - Uses symbol table magic to wrap your functions.
the Devel::TRaceFuncs manpage - Requires developers to instrument their source files.
Copyright 2005 Jesse Vincent <jesse@bestpractical.com>
This module may be redistributed under the same terms as perl itself
|
Devel::CallTrace - See what your code's doing |