idebug(3tk)
π idebug β the manual page, but make it make sense
okay so bestie, welcome to idebug(3tk). yes that's the manual name, we're keeping it, it's iconic. this whole page is about one lil Tcl command that turns your sad little debugging era into a whole main character moment. let's get into it π«Ά
β¨ NAME β¨
idebug β an interactive debugging environment in TkCon
like. it's a debugger. but it lives inside TkCon. and it's lowkey cute about it.
π SYNOPSIS π
idebug body ?level?
idebug break ?id?
idebug {echo ?id?} ?args?
idebug id ?id?
idebug off
idebug on ?id?
idebug {puts ?id?} args
idebug show type ?level? ?VERBOSE?
idebug trace ?level?
nine whole entry points. she's versatile. we love that for her. π
π DESCRIPTION π
okay so here's the vibe: the idebug command gives you a whole interactive debugging environment for procedures, and it does it via TkCon. no cap.
the way it works is you drop idebug break commands straight into your procedure and boom π₯ β you've made breakpoints. when one hits, it pops up the TkCon console and drops you into a "debugging" mode. very demure, very mindful, very breakpoint.
now, real talk: the body, show & trace methods? those are intended for internal use only. don't go playing with them, they're not for you. π
also important: this procedure works for minimal debugging sessions. that's the whole scope, bestie. and comments are encouraged β the original author said so, and honestly, they're right.
π the methods, one by one
idebug body ?level?β prints out the body of the command, but only if it's a procedure, at the level you specify.leveldefaults to the current level. she's nosy and we support her.idebug break ?id?β creates a breakpoint inside a procedure. here's the catch: it will only trigger ifidebugis on AND theidmatches the pattern. when both line up, TkCon pops to the front and the prompt changes to an idebug prompt. from there you get the basic ability to observe the call stack and query/set variables or execute Tcl commands at any level. also, a separate history is maintained while you're in debugging mode. and to see the special commands available at the debug prompt? type?and hit return. that's it. that's the move. β¨idebug {echo ?id?} ?args?β behaves just likeecho, EXCEPT it only triggers whenidebugis on. you can pass an optionalidto restrict triggering even further. if you don't specify anid, it defaults to the name of the command in which the call was made. defaults doing the work so you don't have to πidebug id ?id?β query or set the idebugid. thisidis what the otheridebugmethods check to decide whether they should trigger or not. fun fact: the idebug id can be a glob pattern, and it defaults to*. so yes, she accepts wildcards. she's flexible like that.idebug offβ turnsidebugoff. that's it. that's the whole method. goodbye πidebug on ?id?β turnsidebugon. and if you pass anid, it sets the id to it. two birds, one iconic command.idebug {puts ?id?} argsβ behaves just likeputs, except (you guessed it) it only triggers whenidebugis on. optionalidrestricts triggering further. noid? it defaults to the name of the command in which the call was made. same energy asecho, different energy output. πidebug show type ?level? ?VERBOSE?β heretypemust be one ofvars,localsorglobals. this method outputs the variables/locals/globals present at a particular level. and if you addVERBOSE, then it actually dumps out the values as well β like, the real values, not just the names.leveldefaults to the level in which this method was called. (remember: internal use only, bestie, don't @ me.)idebug trace ?level?β prints out the stack trace from the specified level all the way up to the top level.leveldefaults to the current level. it's giving "here's how we got here" and honestly? relatable.
π SEE ALSO π
dump(3tk), observe(3tk), tkcon(1), tkcon(3tk), tkconrc(5)
the whole friend group. go say hi. πΈ
β KEYWORDS β
Tk, console, debug
three words. all bangers.
π COPYRIGHT π
Copyright (c) Jeffrey Hobbs <jeff at hobbs.org>
respect the author, she ate. π
heads up:body,show&traceare for internal use only β that's not me being dramatic, that's literally in the description. iykyk. π
and that's the whole page, bestie!! this was TkCon version 2.5, served fresh from the idebug(3tk) manual. now go set a breakpoint and slay β¨π
π¦
π¦ where this page comes from
- debian bookworm: tkcon 2:2.7.11-1
- debian trixie: tkcon 2:2.7.11-6
- ubuntu jammy: tkcon 2:2.7.10-2
- ubuntu noble: tkcon 2:2.7.11-1
- ubuntu resolute: tkcon 2:2.7.11-6
- ubuntu stonking: tkcon 2:2.7.11-6
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms