How can I monitor a variable in the debugger while a target is running?

Using the Live View or Refresh While Running feature of the eclipse based CodeWarrior debugger, you can see how a variable is changing while the target is running.

Figure 1. Refresh While Running

Refresh While Running

Note: For Background Debug Mode (BDM) targets, such as RS08, S08, and ColdFire, the CPU registers cannot be monitored. However, you can use the Refresh While Running feature for anything that is memory mapped.

When you select the feature, a checkmark appears indicating the feature is enabled:

Figure 2. Enable Refresh While Running Feature

Enable Refresh While Running Feature

In order for variables to be refreshed, they need to be Global. Global variables are variables with external scope in C. The module variables or static global variables are not considered as global in the eclipse-based CodeWarrior IDE.

In the Variables view, add the global variables you want to use as the `live view' variables, as shown in the following figure.

Figure 3. Add Global Variables

Add Global Variables

You can configure the refresh rate in the Run > Debug Configurations > Debugger page.

Figure 4. Configure Refresh Rate

Configure Refresh Rate