TOC PREV NEXT INDEX

 


The Stack Display


The Stack Display shows the most recent stack levels and highlights the current location in your code when the application is stopped. If you select a stack level, TclPro Debugger shows the code and variable values for that stack level in the code display and the variable display. When the application encounters a breakpoint, the last stack frame is automatically selected and highlighted in the Stack Frame display. The call stack includes an entry for each distinct scope or body of code. It displays stack frame information in this format: stack level, Tcl command, and relevant arguments. Stack level 0 indicates the global level. Stack level 1 indicates that a procedure is invoked from level 0; stack level 2 indicates that a procedure is invoked from stack level 1, and so on.


Note: If your code is in an event loop when you click the Stop button, no code is shown in the Code display and the top level in the stack frame displays "event."

The following example shows a sample stack frame:


0 global
0 source myScriptFile
1 proc myProc arg1 arg2 arg3
2 namespace eval myNamespace
3 proc myproc3
0 uplevel
1 proc myproc3 args

In this example, the stack level is reset to 0 by the uplevel command; the uplevel command can be called explicitly in your source code or implicitly by a callback. As with any other procedure call, the namespace eval command creates a new level.

You can navigate through the application by clicking on specific stack frames, which affects both the Variable and Code displays. When you double-click any part of a stack frame, the Code display scrolls to and highlights the current command in that stack frame. For example, if you want to see the code that caused a stack frame to be created, you can double-click the frame directly above the frame in question. In addition to highlighting the current command, if the last stack frame is selected, TclPro Debugger indicates the current command with a yellow Run Arrow in the Code bar. TclPro Debugger also indicates the current command with a green triangular History Arrow in the Code bar. When you click a stack frame, the Variable display shows the variables in that stack frame. For example: if you want to see global variables, you can double-click any Level 0 stack frame. If you click directly on an argument in a proc stack frame, the Variable Window scrolls to and highlights the selected argument.




http://www.ajubasolutions.com
Voice: (650) 210-0100
Fax: (650) 210-0101
support@ajubasolutions.com
TOC PREV NEXT INDEX