Difference between revisions of "Debugging ADPs with TclPro"

From AOLserver Wiki
Jump to navigation Jump to search
(imported from WiKit id 827)
 
 
Line 1: Line 1:
[ Taken from http://www.tcl.tk/man/aolserver3.0/tadp-ch6.htm and is likely to be very out of date at this point. ]
+
== Debugging AOLserver pages ==
  
To debug your ADPs with TclPro, follow these steps:
+
Configure AOLserver to allow debugging, and restart:
  
Download and install TclPro from http://www.scriptics.com/tclpro/. Temporary licenses are available.
+
    ns_section "ns/server/server1/adp"
 +
        ns_param enabledebug true
  
Copy the prodebug.tcl file from the TclPro distribution to the modules/tcl directory.  
+
Download and install the TclDevKit http://www.activestate.com
  
Set the EnableDebug parameter in the ns/server/server-name/adp section of the configuration file to On.
+
Start the debugger:
  
Run TclPro and start a "remote project", which puts TclPro into a mode waiting for AOLserver to connect.
+
    % tcldebugger &
  
Open an ADP file with the ?debug=<pattern> query string in addition to any other query data you may send. AOLserver will then trap on ADP files matching the pattern. For example, you can just use debug=*.adp to trap all files, or you can use debug=someinclude.inc file to trap in an included file.
+
Start a new session:
  
To set a breakpoint in a procedure you'll have to "instrument" the procedure either after the debugger traps the first time or with the "dproc=<pattern>" query argument.
+
    File > New-Project
 +
 
 +
Start a new remote session:
 +
 
 +
    Debugging Type > Remote Debugging
 +
 
 +
Append the following information to the page you wish to debug:
 +
 
 +
?debug=<debug>&dhost=<dhost>&dport=<dport>&dprocs=<dprocs>
 +
 
 +
AOLserver Dubugging Query Arguments:
 +
  debug      String. The files you wish to debug. (Example: *, *.adp, foo.inc)
 +
  dhost      String. The host name the Tcl debugger is listening on. (Example: 127.0.0.1)
 +
  dport      Integer. The port the Tcl debugger is listening on. (Example: 2576)
 +
  dprocs      String. Procedures to instrument. (Example: ns*, foo_something)
 +
 
 +
Example:
 +
 
 +
    http://foo.com:8000/test.adp?debug=*&dhost=127.0.0.1&dport=2576

Latest revision as of 09:08, 7 September 2006

Debugging AOLserver pages

Configure AOLserver to allow debugging, and restart:

   ns_section "ns/server/server1/adp"
       ns_param enabledebug true

Download and install the TclDevKit http://www.activestate.com

Start the debugger:

   % tcldebugger &

Start a new session:

   File > New-Project

Start a new remote session:

   Debugging Type > Remote Debugging

Append the following information to the page you wish to debug:

?debug=<debug>&dhost=<dhost>&dport=<dport>&dprocs=<dprocs>

AOLserver Dubugging Query Arguments:

 debug       String. The files you wish to debug. (Example: *, *.adp, foo.inc)
 dhost       String. The host name the Tcl debugger is listening on. (Example: 127.0.0.1)
 dport       Integer. The port the Tcl debugger is listening on. (Example: 2576)
 dprocs      String. Procedures to instrument. (Example: ns*, foo_something)

Example:

   http://foo.com:8000/test.adp?debug=*&dhost=127.0.0.1&dport=2576