I am new to tcl and I am trying to find the best method to debug a tcl
process remotely. I have waded through many discussions and
experimented with quite a few debugging tools out there, but I still
don't have a clear idea of what I can use in my situation.
There is a tcl program (using apache, and tcl is embedded in html and
such) on both linux and solaris servers. I need a way to attach a
debugger to the running processes on those machines. I would prefer
to debug from a windows platform, but at this point I am open to other
possibilities. It looks like some of the debugging tools such as
TclPro Debugger requires changes to the tcl program or a wrapper to
allow it to remotely debug a process. Is there any tools out there
that can handle this in a different way? I really don't want to
modify the existing code. I keep seeing references to a "send"
command in unix - is there some way I can make that work for me? If I
set up a linux virtual pc with XWindows on it is there some remote
debugger I can install that will work for this scenario?
Although not an ideal solution, I have also been looking for any
debugging tools that I could run directly on servers running the
processes and debug it on the server. However it seems every one I
have tried so far has some sort of GUI interface which I can't use as
I am just using putty to connect to the machines.
I would appreciate any suggestions or ideas about how to tackle this -
thanks!
Kevin
No guarantees, but you might look at http://wiki.tcl.tk/20213 "Remote
debugging via socket" - at least it's very simple, maybe it gives you
ideas...
IIRC, there was something in the documentation of RamDebugger that talked
about remote debugging. It wasn't something that I was concerned with so I
didn't take any further notice.
http://www2.compassis.com/ramdebugger/
Rob.
Answering to other posts reporting problems with Tile package, it is
necessary to have several packages installed in the computer in order to
run RamDebugger. If you install ActivestateTCL you will have all of them.
Rob escribió:
You can either attach via Tkcon ( probably not from win though )
or build a socket server as remote execution server
into the application.
I have used the second solution with good success.
uwe
> Hi Everyone,
>
> I am new to tcl and I am trying to find the best method to debug a tcl
> process remotely. I have waded through many discussions and
> experimented with quite a few debugging tools out there, but I still
> don't have a clear idea of what I can use in my situation.
> [...]
Hello Kevin,
Even though it might require slight modifications in your code, I'd still
recommend TclPro's debugger.
It is the most convenient way to debug such code.
You might want to add something like in the beginning of your file or add
a tiny wrapper to do the following and source your code:
# ::env(DEBUGHOST) maps to DEBUGHOST environment variable - you might want
to use something different here.
if {[info exists ::env(DEBUGHOST)]} {
source /path/to/initdebug.tcl
debugger_init $::env(DEBUGHOST)
}
I'd recommend doing a small test-project using the same techniques (I
assume you're writing CGI). For example try to do a simple hello world,
try to inline the initialization code vs adding it in another file and see
which ones seem acceptable by you.
Remember that since your code is called via the web you should also
consider security - if for example you add a parameter debug that would
accept any IP address, someone could make the script connect to their
debugger and execute code on your machine.
Also, please note that AOLserver offers TclPro integration, at least it
used to offer such. So, if you're working with that, you're pretty much
done - the docs should have the details on how to enable it.
--
Wojciech Kocjan
> No guarantees, but you might look athttp://wiki.tcl.tk/20213"Remote
> debugging via socket" - at least it's very simple, maybe it gives you
> ideas...
Thanks, sounds interesting - I'll take a look.
Kevin
> You can either attach via Tkcon ( probably not from win though )
> or build a socket server as remote execution server
> into the application.
I have looked a little bit at the Tkcon program. What I did not
understand is that with program I can Console->Attach To->Socket, but
what do I need to setup on the remote system to make it respond to the
socket?
Kevin
> Even though it might require slight modifications in your code, I'd still
> recommend TclPro's debugger.
Thanks, I'll give the TclPro Debugger another look and make a test
program I have use it to debug remotely to see how well it works
out.
Kevin