This is the mail archive of the insight@sources.redhat.com mailing list for the Insight project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: debug and trace tcl/tk of Insight


On Tue, 2004-11-02 at 02:01, Speer_Han@ali.com.tw wrote:
>   I want to trace and debug tcl/tk source code of insight, but I don't know
> how, could anybody give me a guide?

There is a way to use a tcl debugger on insight, as I recall. But I have
never used it. The only mention of a debugger in the sources is a single
define in generic/gdbtk.c called "NO_TCLPRO_DEBUGGER". I presume this
refers to the old TclPro debugger. I don't know if it is still around. I
imagine that the expect debugger should still work.

I'm afraid I don't know much more. Maybe Jim Ingham or Fernando Nasser
will spot this message and chime in with further details.

>   Additionally, I don't konw which IDE tool the developers of insight use
> to develop the UI. Tcl Dev Kit or vtcl?

I really hate IDEs. They are the scourge of the screen. I don't believe
any one of the developers that worked on it originally ever used an IDE.
We all are emacs/vi(m) users. Tcl is such an easy language to learn and
use, it's easy to prototype new UI features, since one can resource tcl
files at runtime. We typically create features like new windows outside
insight with dummy data. We then pass it around to other developers for
opinion, make changes, reiterate, and then integrate the code into the
main insight sources. Of course, with the licensing limbo, nothing has
been done in a very long time.

Anyway, here's how I debug Tcl code: The insight tcl code has a debug
window where you can programmatically send debug messages. To open the
debug window, you can either set GDBTK_DEBUG !=0 in your environment
(debug window opens when insight starts) or open a console window after
insight has started and type "tk ManagedWin::open DebugWin".

To send output to the debug window, you use the "dbug" command:

dbug W "This is a warning"
dbug I "This is info"
dbug E "This is an error"

The debug window has commands to mark text, clear it, etc, but it also
has one really cool (and useful) feature: the ability to resource tcl
source files at runtime. So when debugging code, I insert a bunch of
dbug statements, run my little testcase to reproduce a bug, make changes
to the tcl file, and resource the file from the debug window. Then I run
through the test procedure again, and my changes to the tcl files show
up immediately. No need to quit insight and restart.

Keith


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]