Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67a
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Libraries

    Devel::TraceFuncs 0.1

    Download button

    No screenshots available
    Downloads: 359  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Joe Hildebrand | More programs
    Perl Artistic License / FREE
    May 3rd, 2007, 06:05 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    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.

    SYNOPSIS

    Usage:

    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'

    IN

    A 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
    }

    DEBUG

    Print 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_file

    trace_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_depth

    To 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



    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    trace calls | function calls | Perl module | Devel::TraceFuncs | trace | function

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM