recently I stepped about the problem of executing Tcl (byte) code
stepwise - which means setting breakpoints at arbitrary positions in a
script and step over commands, step into commands, step to the end of a
script and jump to the next breakpoint... in short, to gave the
functionality that a debugger has.
So, there are some examples on the wiki but none of them were
implementing *real* breakpoints that can be set elsewhere in the code.
command traces can be used to implement breakpoints by a procedure but
not for breakpoints somewhere in the script.
Then I found Atkdebugger, an extension which Arthur Trzewik created
back in 2004 (http://wiki.tcl.tk/8395,
http://www.xdobry.de/atkdebugger/index.html). He created the
atkdebugger extension and also a patch for Tcl to make stepwise
execution and breakpoints happen - a feature that is really nice and
exactly what I wanted to have. Without the Atkdebugger extension, the
patched Tcl code behaves like before, but with the extension it is
possible to implement advanced debugging, together with Tcl's
introspection features.
Now my question: is there a chance that this patch goes in Tcl8.5, if
proposed as TIP? Reference implementation (although for 8.4) is already
there in form of the patch and it would be a really cool and
outstanding feature. I'd love to see it... and I can imagine that I am
not the only one.
What do you think?
Eckhard
We have it - but only inofficially. It should be easy to include this
patch in the core (with adjusted naming, maybe). Please comment or
prove me wrong..
Eckhard
Every chance, especially if there's a patch available and the API
changes aren't too awful. :-)
Donal.
Note that any script-level hooks might need an extension anyway. It's
not such a bad thing to need to say [package require debug] though. I
have seen discussions of such a thing several times in the past too.
Donal.
I just browsed the TIP list and saw that an appropriate TIP (#86) has
already been made and a patch (against Tcl8.4.9) is supplied. The
status is "draft" - what exactly does that mean... is it what it sounds
like?
Can this one go in 8.5?
BTW, what's the status of TIP #131 :-)?
Eckhard
You think it's in a fit state? Might be time to do a formal review then,
see if someone in the TCT is happy to sponsor a vote.
> BTW, what's the status of TIP #131 :-)?
Doing nothing since my mind is a blank. :-)
Donal.
I spent yesterday's evening to patch 8.4.13 and test it. The concept
seems nice and powerful, but the new commands are a bit buggy
(inacceptable crashes in [trace breakpopint] and [trace execution] when
called with wrong arguments and the like).
At the moment, it's not very clear to me how to implement a debugger on
top of it, but that's probably, because I didn't dive deep enough.
My conclusion is (from a users point of view), that it is a good idea
and worth to follow, but it's not finished completely. There has to go
some work into the patch to fix bugs and update it for 8.5.
Eckhard
TIP #86 had some flaws. We (ActiveState) are working on one that is a
blend of #86 and #211 and is indeed (in our opinion) more powerful. We
will post this soon.
--
Jeff Hobbs, The Tcl Guy, http://www.activestate.com/
> TIP #86 had some flaws. We (ActiveState) are working on one that is a
> blend of #86 and #211 and is indeed (in our opinion) more powerful. We
> will post this soon.
Thank you. Again my impudent question ;-)... Is this going to be in
8.5?
Eckhard
Given what everyone's said so far, the answer has to be "not in its
current form" with the understanding that this doesn't mean very much if
the current form is about to change.
Thanks for the evaluation. That sort of thing is tremendously useful.
Donal.
There are no guarantees, but the TIP would target 8.5. It is in final
review amongst a few people right now.