4.11.5. Displaying variables

To display the value of a variable from your source code:

  1. Connect to your debug target, if it is not already connected (see Connecting to your target).

  2. Load the dhrystone.axf image as described in Loading an image ready for debugging. The source file dhry_1.c is loaded into the File Editor pane. If line numbers are not visible for your source, display them as described in Displaying line numbers.

  3. Click the Go button on the toolbar to execute the image.

  4. Enter the require number of runs, for example 50000.

  5. Select the required variable in the current context, for example click on the file tab for the source file dhry_1.c and move to line 301. Highlight the variable Ptr_Glob in the expression:

    structassign (*Ptr_Val_Par->Ptr_Comp, *Ptr_Glob);
    
  6. Right-click to display the Source Variable Name menu, shown in Figure 4.1.

    Figure 4.1. Source Variable Name menu

    Source Variable Name menu
  7. Select Print to view the value of the chosen variable in the current context. This is displayed in the Cmd tab of the Output pane.

  8. Select View Memory At Value to display the memory view at this location.

Copyright © 2005, 2006 ARM Limited. All rights reserved.ARM DUI 0276B
Non-Confidential