RealView
DebuggerIn HSD mode, you can view the variables for all threads when the processor is stopped, by cycling through the threads in an unattached Code window, or by attaching each thread to a Code window.
The PC address and the Stack Pointer relate
to the thread, they are only the same as the values for the processor
if you are examining the thread that was running when the processor stopped.
You can make changes to the local variables for a thread, but if you make a change to a local variable that is stored in a register, the change is made either in the processor register if the thread was running when the processor stopped, or in the stored (switched out) register otherwise.
A variable that is shared by several threads might be cached to a register for one or more of the threads. Consequently, if you change its value in one thread, it does not necessarily change in all threads. It is necessary to check whether there are any threads with a cached copy of the variable so that you can make the change to the copy as well. Alternatively, you can declare the variable to be volatile and recompile the program.
In the Watch
or Call Stack panes, a variable
stored in a register is indicated by <@rn>
following its value.
In RSD mode, you can view the variables for any captive threads, either in an unattached Code window as the current thread, or by attaching each thread to a separate Code window. The values displayed relate to the thread only as the processor is still running.