Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Remote Debugging

16 views
Skip to first unread message

KevinL...@gmail.com

unread,
Oct 23, 2007, 2:55:26 AM10/23/07
to
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.

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

suchenwi

unread,
Oct 23, 2007, 5:15:11 AM10/23/07
to
On 23 Okt., 08:55, KevinLMul...@gmail.com wrote:
> 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?

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...

Rob

unread,
Oct 23, 2007, 5:31:26 AM10/23/07
to
suchenwi wrote:

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.

Ramon Ribó

unread,
Oct 23, 2007, 5:45:06 AM10/23/07
to

RamDebugger permits to debug remotely a program that is being
executed in the same computer. The TCL program need to have one added
line explaining to the world that it wishes to be debugged (how, if not,
would you control the access/security issues?

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ó:

Uwe Klein

unread,
Oct 23, 2007, 5:59:34 AM10/23/07
to
KevinL...@gmail.com wrote:
> 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.

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

Wojciech Kocjan

unread,
Oct 23, 2007, 6:13:54 AM10/23/07
to KevinL...@gmail.com
Dnia 23-10-2007 o 08:55:26 <KevinL...@gmail.com> napisał(a):

> 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

KevinL...@gmail.com

unread,
Oct 23, 2007, 10:15:58 PM10/23/07
to
On Oct 23, 5:15 pm, suchenwi <richard.suchenwirth-
bauersa...@siemens.com> wrote:

> 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

KevinL...@gmail.com

unread,
Oct 23, 2007, 10:19:30 PM10/23/07
to
On Oct 23, 5:59 pm, Uwe Klein <uwe_klein_habertw...@t-online.de>
wrote:

> 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

KevinL...@gmail.com

unread,
Oct 23, 2007, 10:23:31 PM10/23/07
to
On Oct 23, 6:13 pm, "Wojciech Kocjan" <wojciec...@gazeta.pl> wrote:

> 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

Uwe Klein

unread,
Oct 24, 2007, 3:49:28 AM10/24/07
to
Tkcon Remote Access over TCP Sockets
http://wiki.tcl.tk/14701

uwe

0 new messages