Call Stack tab

All procs and commands in the current chain of calls are shown in the NetBeans IDE Call Stack tab. These columns are on the tab:

  • Frame
  • Command String
  • FileName:LineNumber
  • Level

The current command is shown at the top. It has the largest frame number. The callers are shown individually below the top frame.

The program does not stop before the current command. It is in the current command, but before the command is run. This means the current command string is after command substitution and variable substitution. See http://tcl.tk/man/tcl8.4/TclCmd/Tcl.htm. This lists a summary of Tcl language syntax.

For example, the value of variable i is 5.

  • If the command in the source code is set x $i, then the Command String column entry is set x 5.
  • If the command in the source code is set x [expr $i*2], then the Command String column entry is set x 10.

Example

proc_in_this_file { args } { 
     variable a 
     #uplevel 1 echo [set args] 
     #set str "proc_in_this_file: $args" 
     #puts stdout "proc_in_this_file: $args" 
     for {set i 0} {$i < 5} {incr i} 
          { proc_deep $i 
     } 
     set a $i }

A breakpoint is set in the for loop body.

When the program stops here, the current command string is proc_deep 0. $i is substituted with its value 0.

Now, even if you change the value of variable i to 3, when you step into proc_deep, the argument is still 0 instead of 3.

When the body run is completed, before and after incr i is run, the new value of i takes effect, changing from 3 to 4.