ActiveState Community

Tcl debug in Komodo on windows - dead slow ?

Posted by pavelk_silvaco on 2009-01-12 18:17
OS: Windows

We've been using Komodo for years on Linux/Solaris, and now need to do the same on windows...

After doing all setup needed, it is working but in a weird way -- if I set breakpoint on the first line of a script -- dbgp_tcldebug.exe is taking 100% of my 2.4Ghz CPU for about 70 seconds... Then the cursor appears and I can step through script.. I tried setting the breakpoint somewhere in the middle of application scripts and it took 11 minutes of 100% CPU load to get there.. But again, after it gets to the breakpoint -- all works OK.

The whole script executes in 0.5 seconds standalone.. 11 minutes with debugger attached ? Something is wrong.. Maybe someone could point me to a solution ... ?

Thanks!

ericp | Tue, 2009-01-13 17:23

The debugger works fine on my Windows box here.

Thanks,
Eric

pavelk_silvaco | Wed, 2009-01-14 14:31

It is a pretty big commercial application that has TCL interface with corresponding special scripts to execute... In debug session the application becomes "tcl shell".. Running on Windows 2000..

Will keep trying to change something..

Thanks

pavelk_silvaco | Wed, 2009-02-11 15:51

After trying various ways of doing debug on windows with Komodo and Debugger from Tcl DevStudio , I suspect that what takes long CPU time for dbgp_tcldebug.exe process is instrumentation of our scripts. Those are about 400K lines I think... However, on Linux / Solaris I had a feeling that only scripst in files that you step into or set breakpoints at get instrumented (on the fly) , not everything at once...

Maybe I could tweak some setting on Windows to force the same behavior ?

DevKit Debugger has this information line on the bottom that says "instrumenting filexxx.tcl" and it takes 10 minutes of 2.5Ghz CPU just to start the application in debugger (and few seconds on comparable linux)

Appreciate anyone's help on this....

Thanks,
Pavel.

bgrupczy | Tue, 2009-09-22 13:45

I need the same feature. Any word on implementation?

Thanks,
-Brad

andreas.kupries | Wed, 2009-09-23 09:59

The debugger instruments a file when it is 'source'd by the application. This can happen during stepping, but will also happen during regular execution of code without breakpoint. This is the same for all platforms, and Komodo vs TDK will make no difference either.

This also means that during a package search (for a 'package require') all the "pkgIndex.tcl" files found by the package management are getting instrumented. While they are usually very short and thus quickly processed this can be a lot because regular package management scans all the auto_path directories (and first-level sub directories) when a package is not known, and this can contain hundreds of packages, i.e. pkgIndex.tcl files. This happens on the first 'package require' of the app.

Another place where instrumentation can get bogged down is when it has to process very large files (100K+). A good example for that would be Jeff's tkcon(.tcl)).