Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Line Tracing

rocky edited this page · 7 revisions

I mentioned that I was working a Perl debugger to a colleague, Herbie Chong. He lamented that Perl doesn't have set -x tracing like POSIX shells do or according to him it requires some kind of recompilation of Perl.

This is not the first time I've heard this lament. I added line tracing to ruby-debug; The command there is called set linetrace on. When I reorganized the command set in Ruby trepanning debuggers, it got renamed set trace print as there are other kinds of tracing, such as just saving the events in a buffer for later inspection than immediate printing.

I said to Herbie that I'd add it to the Perl debugger, so here it is. The command option is -x (same as in POSIX shells) or --trace.

One of the cool things we can provide that the POSIX shells never did have is that we colorize the lines of code. Here is a recent run:


Also see Devel::Trace / Devel::Trace::More -- awwaiid

rocky: Also "t" (trace) in perl5db.

But these don't colorize the traced Perl code.

Another difference (but not with perl5db's "t") is the dynamic behavior. In Devel::Trace you can start and stop tracing inside your program by modifying the program. But since this is inside a debugger you don't have to modify the program but can decide which portion to trace at run-time using debugger commands. TMTOWTDI.

Something went wrong with that request. Please try again.