Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Debug API in the core?

8 views
Skip to first unread message

Eckhard Lehmann

unread,
Sep 26, 2006, 11:51:13 AM9/26/06
to
Hi,

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

Eckhard Lehmann

unread,
Sep 27, 2006, 4:10:44 AM9/27/06
to
I want to push this again. They have such a thing in Python:
http://docs.python.org/lib/module-pdb.html.

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

Donal K. Fellows

unread,
Sep 27, 2006, 5:56:38 AM9/27/06
to
Eckhard Lehmann wrote:
> 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.

Every chance, especially if there's a patch available and the API
changes aren't too awful. :-)

Donal.

suchenwi

unread,
Sep 27, 2006, 6:12:05 AM9/27/06
to
If hooks for that API were patched in the code, there should be some
way to use and test them from Tcl, without needing a debugger
extension...
How would that play together with [trace execution]?

Donal K. Fellows

unread,
Sep 27, 2006, 6:21:14 AM9/27/06
to
suchenwi wrote:
> If hooks for that API were patched in the code, there should be some
> way to use and test them from Tcl, without needing a debugger
> extension...

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.

Eckhard Lehmann

unread,
Sep 27, 2006, 1:57:48 PM9/27/06
to

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

Donal K. Fellows

unread,
Sep 28, 2006, 4:16:01 AM9/28/06
to
Eckhard Lehmann wrote:
> 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?

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.

Eckhard Lehmann

unread,
Sep 28, 2006, 7:39:15 AM9/28/06
to

Donal K. Fellows wrote:
> Eckhard Lehmann wrote:
> > 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?
>
> 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.

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

Jeff Hobbs

unread,
Sep 28, 2006, 11:51:36 PM9/28/06
to Eckhard Lehmann

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/

Eckhard Lehmann

unread,
Sep 29, 2006, 3:20:56 AM9/29/06
to

Jeff Hobbs wrote:

> 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

Donal K. Fellows

unread,
Sep 29, 2006, 10:52:48 AM9/29/06
to
Eckhard Lehmann wrote:
> Thank you. Again my impudent question ;-)... Is this going to be in
> 8.5?

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.

Jeff Hobbs

unread,
Sep 29, 2006, 11:39:26 AM9/29/06
to Eckhard Lehmann

There are no guarantees, but the TIP would target 8.5. It is in final
review amongst a few people right now.

0 new messages