Show All/Selected Local Variables
Scope.png
The icon on the top left-hand side of the Variables window controls which variables are displayed. When in the form of open curly braces CurlyBraces.png, it will show all local variables in scope of the function you are currently debugging. If you click on it, it will change to look like the Focus Cursor at PC icon Window_Debugging_PCProfiling.png. This provides a hyper focus of the variables in the immediate area of where you are stepping and where the cursor is located. In this form, it will only show local variables on the exact line the cursor is on, as well as on the line before.

Application

Accessing ALL Local Variables

The upper left icon in the Variables window controls the range of local variables being displayed. Clicking on this icon will toggle the window from displaying all the local variables in a particular function, or a specific range of variables. When the icon displays a set of curly braces "CurlyBraces.png", all the local variables within the scope of the current function will be displayed. The image below shows this icon set to display all the local variables in the function.
All_local.png

The debug session must be paused within a function in order to see the local variables with just the Variables window. Please note the green bar is paused within the function foo() in the image on the right.

Accessing Local Variables At PC Level And Line Above

Occasionally you will find too many variables within the current frame to easily view. The Variables window allows you to view the variables "near" the current Program Counter location. By near, it is meant that you can view any local variable in the line pointed to by the Program Counter and the line immediately before it. This will allow you to set breakpoints and see just the local variables' values as they are accessed by the program. To set the Variables window to display only variables near the program counter, push the top most control icon CurlyBraces.png until it displays a left-to-right green arrow Window_Debugging_PCProfiling.png.
Near_locals.png
© 2024 Microchip Technology, Inc.
Notice: ARM and Cortex are the registered trademarks of ARM Limited in the EU and other countries.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.