The ability to view variables and memory while a target ARM device is running has been added to PEmicro’s GDB Server Plug-in for ARM devices. This Eclipse plugin can be installed in any Eclipse-based IDE and supports the debug of ARM microcontrollers via PEmicro’s Multilink, Cyclone, and OpenSDA debug hardware. The “Real Time Expressions” view, which is part of the plugin, is similar to the normal expressions view, except that it works while the part is running.
Typically when debugging a program, a user would set a breakpoint, resume the target, hit the breakpoint, step through code, check variable values and flush out any bugs that the program may have. The user would repeat this process until all bugs have been addressed. But what if the process of halting the target masks a bug? What if, in order to reproduce a particular bug, the program must be kept running while being fed a particular set of data? In those cases, having the ability to view variable values as they change without halting the target is a great asset. Also, the ability to view variable values while the target is running eliminates the need to have a physical feedback mechanism such as a blinking LED. The user can simply monitor a variable value and check for changes while the target is running to check if a particular section of code gets executed.
The example below will demonstrate how to view variables while an NXP Kinetis KL25Z device is running in NXP's Kinetis Design Studio. A different example showing the NXP Kinetis K64F device can be seen on the popular MCUOnEclipse blog. All ARM Cortex devices are supported.
To open the Real Time Expressions view, please follow the instructions below:
Navigate to Window -> Show View -> Other …
In the “Show View” dialog, select “Real Time Expressions” under the “PE Microcomputer Systems” category:
The “Real Time Expressions” view is shown below:
Once the Real time Expressions view is displayed, variables may be added to the view. After that, no other configuration is needed. The refresh mechanism is enabled by default when the target runs. Values that are refreshed are highlighted in blue text.
If there is a need to halt the refresh mechanism, pressing the “Halt” button freezes the values.
Pressing it again re-enables the refresh mechanism:
For pointers that are constantly changing values, the values from de-referencing the same pointer may not be accurate while the device is running. This limitation is highlighted in grey:
Also, the “Real Time Expressions” view is not currently available for the E200 architecture, nor for Multi-Core debugging. Currently it is only available for Cortex-M devices such as NXP's Kinetis and LPC.
For those debugging instances where it is not ideal to halt the target, the ability to view variable values while the target is running can be very useful. The “Real Time Expressions” view can be used to track down the types of bugs that show up only when the target is running.