.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "ptkdb 3pm" .TH ptkdb 3pm "2015-06-14" "perl v5.20.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Devel::ptkdb \- Perl debugger using a Tk GUI .SH "DESCRIPTION" .IX Header "DESCRIPTION" .Vb 2 \& ptkdb is a debugger for perl that uses perlTk for a user interface. \& Features include: \& \& Hot Variable Inspection \& Breakpoint Control Panel \& Expression List \& Subroutine Tree .Ve .SH "SYNOPSIS" .IX Header "SYNOPSIS" To debug a script using ptkdb invoke perl like this: .PP .Vb 1 \& perl \-d:ptkdb myscript.pl .Ve .SH "Usage" .IX Header "Usage" .Vb 1 \& perl \-d:ptkdb myscript.pl .Ve .SH "Code Pane" .IX Header "Code Pane" .IP "Line Numbers" 4 .IX Item "Line Numbers" .Vb 8 \& Line numbers are presented on the left side of the window. Lines that \& have lines through them are not breakable. Lines that are plain text \& are breakable. Clicking on these line numbers will insert a \& breakpoint on that line and change the line number color to \& $ENV{\*(AqPTKDB_BRKPT_COLOR\*(Aq} (Defaults to Red). Clicking on the number \& again will remove the breakpoint. If you disable the breakpoint with \& the controls on the BrkPt notebook page the color will change to \& $ENV{\*(AqPTKDB_DISABLEDBRKPT_COLOR\*(Aq}(Defaults to Green). .Ve .IP "Cursor Motion" 4 .IX Item "Cursor Motion" If you place the cursor over a variable (i.e. \f(CW$myVar\fR, \f(CW@myVar\fR, or \&\f(CW%myVar\fR) and pause for a second the debugger will evaluate the current value of the variable and pop a balloon up with the evaluated result. \fIThis feature is not available with Tk400.\fR .Sp If Data::Dumper(standard with perl5.00502)is available it will be used to format the result. If there is an active selection, the text of that selection will be evaluated. .SH "Notebook Pane" .IX Header "Notebook Pane" .IP "Exprs" 2 .IX Item "Exprs" .Vb 7 \& This is a list of expressions that are evaluated each time the \& debugger stops. The results of the expresssion are presented \& hierarchically for expression that result in hashes or lists. Double \& clicking on such an expression will cause it to collapse; double \& clicking again will cause the expression to expand. Expressions are \& entered through B entry, or by Alt\-E when text is \& selected in the code pane. \& \& The B entry, will take an expression, evaluate it, and \& replace the entries contents with the result. The result is also \& transfered to the \*(Aqclipboard\*(Aq for pasting. .Ve .IP "Subs" 2 .IX Item "Subs" .Vb 4 \& Displays a list of all the packages invoked with the script \& heirarchially. At the bottom of the heirarchy are the subroutines \& within the packages. Double click on a package to expand \& it. Subroutines are listed by their full package names. .Ve .IP "BrkPts" 2 .IX Item "BrkPts" .Vb 7 \& Presents a list of the breakpoints current in use. The pushbutton \& allows a breakpoint to be \*(Aqdisabled\*(Aq without removing it. Expressions \& can be applied to the breakpoint. If the expression evaluates to be \& \*(Aqtrue\*(Aq(results in a defined value that is not 0) the debugger will \& stop the script. Pressing the \*(AqGoto\*(Aq button will set the text pane \& to that file and line where the breakpoint is set. Pressing the \& \*(AqDelete\*(Aq button will delete the breakpoint. .Ve .SH "Menus" .IX Header "Menus" .SS "File Menu" .IX Subsection "File Menu" .IP "About..." 4 .IX Item "About..." Presents a dialog box telling you about the version of ptkdb. It recovers your \s-1OS\s0 name, version of perl, version of Tk, and some other information .IP "Open" 4 .IX Item "Open" Presents a list of files that are part of the invoked perl script. Selecting a file from this list will present this file in the text window. .IP "Save Config..." 4 .IX Item "Save Config..." Requires Data::Dumper. Prompts for a filename to save the configuration to. Saves the breakpoints, expressions, eval text and window geometry. If the name given as the default is used and the script is reinvoked, this configuration will be reloaded automatically. .Sp .Vb 1 \& B You may find this preferable to using .Ve .IP "Restore Config..." 4 .IX Item "Restore Config..." Requires Data::Dumper. Prompts for a filename to restore a configuration saved with the \*(L"Save Config...\*(R" menu item. .IP "Goto Line..." 4 .IX Item "Goto Line..." Prompts for a line number. Pressing the \*(L"Okay\*(R" button sends the window to the line number entered. item Find Text... .Sp Prompts for text to search for. Options include forward search, backwards search, and regular expression searching. .IP "Quit" 4 .IX Item "Quit" .Vb 1 \& Causes the debugger and the target script to exit. .Ve .SS "Control Menu" .IX Subsection "Control Menu" .IP "Run" 4 .IX Item "Run" The debugger allows the script to run to the next breakpoint or until the script exits. item Run To Here .Sp Runs the debugger until it comes to wherever the insertion cursor in text window is placed. .IP "Set Breakpoint" 4 .IX Item "Set Breakpoint" Sets a breakpoint on the line at the insertion cursor. item Clear Breakpoint .Sp Remove a breakpoint on the at the insertion cursor. .IP "Clear All Breakpoints" 4 .IX Item "Clear All Breakpoints" Removes all current breakpoints .IP "Step Over" 4 .IX Item "Step Over" Causes the debugger to step over the next line. If the line is a subroutine call it steps over the call, stopping when the subroutine returns. .IP "Step In" 4 .IX Item "Step In" Causes the debugger to step into the next line. If the line is a subroutine call it steps into the subroutine, stopping at the first executable line within the subroutine. .IP "Return" 4 .IX Item "Return" Runs the script until it returns from the currently executing subroutine. .IP "Restart" 4 .IX Item "Restart" Saves the breakpoints and expressions in a temporary file and restarts the script from the beginning. \s-1CAUTION:\s0 This feature will not work properly with debugging of \s-1CGI\s0 Scripts. .IP "Stop On Warning" 4 .IX Item "Stop On Warning" When \f(CW\*(C`\-w\*(C'\fR is enabled the debugger will stop when warnings such as, \*(L"Use of uninitialized value at undef_warn.pl line N\*(R" are encountered. The debugger will stop on the \s-1NEXT\s0 line of execution since the error can't be detected until the current line has executed. .Sp This feature can be turned on at startup by adding: .Sp \&\f(CW$DB::ptkdb::stop_on_warning\fR = 1 ; .Sp to a .ptkdbrc file .SS "Data Menu" .IX Subsection "Data Menu" .IP "Enter Expression" 4 .IX Item "Enter Expression" When an expression is entered in the \*(L"Enter Expression:\*(R" text box, selecting this item will enter the expression into the expression list. Each time the debugger stops this expression will be evaluated and its result updated in the list window. .IP "Delete Expression" 4 .IX Item "Delete Expression" .Vb 1 \& Deletes the highlighted expression in the expression window. .Ve .IP "Delete All Expressions" 4 .IX Item "Delete All Expressions" .Vb 1 \& Delete all expressions in the expression window. .Ve .IP "Expression Eval Window" 4 .IX Item "Expression Eval Window" Pops up a two pane window. Expressions of virtually unlimitted length can be entered in the top pane. Pressing the 'Eval' button will cause the expression to be evaluated and its placed in the lower pane. If Data::Dumper is available it will be used to format the resulting text. Undo is enabled for the text in the upper pane. .Sp \&\s-1HINT: \s0 You can enter multiple expressions by separating them with commas. .IP "Use Data::Dumper for Eval Window" 4 .IX Item "Use Data::Dumper for Eval Window" Enables or disables the use of Data::Dumper for formatting the results of expressions in the Eval window. .SS "Stack Menu" .IX Subsection "Stack Menu" Maintains a list of the current subroutine stack each time the debugger stops. Selecting an item from this menu will set the text in the code window to that particular subourtine entry point. .SS "Bookmarks Menu" .IX Subsection "Bookmarks Menu" Maintains a list of bookmarks. The booksmarks are saved in ~/.ptkdb_bookmarks .IP "Add Bookmark" 4 .IX Item "Add Bookmark" Adds a bookmark to the bookmark list. .SH "Options" .IX Header "Options" Here is a list of the current active XResources options. Several of these can be overridden with environmental variables. Resources can be added to .Xresources or .Xdefaults depending on your X configuration. To enable these resources you must either restart your X server or use the xrdb \-override resFile command. xfontsel can be used to select fonts. .PP .Vb 10 \& /* \& * Perl Tk Debugger XResources. \& * Note... These resources are subject to change. \& * \& * Use \*(Aqxfontsel\*(Aq to select different fonts. \& * \& * Append these resource to ~/.Xdefaults | ~/.Xresources \& * and use xrdb \-override ~/.Xdefaults | ~/.Xresources \& * to activate them. \& */ \& /* Set Value to se to place scrollbars on the right side of windows \& CAUTION: extra whitespace at the end of the line is causing \& failures with Tk800.011. \& \& sw \-> puts scrollbars on left, se puts scrollars on the right \& \& */ \& ptkdb*scrollbars: sw \& /* controls where the code pane is oriented, down the left side, or across the top */ \& /* values can be set to left, right, top, bottom */ \& ptkdb*codeside: left \& \& /* \& * Background color for the balloon \& * CAUTION: For certain versions of Tk trailing \& * characters after the color produces an error \& */ \& ptkdb.frame2.frame1.rotext.balloon.background: green \& ptkdb.frame2.frame1.rotext.balloon.font: fixed /* Hot Variable Balloon Font */ \& \& \& ptkdb.frame*font: fixed /* Menu Bar */ \& ptkdb.frame.menubutton.font: fixed /* File menu */ \& ptkdb.frame2.frame1.rotext.font: fixed /* Code Pane */ \& ptkdb.notebook.datapage.frame1.hlist.font: fixed /* Expression Notebook Page */ \& \& ptkdb.notebook.subspage*font: fixed /* Subroutine Notebook Page */ \& ptkdb.notebook.brkptspage*entry.font: fixed /* Delete Breakpoint Buttons */ \& ptkdb.notebook.brkptspage*button.font: fixed /* Breakpoint Expression Entries */ \& ptkdb.notebook.brkptspage*button1.font: fixed /* Breakpoint Expression Entries */ \& ptkdb.notebook.brkptspage*checkbutton.font: fixed /* Breakpoint Checkbuttons */ \& ptkdb.notebook.brkptspage*label.font: fixed /* Breakpoint Checkbuttons */ \& \& ptkdb.toplevel.frame.textundo.font: fixed /* Eval Expression Entry Window */ \& ptkdb.toplevel.frame1.text.font: fixed /* Eval Expression Results Window */ \& ptkdb.toplevel.button.font: fixed /* "Eval..." Button */ \& ptkdb.toplevel.button1.font: fixed /* "Clear Eval" Button */ \& ptkdb.toplevel.button2.font: fixed /* "Clear Results" Button */ \& ptkdb.toplevel.button3.font: fixed /* "Clear Dismiss" Button */ \& \& /* \& * Background color for where the debugger has stopped \& */ \& ptkdb*stopcolor: blue \& \& /* \& * Background color for set breakpoints \& */ \& ptkdb*breaktagcolor*background: yellow \& ptkdb*disabledbreaktagcolor*background: white \& /* \& * Font for where the debugger has stopped \& */ \& ptkdb*stopfont: \-*\-fixed\-bold\-*\-*\-*\-*\-*\-*\-*\-*\-*\-*\-* \& \& /* \& * Background color for the search tag \& */ \& ptkdb*searchtagcolor: green .Ve .SH "Environmental Variables" .IX Header "Environmental Variables" .IP "\s-1PTKDB_BRKPT_COLOR\s0" 4 .IX Item "PTKDB_BRKPT_COLOR" Sets the background color of a set breakpoint .IP "\s-1PTKDB_DISABLEDBRKPT_COLOR\s0" 4 .IX Item "PTKDB_DISABLEDBRKPT_COLOR" Sets the background color of a disabled breakpoint .IP "\s-1PTKDB_CODE_FONT\s0" 4 .IX Item "PTKDB_CODE_FONT" Sets the font of the Text in the code pane. .IP "\s-1PTKDB_CODE_SIDE\s0" 4 .IX Item "PTKDB_CODE_SIDE" Sets which side the code pane is packed onto. Defaults to 'left'. Can be set to 'left', 'right', 'top', 'bottom'. .Sp Overrides the Xresource ptkdb*codeside: \fIside\fR. .IP "\s-1PTKDB_EXPRESSION_FONT\s0" 4 .IX Item "PTKDB_EXPRESSION_FONT" .Vb 1 \& Sets the font used in the expression notebook page. .Ve .IP "\s-1PTKDB_EVAL_FONT\s0" 4 .IX Item "PTKDB_EVAL_FONT" .Vb 1 \& Sets the font used in the Expression Eval Window .Ve .IP "\s-1PTKDB_EVAL_DUMP_INDENT\s0" 4 .IX Item "PTKDB_EVAL_DUMP_INDENT" .Vb 1 \& Sets the value used for Data::Dumper \*(Aqindent\*(Aq setting. See man Data::Dumper .Ve .IP "\s-1PTKDB_SCROLLBARS_ONRIGHT\s0" 4 .IX Item "PTKDB_SCROLLBARS_ONRIGHT" .Vb 3 \& A non\-zero value Sets the scrollbars of all windows to be on the \& right side of the window. Useful for Windows users using ptkdb in an \& X environment. .Ve .IP "\s-1PTKDB_LINENUMBER_FORMAT\s0" 4 .IX Item "PTKDB_LINENUMBER_FORMAT" Sets the format of line numbers on the left side of the window. Default value is \f(CW%05d\fR. useful if you have a script that contains more than 99999 lines. .IP "\s-1PTKDB_DISPLAY\s0" 4 .IX Item "PTKDB_DISPLAY" Sets the X display that the ptkdb window will appear on when invoked. Useful for debugging \s-1CGI\s0 scripts on remote systems. .IP "\s-1PTKDB_BOOKMARKS_PATH\s0" 4 .IX Item "PTKDB_BOOKMARKS_PATH" Sets the path of the bookmarks file. Default is \f(CW$ENV\fR{'\s-1HOME\s0'}/.ptkdb_bookmarks .IP "\s-1PTKDB_STOP_TAG_COLOR\s0" 4 .IX Item "PTKDB_STOP_TAG_COLOR" Sets the color that highlights the line where the debugger is stopped .SH "FILES" .IX Header "FILES" .SS ".ptkdbrc" .IX Subsection ".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 \f(CW$DB::no_stop_at_start\fR 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 \s-1CGI\s0 scripts. .PP There is a system ptkdbrc file in \f(CW$PREFIX\fR/lib/perl5/$VERS/Devel/ptkdbrc .ie n .IP "brkpt($fname, @lines)" 4 .el .IP "brkpt($fname, \f(CW@lines\fR)" 4 .IX Item "brkpt($fname, @lines)" Sets breakspoints on the list of lines in \f(CW$fname\fR. A warning message is generated if a line is not breakable. .ie n .IP "condbrkpt($fname, @($line, $expr) )" 4 .el .IP "condbrkpt($fname, @($line, \f(CW$expr\fR) )" 4 .IX Item "condbrkpt($fname, @($line, $expr) )" Sets conditional breakpoints in \f(CW$fname\fR on pairs of \f(CW$line\fR and \f(CW$expr\fR. A warning message is generated if a line is not breakable. \s-1NOTE:\s0 the validity of the expression will not be determined until execution of that particular line. .IP "brkonsub(@names)" 4 .IX Item "brkonsub(@names)" Sets a breakpoint on each subroutine name listed. A warning message is generated if a subroutine does not exist. \s-1NOTE:\s0 for a script with no other packages the default package is \*(L"main::\*(R" and the subroutines would be \*(L"main::mySubs\*(R". .IP "brkonsub_regex(@regExprs)" 4 .IX Item "brkonsub_regex(@regExprs)" Uses the list of \f(CW@regExprs\fR as a list of regular expressions to set breakpoints. Sets breakpoints on every subroutine that matches any of the listed regular expressions. .IP "textTagConfigure(tag, ?option?, ?value?)" 4 .IX Item "textTagConfigure(tag, ?option?, ?value?)" Allows the user to format the text in the code window. The option value pairs are the same values as the option for the tagConfigure method documented in Tk::Text. Currently the following tags are in effect: .Sp .Vb 7 \& \*(Aqcode\*(Aq Format for code in the text pane \& \*(Aqstoppt\*(Aq Format applied to the line where the debugger is currently stopped \& \*(AqbreakableLine\*(Aq Format applied to line numbers where the code is \*(Aqbreakable\*(Aq \& \*(AqnonbreakableLine\*(Aq Format applied to line numbers where the code is no breakable \& \*(AqbreaksetLine\*(Aq Format applied to line numbers were a breakpoint is set \& \*(AqbreakdisabledLine\*(Aq Format applied to line numbers were a disabled breakpoint is set \& \*(Aqsearch_tag\*(Aq Format applied to text when located by a search. \& \& Example: \& \& # \& # Turns off the overstrike on lines that you can\*(Aqt set a breakpoint on \& # and makes the text color yellow. \& # \& textTagConfigure(\*(AqnonbreakableLine\*(Aq, \-overstrike => 0, \-foreground => "yellow") ; .Ve .IP "add_exprs(@exprList)" 4 .IX Item "add_exprs(@exprList)" Add a list of expressions to the 'Exprs' window. \s-1NOTE:\s0 use the single quote character \e' to prevent the expression from being \*(L"evaluated\*(R" in the string context. .Sp .Vb 1 \& Example: \& \& # \& # Adds the $_ and @_ expressions to the active list \& # \& \& add_exprs(\*(Aq$_\*(Aq, \*(Aq@_\*(Aq) ; .Ve .SH "NOTES" .IX Header "NOTES" .SS "Debugging Other perlTk Applications" .IX Subsection "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. .PP 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. .PP Ptkdb has its own event loop that runs whenever you've stopped at a breakpoint and entered the debugger. However, it can accept events that are generated by other perlTk windows and dispatch their callbacks. The problem here is that the application is supposed to be \&'stopped', and logically the application should not be able to process events. .PP A future version of ptkdb will have an extension that will 'filter' events so that application events are not processed while the debugger is active, and debugger events will not be processed while the target script is active. .SS "Debugging \s-1CGI\s0 Scripts" .IX Subsection "Debugging CGI Scripts" One advantage of ptkdb over the builtin debugger(\-d) is that it can be used to debug \s-1CGI\s0 perl scripts as they run on a web server. Be sure that that your web server's perl instalation includes Tk. .PP Change your .PP .Vb 1 \& #! /usr/local/bin/perl .Ve .PP to .PP .Vb 1 \& #! /usr/local/bin/perl \-d:ptkdb .Ve .PP \&\s-1TIP:\s0 You can debug scripts remotely if you're using a unix based Xserver and where you are authoring the script has an Xserver. The Xserver can be another unix workstation, a Macintosh or Win32 platform with an appropriate X package. In your script insert the following \s-1BEGIN\s0 subroutine: .PP .Vb 3 \& sub BEGIN { \& $ENV{\*(AqDISPLAY\*(Aq} = "myHostname:0.0" ; \& } .Ve .PP Be sure that your web server has permission to open windows on your Xserver (see the xhost manpage). .PP 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. .PP To expedite debugging you may want to setup your breakpoints in advance with a .ptkdbrc file and use the \f(CW$DB::no_stop_at_start\fR variable. \s-1NOTE:\s0 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. .SH "KNOWN PROBLEMS" .IX Header "KNOWN PROBLEMS" .IP "\fIBreakpoint Controls\fR" 4 .IX Item "Breakpoint Controls" If the size of the right hand pane is too small the breakpoint controls are not visible. The breakpoints are still there, the window may have to be enlarged in order for them to be visible. .IP "Balloons and Tk400" 4 .IX Item "Balloons and Tk400" The Balloons in Tk400 will not work with ptkdb. All other functions are supported, but the Balloons require Tk800 or higher. .SH "AUTHOR" .IX Header "AUTHOR" Andrew E. Page, aepage@users.sourceforge.net .SH "ACKNOWLEDGEMENTS" .IX Header "ACKNOWLEDGEMENTS" Matthew Persico For suggestions, and beta testing. .SH "BUG REPORTING" .IX Header "BUG REPORTING" Please report bugs through the following \s-1URL:\s0 .PP http://sourceforge.net/tracker/?atid=437609&group_id=43854&func=browse