Showing posts with label Debugging. Show all posts
Showing posts with label Debugging. Show all posts

Tuesday, February 22, 2011

Debugging Tcl, advanced way.. (part 1)

DEBUG helpers - code.

Hi,
Here is a nice helper code to make your debug life much much easier.

If you encountered in a bug and the debugger is so slow you wana die, you probabelly puts some messages in the function entry and when the function returns (with it's value).

In the attached code you'll find a very nice surprise.

Sunday, February 20, 2011

Guide: Setting up Eclipse with DLTK and ActiveState to debug TCL.

Let's start working...

Download and install Eclipse SDK
1. Download Eclipse (I used 'Eclipse IDE for Java Developers').
2. Unzip (or install, depends on the download type) to your favorite location.

Download and install DLTK
3. Run Eclipse.exe from that location.
4. Menu->Help->Install new software...
5. Right of 'Work with:' click the 'Add' button.
6. In the name enter 'DLTK'
7. location = 'http://download.eclipse.org/technology/dltk/updates/'
8. Click OK and wait a few seconds for the Eclipse environment to fetch the versions.
9. Select the appropriate version (for 'Helios Eclipse SDK' (version 3.6.1) I used DLTK 2.0v). Note: You can select the minimum for TCL (listed below), I selected all the DLTK.
10. Next.. Next ... Accept the license agreement, Wait for the download to finish.

here is a minimum list i found to install TCL DLTK:
>>> Dynamic Language Toolkit – Core Frameworks
>>> Dynamic Language Toolkit – Core Frameworks SDK
>>> Dynamic Language Toolkit – iTCL Development Tools
>>> Dynamic Language Toolkit – iTCL Development Tools SDK
>>> Dynamic Language Toolkit – TCL Development Tools
>>> Dynamic Language Toolkit – TCL Development Tools SDK
>>> Dynamic Language Toolkit – XOTcl Development Tools
>>> Dynamic Language Toolkit – XOTcl Development Tools SDK

Setting up Eclipse Tcl interpreter
11. Download and install TCL Shell and interpreter.
12. Using Eclipse IDE: Menu->Window->Preferences->TCL->Interpreters
13. click 'Add'
1. Name='TCL'
2. Browse... path to the Tcl interpreter executable (I've installed it at '')

Setting up Eclipse Tcl debugger
14. Install 'Komodo remote debugger'
15. Using Eclipse IDE: Menu->->Window->Preferences->TCL->Debug->Engines->Active State
16. Under 'Paths' tab->'External debugger engine'->Path->...->Select the debugger path and file ('dbgp_tcldebug.exe' for windows).


Now you are all set. You should be able to choose new TCL project, write your Tcl code and debug your programs.

Other posts used to create this instalation guide:
* http://blogsai.wordpress.com/2009/10/15/configuring-eclipse-as-tcltk-ide/
*

Have fun...

Monday, February 7, 2011

TCL debug tools.

I've run a search on Google 'how to debug TCL' and found these good articles:

1. What debugging tools are available to a Tcl programmer
* Use puts 'debug $message here'.
* Other strange looking ways to solve the TCL debug problem.
2. Buy 'Tcl Solutions' by 'ActiveState'
3. Try 'Dynamic Languages Toolkit' by Eclipse

As a start-up freelancer solution provider I should provide with as low cost solutions as i can, so... let's start testing these solutions.

'puts' in your code


Already using this solution - very chip, no money spend, but if you consider the work-hours spent: it's not chip at all!!

Eclipse support for dynamic language


I've started with #3: Eclipse support for dynamic language, like TCL and Python.
Very soon found this great looking presentation - Dynamic Languages Toolkit (DLTK) , Looks promising...

After a little struggle I've managed to bring up a working station with Eclipse and DLTK.

In the next post I'll describe how to setup Eclipse with DLTK and a debugger.