public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
* debug and trace tcl/tk of Insight
@ 2004-11-02 10:01 Speer_Han
  2004-11-02 17:40 ` Keith Seitz
  0 siblings, 1 reply; 2+ messages in thread
From: Speer_Han @ 2004-11-02 10:01 UTC (permalink / raw)
  To: insight

Dear all,

  I want to trace and debug tcl/tk source code of insight, but I don't know
how, could anybody give me a guide?
  Now I trace insight source code with insight itself, but limiting to C
source code.
  Additionally, I don't konw which IDE tool the developers of insight use
to develop the UI. Tcl Dev Kit or vtcl?
  Thanks a lot!

Speer

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: debug and trace tcl/tk of Insight
  2004-11-02 10:01 debug and trace tcl/tk of Insight Speer_Han
@ 2004-11-02 17:40 ` Keith Seitz
  0 siblings, 0 replies; 2+ messages in thread
From: Keith Seitz @ 2004-11-02 17:40 UTC (permalink / raw)
  To: Speer_Han; +Cc: 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-11-02 17:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-02 10:01 debug and trace tcl/tk of Insight Speer_Han
2004-11-02 17:40 ` Keith Seitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).