Hello.

Today I've been working on debugging dtcl with debugger from TclPro (I'm
using free TclPro 1.4).

I've been testing stuff with tclsh, but this should work with dtcl as
well:

-- CUT --
set debug_dir {/usr/local/ajuba/TclPro1.4/linux-ix86/bin}
set debug_host "blaszak2.nowiny.net"
set debug_port 2576

source [file join $debug_dir prodebug.tcl]
debugger_init $debug_host $debug_port
debugger_eval {
    puts "Enter line:"
    set ln [gets stdin]
    puts "you entered: '$ln'"
}
-- CUT --

This is what I've just been testing. The three variables:
debug_dir (directory where prodebug.tcl is located - it is a script which
initializes debugger_init, debugger_eval and debugger_break functions),
debug_host and debug_port (address for remote debugger :).

Here's how it works:
debugger_init tries to connect. If it succeeds, it makes debugger_eval a
large function which connects sends the script and it works as if you were
debugging a local script.

If debugger_init does not connect, then debugger_eval is almost equal to
eval.

Also, there are no lock-ups when two scripts try to connect at once - the
first gets debugged, the others are just run.

But I suppose debugger support needs to be implemented in mod_dtcl itself
as an option. It would require putting something like this:
-- CUT HERE --
debugger_init %debughost% %debugport%
namespace eval request {
debugger_eval {
-- CUT HERE --
instead of 'namespace eval request {'

it could be done with an option in httpd.conf - it would supply directory
to prodebug.tcl, host and port of remote debugger.

if this config option is set then:
1. prodebug.tcl should be sourced during GlboalInit (preferably by
mod_dtcl, not user)
2. the above should be inserted if 'toplevel' and another '}' at the end.

Since I don't know much about Apache API, I'd rather not to write it
myself.

--
Wojtek Kocjan
[EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to