• Debugging tools

    From saito@saitology9@gmail.com to comp.lang.tcl on Mon Mar 30 14:30:33 2026
    From Newsgroup: comp.lang.tcl

    Is there any debugging tool for tcl? I am not sure what features it
    would have but basic step execution or proc tracing or something similar
    would be sufficient for what I am looking for. It is fine if it has more features for professionals or advanced users but something basic would
    go a long way.

    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From et99@et99@rocketship1.me to comp.lang.tcl on Mon Mar 30 18:31:57 2026
    From Newsgroup: comp.lang.tcl

    On 3/30/2026 11:30 AM, saito wrote:
    Is there any debugging tool for tcl? I am not sure what features it would have but basic step execution or proc tracing or something similar would be sufficient for what I am looking for. It is fine if it has more features for professionals or advanced users but something basic would go a long way.

    For normal use, there's TclPro Debugger. Since I've seen posts where you appear to be on windows, I would look at the MagicSplat distribution, it includes that debugger and has a start menu item to launch it.

    -e

    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From sm.smithfield@gmail.com@user3870@newsgrouper.org.invalid to comp.lang.tcl on Tue Mar 31 03:21:05 2026
    From Newsgroup: comp.lang.tcl


    saito <saitology9@gmail.com> posted:

    Is there any debugging tool for tcl? I am not sure what features it
    would have but basic step execution or proc tracing or something similar would be sufficient for what I am looking for. It is fine if it has more features for professionals or advanced users but something basic would
    go a long way.


    ##################################################################
    # my personal dbg solution
    # covers 99% of my needs.
    # about the names.
    # deliberately
    # short
    # easy to type
    # non-descriptive in the consensus coding style
    # low chance for collision ##################################################################
    # these notions started w/ my scheme experience.
    # scheme: so much flexibility and so little support.
    # a scheme function like this one served all my debugging needs.
    # When I moved to tcl I took the idea w/ me. ##################################################################
    # out : takes a variable name
    # sends a string to stdout displaying the name and its local value. ##################################################################
    proc out {n} { upvar $n x ; puts "$n : $x" } ##################################################################
    # taking the notion further and making use of tcls string handling convenience ##################################################################
    # tap : takes a list of variable names
    # sends them to stdout in a format that lines up
    # "variable name(s)" : "local value(s)"
    # for easy reading ##################################################################
    proc tap {args} {
    set ln 0
    foreach n $args { set ln [expr {max($ln,[string length $n])}] }
    foreach n $args { upvar $n x ; puts [format " %${ln}s : %s" $n $x] }
    }
    ##################################################################
    # Realizing, tcl actually has the introspection that
    # scheme says it has and doesn't. (at the time, mb its all supported now) ##################################################################
    # pips applies tap to all local variables ##################################################################
    proc pips {} { uplevel { tap {*}[info locals] } } ##################################################################
    # the crown jewel, tat,
    # short for 'tattle' as in to inform about
    # or 'tat' as in a simple quick stitch.
    # slip tat in as the first line of any proc ##################################################################
    # tat
    # sends the name of the proc and
    # all the values used to invoke
    # to stdout
    ##################################################################
    proc tat {} {
    set rv [list]
    set info [info frame -1]
    if { [dict exists $info proc] } {
    lappend rv [dict get $info proc]
    } elseif { [dict exists $info method] } {
    if { [dict exists $info class] } {
    lappend rv [dict get $info class]
    }
    lappend rv [dict get $info method]
    } elseif { [dict get $info type] eq "source" } {
    lappend rv [file tail [dict get $info file]]
    lappend rv [dict get $info line]
    } else {
    lappend rv [dict get $info type]
    lappend rv [dict get $info line]
    }
    puts [join $rv ::]
    uplevel 1 { pips }
    }
    ##################################################################
    # When sketching code,
    # I put in tat as the body of procs that are 'yet to be'
    # verify that A calls B calls C etc... then
    # as I fill in the code
    # tat confirms that they are called AND what they are called w/
    # that's all I ever really need to get things sorted out.
    #
    # I have more stuff like this for larger efforts, but I don't know whether this is useful.
    # I'm not a professional. ##################################################################
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From saito@saitology9@gmail.com to comp.lang.tcl on Tue Mar 31 14:28:36 2026
    From Newsgroup: comp.lang.tcl

    On 3/30/2026 11:21 PM, sm.smithfield@gmail.com wrote:

    saito <saitology9@gmail.com> posted:

    Is there any debugging tool for tcl? I am not sure what features it
    would have but basic step execution or proc tracing or something similar
    would be sufficient for what I am looking for. It is fine if it has more
    features for professionals or advanced users but something basic would
    go a long way.


    ##################################################################
    # my personal dbg solution
    # covers 99% of my needs.
    # about the names.
    # deliberately
    # short
    # easy to type
    # non-descriptive in the consensus coding style
    # low chance for collision ##################################################################

    Nice stuff, thank you.
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From saito@saitology9@gmail.com to comp.lang.tcl on Tue Mar 31 14:29:20 2026
    From Newsgroup: comp.lang.tcl

    On 3/30/2026 9:31 PM, et99 wrote:

    For normal use, there's TclPro Debugger. Since I've seen posts where you appear to be on windows, I would look at the MagicSplat distribution, it includes that debugger and has a start menu item to launch it.

    -e


    Yes, I am on Windows. I will check it out. Thank you.
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From Petro Kazmirchuk@vivid.tree7955@fastmail.com to comp.lang.tcl on Tue Mar 31 20:51:50 2026
    From Newsgroup: comp.lang.tcl

    On 31/03/2026 20:28, saito wrote:
    On 3/30/2026 11:21 PM, sm.smithfield@gmail.com wrote:

    saito <saitology9@gmail.com> posted:

    Is there any debugging tool for tcl? I am not sure what features it
    would have but basic step execution or proc tracing or something similar >>> would be sufficient for what I am looking for. It is fine if it has more >>> features for professionals or advanced users but something basic would
    go a long way.


    ##################################################################
    # my personal dbg solution
    # covers 99% of my needs.
    # about the names.
    # deliberately
    #   short
    #     easy to type
    #   non-descriptive in the consensus coding style
    #     low chance for collision
    ##################################################################

    Nice stuff, thank you.

    note there's a fork of TclPro that supports DAP https://github.com/puremourning/TclProDebug

    I believe, if somebody could make a VSCode plugin based on this, it
    would be a much appreciated contribution to the community
    --- Synchronet 3.21f-Linux NewsLink 1.2