in reply to How can I print variable contents from the debugger non-interactively?
some hands on examples
a action (per line) and w watchpoint (each time) take Perl code to be evaluated.
you can do pretty nifty things with that already
use strict; use warnings; $|=1; # disable buffering my $a; our $y; for (0..10) { print; $a++; $y++; }
DB<71> h a a [line] command Set an action to be done before the line is executed; line defaults to the current execution line. Sequence is: check for breakpoint/watchpoint, print line if necessary, do action, prompt user if necessary, execute line. a Does nothing
a doesn't break unless you set $DB::single explicitly to 1
DB<79> h w w expr Add a global watch-expression. w Does nothing
w stops if the returned value has changed
w $a would stop each time $a is changing
this only stops if $a is inside the intervall
this only stops for the first print and the first non print (print returns 1)
Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Je suis Charlie!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How can I print variable contents from the debugger non-interactively? ( b= break line conditionally )
by LanX (Saint) on Jul 15, 2017 at 11:42 UTC |