Devel::TraceFuncs

Devel::TraceFuncs is a Perl module with trace function calls as they happen.
Download

Devel::TraceFuncs Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Joe Hildebrand
  • Publisher web site:
  • http://search.cpan.org/~joehil/traceFunc-0.1/Devel/TraceFuncs.pm

Devel::TraceFuncs Tags


Devel::TraceFuncs Description

Devel::TraceFuncs is a Perl module with trace function calls as they happen. Devel::TraceFuncs is a Perl module with trace function calls as they happen.SYNOPSISUsage: require Devel::TraceFuncs; max_trace_depth 5; trace_file "foo.out"; trace_file $file_handle; sub foo { IN(my $f, "a message"); DEBUG "hellooo!"; }Devel::TraceFuncs provides utilities to trace the execution of a program. It can print traces that look something like: +-> global: '0' | +-> main::fo(4, 5) (in ./t.pm:32): 'now then' | | +-> main::fp(4, 5) (in ./t.pm:19) | | | +-> main::fq() (in ./t.pm:13) | | | | que pee doll (in ./t.pm:8) | | | +-< main::fq() (in ./t.pm:13) | | | cee dee (in ./t.pm:14) | | +-< main::fp(4, 5) (in ./t.pm:19) | | ha | | hs (in ./t.pm:20) | +-< main::fo(4, 5) (in ./t.pm:32): 'now then' | done (in ./t.pm:34) +-< global: '0'INA trace begins when a function calls IN. A my'd variable is passed in, such that when that function exits, the destructor for the variable is called. If this trace is to be printed, the opening line of the trace in printed at this time. Any other parameters are concatenated together, and printed on both the opening and closing lines of the trace.I wish the syntax could be a little nicer here, but I couldn't find anything in perl that resembles Tcl's uplevel or upvar commands. If I was one of the perl gods, I could have figured out a way to do something like perl5db.pl: sub sub { # create a new subroutine, with a my'd TraceFunc object }DEBUGPrint some text to the trace file, at the correct depth in the trace. If the last parameter ends in "!", the arguments are printed, regardless of current depth.trace_filetrace_file takes one argument, which is either a file name or an open file handle. All trace output will go to this file.max_trace_depthTo avoid lots of nesting, particularly from recursive function calls, you can set the maximum depth to be traced. If this is -1 (the default), all levels of functions are traced. If it is 0, no trace output occurs, except for DEBUG statements that end in "!".Requirements:· Perl Requirements: · Perl


Devel::TraceFuncs Related Software