Devel-tkdb
view release on metacpan or search on metacpan
Sets the path of the bookmarks file. Default is $ENV{'HOME'}/.ptkdb_bookmarks
=back
=head1 FILES
=head2 .ptkdbrc
If this file is present in ~/ or in the directory where perl is
invoked the file will be read and executed as a perl script before the
debugger makes its initial stop at startup. There are several 'api'
calls that can be used with such scripts. There is an internal
variable $DB::no_stop_at_start that may be set to non-zero to prevent
the debugger from stopping at the first line of the script. This is
useful for debugging CGI scripts.
=over 4
=item brkpt($fname, @lines)
Sets breakspoints on the list of lines in $fname. A warning message
is generated if a line is not breakable.
=item condbrkpt($fname, @($line, $expr) )
Sets conditional breakpoints in $fname on pairs of $line and $expr. A
warning message is generated if a line is not breakable. NOTE: the
validity of the expression will not be determined until execution of
that particular line.
=item brkonsub(@names)
Sets a breakpoint on each subroutine name listed. A warning message is
generated if a subroutine does not exist. NOTE: for a script with no
other packages the default package is "main::" and the subroutines
would be "main::mySubs".
=item brkonsub_regex(@regExprs)
Uses the list of @regExprs as a list of regular expressions to set breakpoints. Sets breakpoints
on every subroutine that matches any of the listed regular expressions.
=back
=head1 NOTES
=head2 Debugging Other perlTk Applications
ptkdb can be used to debug other perlTk applications if some cautions
are observed. Basically, do not click the mouse in the application's
window(s) when you've entered the debugger and do not click in the
debugger's window(s) while the application is running. Doing either
one is not necessarily fatal, but it can confuse things that are going
on and produce unexpected results.
Be aware that most perlTk applications have a central event loop.
User actions, such as mouse clicks, key presses, window exposures, etc
will generate 'events' that the script will process. When a perlTk
application is running, its 'MainLoop' call will accept these events
and then dispatch them to appropriate callbacks associated with the
appropriate widgets.
=head2 Debugging CGI Scripts
One advantage of ptkdb over the builtin debugger(-d) is that it can be
used to debug CGI perl scripts as they run on a web server. Be sure
that that your web server's perl instalation includes Tcl::Tk.
Change your
#! /usr/local/bin/perl
to
#! /usr/local/bin/perl -d:tkdb
TIP: You can debug scripts remotely if you're using a unix based
Xserver and where you are authoring the script has an Xserver.
In your script insert the following BEGIN subroutine:
sub BEGIN {
$ENV{'DISPLAY'} = "myHostname:0.0" ;
}
Be sure that your web server has permission to open windows on your
Xserver (see the xhost manpage).
Access your web page with your browswer and 'submit' the script as
normal. The ptkdb window should appear on myHostname's monitor. At
this point you can start debugging your script. Be aware that your
browser may timeout waiting for the script to run.
To expedite debugging you may want to setup your breakpoints in
advance with a .ptkdbrc file and use the $DB::no_stop_at_start
variable. NOTE: for debugging web scripts you may have to have the
.ptkdbrc file installed in the server account's home directory (~www)
or whatever username your webserver is running under. Also try
installing a .ptkdbrc file in the same directory as the target script.
=head1 See also
https://github.com/vadrer/Perl-Devel-tkdb
=head1 AUTHORS
Andrew E. Page
Vadim Konovalov
=cut
use vars qw(@dbline);
sub BEGIN {
$DB::on = 0 ;
$DB::subroutine_depth = 0 ; # our subroutine depth counter
$DB::step_over_depth = -1 ;
# Fonts used in the displays
( run in 2.341 seconds using v1.01-cache-2.11-cpan-cdf2f3d4e48 )