10.12.2. Procedure

To trace data accesses to addresses in an address range:

  1. Remove the tracepoints you set previously:

    1. Right-click on the Load Image+Symbols entry in the Process Control pane to display the context menu.

    2. Select Unload from the context menu. The image is unloaded.

    3. Right-click on the Load Image+Symbols entry in the Process Control pane to display the context menu.

    4. Select Load from the context menu. The image is reloaded and the PC is reset to the image entry point (0x8000). The tracepoints are removed.

  2. Locate the address of input[] in the disassembly view:

    1. Click the Disassembly tab in the Code window to display the disassembly view.

    2. In the Cmd tab of the Output pane, enter the command:

      printsym input

      The details of the symbol input are displayed, which includes the address range for the array:

       @trace\\input       : Global int[16].                          Address = 0x0000A1F0 to 0x0000A22F
      

      The addresses might be different depending on the target you are using.

    3. Right-click on the white background of the Disassembly tab to display the context menu.

    4. Select Locate Address... from the context menu to display the Prompt dialog box.

    5. Enter the start address of the input[] array, 0xA1F0.

    6. Click OK. The dialog box closes, and the disassembly view changes to show the disassembly from the address 0xA1F0. An example is shown in Figure 10.61.

      Figure 10.61. Disassembly view of the input[] array

      Disassembly view of the input[] array
  3. Set a trace range for the range of addresses occupied by the input[] array in the disassembly view:

    1. Select the data values between addresses 0xA1F0 and 0xA22F. All the disassembly between the two addresses is highlighted.

    2. Right-click on the margin of the selected area to display the context menu.

    3. Select Set Trace Range from the context menu. An instruction execution trace range is set between addresses 0xA1F0 and 0xA22F. An example is shown in Figure 10.62.

      Figure 10.62. Trace range set in the disassembly view

      Trace range set in the disassembly view

      RealView Debugger generates a TRACE CLI command, which is also displayed in the Cmd tab of the Output pane:

      trace,range 0x0000A1F0..0x0000A22C

  4. Modify the instruction execution tracepoint to be a data read tracepoint:

    1. Select Break/Tracepoints from the View menu of the Code window to display the Break/Tracepoints pane.

    2. Right-click on the tracepoint in the Break/Tracepoints pane to display the context menu.

    3. Select Edit... from the context menu to display the Set/Edit Tracepoint dialog box.

    4. Select Trace Instr and Data from the tracepoint type drop-down list.

    5. Select Data Read from the tracepoint comparison type drop-down list (that is, the on field).

    6. Change the end of range address to 0x0000a22f.

    7. Click OK. The Set/Edit Tracepoint dialog box closes, and the tracepoint is modified. RealView Debugger generates a TRACEDATAREAD CLI command, which is also displayed in the Cmd tab of the Output pane:

      trcdread,hw_out:"Tracepoint Type=Trace Instr and Data",hw_in:"Size of Data Access=Byte",modify:1 0x0000a1f0..0x0000a22f

  5. Click Run on the Debug toolbar to start execution.

  6. After a short time, click Stop on the Debug toolbar to stop execution. The captured trace is displayed in the Trace tab of the Analysis window. An example is shown in Figure 10.63.

    Figure 10.63. Captured trace of data reads from the input[] array

    Captured trace of data reads from the input[] array
Copyright © 2006, 2007 ARM Limited. All rights reserved.ARM DUI 0322B
Non-Confidential