Re: [Activetcl] Can't get remote debugging to work
by Andreas Kupries other posts by this author
Jun 20 2008 11:31AM messages near this date
view in the new Beta List Site
Re: [Activetcl] Can't get remote debugging to work
|
Re: [Activetcl] Can't get remote debugging to work
Ok, this problem with handling the options seems to be a problem in
httpd.tcl and the packages/files it uses, and not in the TDK or th debugger.
That I cannot help with, as I do not really know tclhttpd internals.
--
Andreas Kupries <andreask@[...].com>
Developer @ http://www.ActiveState.com
Tel: +1 778-786-1122
-----Original Message-----
From: activetcl-bounces@[...].com
[mailto:activetcl-bounces@[...].com]On Behalf Of Matthew
Smith
Sent: Friday, June 20, 2008 10:45 AM
To: activetcl@[...].com
Subject: Re: [Activetcl] Can't get remote debugging to work
After some experimentation, I believe the problem is with the command line
stuff. I have commented out a lot of code and got it down to just this,
which works:
set auto_path "c:/tcldevkit/lib $auto_path"
package require tcldebugger_attach
#if {$cmd_options(remotedebug)} then {
# debugger_init $cmd_options(host) $cmd_options(port)
#}
debugger_init 127.0.0.1 2576
I would like to get the command line options to works, so that I don't
have to change the code to turn the remote debugging on and off, and could
just control it with command line options.
If I change the command line call to this(with the remotedebug):
I get this error:
httpd usage: httpd.tcl options:
(whole bunch of options)
while executing
"error [usage $optlist $usage]"
(procedure "cmdline::getoptions" line 15)
invoked from within
"cmdline::getoptions argv $CommandLineOptions "usage: httpd.tcl options:""
invoked from within
"array set Config [cmdline::getoptions argv $CommandLineOptions "usage: httpd.tcl op
tions:"]"
(file "bin/httpd.tcl" line 201)
So it seems that the command line to launch httpd server will not accept
the command line options to control remote debugging.
Perhaps I can modify the httpd.tcl file rather then the
requesthandler.tcl(where the code is now).
On Fri, Jun 20, 2008 at 12:15 PM, Andreas Kupries
<andreask@[...].com> wrote:
When you are starting the httpd.tcl server, is the Tcl DevKit Debugger
already running ?
And configured to accept a remote connection?
See debugger menu File -> New Project, Panel 'Application', Area
'Debugging type'.
Note the port entry field a well (Default is 2576).
After Ok'ing that dialog the debugger waits for a connection.
Then you can start the Httpd server.
What is the error which was thrown ?
--
Andreas Kupries <andreask@[...].com>
Developer @ http://www.ActiveState.com
Tel: +1 778-786-1122
-----Original Message-----
From: activetcl-bounces@[...].com
[mailto:activetcl-bounces@[...].com]On Behalf Of Matthew
Smith
Sent: Friday, June 20, 2008 9:38 AM
To: activetcl@[...].com
Subject: [Activetcl] Can't get remote debugging to work
I am trying to get the remote debugging in ActiveState TCL Dev kit to
work. I have a proc mapped to a url in httpd server. In the code I have
added the following lines:
package require cmdline
set allowed_command_line_options [ list { remotedebug 1 }
{ host.arg 127.0.0.1 } { port.arg 2576 }
{ config.arg ".." } ]
array set cmd_options [::cmdline::getoptions argv $allowed_command_line_opti
ons "Mail Robot options:" ]
# Check if we are running with the remote debugger.
# To use the remote debugger start the application with
# the argument -remotedebug -host ipaddress
# if the -host argument is omitted,
# the app will look for the debugger running on the
# local host (127.0.0.1).
set auto_path "c:/tcldevkit/lib $auto_path"
package require tcldebugger_attach
if {$cmd_options(remotedebug)} then {
debugger_init $cmd_options(host) $cmd_options(port)
}
I have tried starting the script with these two command lines:
%SystemRoot%\system32\cmd.exe /k "tclsh bin/httpd.tcl -port
8001 -debug 1"
%SystemRoot%\system32\cmd.exe /k "tclsh bin/httpd.tcl -port
8001 -debug 1 -remotedebug 1"
The first doesn't error, but I don't get the remote debug starting,
the second throws an error.
I don't really understand all the code as this snippet was given to
me, so I'm at a loss as to what to try next.
Thanks for any help.
Thread:
Matthew Smith
Andreas Kupries
Matthew Smith
Andreas Kupries
Larry W. Virden
Matthew Smith
|