How un-resolvable watch window symbols can affect debugging speed

Once a variable is added to the watches window, it is retained even after the project debug session is ended and/or different project is currently being active. If the number of such un-resolvable variables in the watch window grows, it can considerably slow down the debugging speed of your active project.

Consider the following scenarios and corresponding watch window behaviors:

1

When a debug session is not active within MPLAB X

The watch window is simply a table of information (strings). You can type in whatever you want. It is not project specific. This is a great advantage when debugging multiple projects, and keeping a clean watch view for where you want to focus.

2

When you start the debug session and perform a halt for any reason (user triggered, Break Point, Step)

All the variables in the watch list will be resolved with the debug information associated with the current active debug session. The watch strings that cannot be resolved are hidden to reduce visual clutter. Local variables are labeled as out of scope if unresolvable for the current program. The ones resolved will show their respective values. In order to keep the list valid at all times this occurs on each halt.

3

If you switch to another active debugging session (debugging multiple projects at the same time)

The watch list is re-resolved and only the variables resolved for the new active session are showed with the others being hidden. This gives a clean view of the variables associated with the current active debug session of that project.

Similarly, if you have multiple projects open and after debugging one, Halt the session and start debugging another project the watch list will be re-resolved at a halt, to only show the variables applicable to the current active debug session. This allows you to keep a list of watches for either project that will be shown or be hidden depending on which project you are actively debugging at the time.


If one never cleans up their watch window, you may have numerous variables that will try to get resolved within the watch window with no luck. This takes additional time on each halt and can severely slow down debugging of your active project.

There are a few things you can do to avoid this delay.

1

You can save watches for specific projects and load them when you need them

For instance to change contexts between project A and project B is to click the Blue Diamond icon in the watch window with the save disk in front of it ExportWatches.gif to save the watch list, and then click the Blue Diamond icon with the manila folder ImportWatches.gif to import the watch list. When importing you can exchange the list or append it to the current list.

2

There are also the alternative watch views that you can use

The alternative watch views can be enabled from the Tools>/Options>/Embedded>/Generic Settings tab.These become available only when you are in a debug session. You can have three alternative watch views that variables can be assigned to.

watch.png

You can keep variables separated by projects or by specific debug contexts you are working on. Keeping variables in the different views will provide organization and association of variables that are applicable to your debug session as well as avoiding the overhead of trying to resolve watches that are not applicable.

A best practices approach is to clear the watch list (context menu ‘Delete All’) from time to time when no debug session is active.

20th Annual
Microchip MASTERs Conference 2016
Register now - Deadline: July 29

JW Marriott Desert Ridge Resort-Phoenix, AZ

© 2016 Microchip Technology, Inc.
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.