Re: retrieving line number in case of error - "simple debugger"



Hi Nicolas,

how about that one (taken from the wiki, don't remember where):

proc ?# {args} {
if {[info exists ::tcl_platform(debug)] && $::tcl_platform(debug)} {
uplevel 1 $args
}
}

Best regards

Ulrich


In article <87ll1fyhgm.fsf@xxxxxxxxxxxxxxxxxxxx>,
Bruce Stephens <bruce+usenet@xxxxxxxxxxxxxxxxxxxx> writes:
> Nicolas Castagne <castagne@xxxxxxx> writes:
>
>> gwl wrote:
>
> [...]
>
>>> man puts
>> MMhh, sorry but I don't get it.
>> Do you mean the user should use puts to build its own debug-tool ?
>
> Almost all debugging problems end up with you wanting to know the
> value of some variables in a few places, and you can find that out by
> inserting a few puts statements in the code.
>
> (It's not always true, of course, but very often that's the case: you
> speculate what the problem might be, and adding a few puts statements
> tells you whether you were right or not. And since Tcl is
> interpreted, doing that's often no slower overall than using a
> debugger would be.)
.