The Current Scope

By typing "s 14“, the debugger executes fourteen steps. This brings me to the first command in procedure p3.

dbg8.8> s 14
4: set m 0
dbg5.9> w
 0: expect -D 1 debug-test.exp
 1: p1
 2: p2
*3: p3
 4: set m 0

The asterisk denotes that p3 is the current scope. I can now execute Tcl commands appropriate to the scope of p3. This includes commands that can look or operate directly in other scopes such as global, uplevel, and upvar, but it is simpler yet to move the current scope up and down the stack.

dbg5.10> uplevel {set c}
4

Get Exploring Expect now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.