Get or set the value of a local variable.
locals [options] [variable-name [variable-value]]
Get or set the value of a variable specified by
<variable-name>. When the variable name and value are not specified, values of all the local variables are returned. Elements of complex data types like structures can be accessed through the '.' operator. For example, the var1.int_type refers to the int_type element in the var1 struct. Array elements can be accessed through their indices. For example, array1 refers to the element at index 0 in array1.
|Return the variable definitions like address, type, size, and RW flags.
|Return the result in Tcl dict format, with variable names as dict keys and variable values as dict values. For complex data like structures, names are in the form of parent.child.
The return value depends on the options used.
<none>: Variable value(s)
-defs: Variable definition(s)
Nothing, when variable value is set. Error string, if variable value cannot be read or set.
Return the value of the local variable Int_Loc.
Return the values of all the local variables in the current stack frame.
Return definitions of all the local variables in the current stack frame.
locals Int_Loc 23
Set the value of the local variable Int_Loc to 23.
Return the value of the int_type element in the var1 struct, where var1 is a member of the tmp_var struct.
Return the value of the element at index 0 in array array1. array1 is a member of the var1 struct, which is in turn a member of the tmp_var struct.