8.5.5. Filling memory with a pattern

To fill a specified area of memory a predefined pattern:

  1. Select File → Reload Image to Target to reload the image dhrystone.axf.

  2. Click on the Src tab to view the source file dhry_1.c.

  3. Set a simple breakpoint by double-clicking on line 150.

  4. Click Go to start execution.

  5. Enter 5000 when asked for the number of runs.

    The program starts and then stops when execution reaches the breakpoint at line 150. The red box marks the location of the PC when execution stops.

  6. Select View → Pane Views → Memory to display the Memory pane.

  7. Select Debug → Memory/Register Operations → Fill Memory with Pattern... from the Code window main menu to display the Fill Memory with Pattern dialog box, shown in Figure 8.5.

    Figure 8.5. Fill Memory with Pattern dialog box

    Fill Memory with Pattern dialog box
  8. Set up the required memory settings:

    Start:

    Enter the start address for the memory range to be filled, for example 0x88A0.

    If required, use the drop-down arrow to select a previously used start address from the stored list.

    End/Len:

    By default, the memory area that is filled is defined by a start address and a length. Enter the length of the memory block to be filled in this data field, for example 14 (decimal).

    The specified length must be given relative to the data type given in the Size data field specified below.

    If the Use Length (Count) check box is unselected, you can specify the address that marks the end of the memory block.

    Size:

    Enter the data type to be used in the specified file where:

    • natural indicates the format specified as native for the debug target

    • byte indicates support for 8-bit signed and unsigned byte form

    • half-word indicates support for 16-bit signed and unsigned halfwords

    • long-word indicates support for 32-bit signed and unsigned words.

    Use Length (Count)

    By default, the memory block to be filled is defined by a start address and the length. If this check box is unselected you can specify an address to mark the end of the filled block.

    Pattern:

    Enter the pattern to be used as the fill, for example:

    “AB”

    0,1,0,1,0

    OK

    Click OK to confirm your settings and to close the dialog box.

    Memory contents are rewritten and the Memory pane is automatically updated with changed values displayed in blue.

    Cancel

    Click this button to close the Fill Memory with Pattern dialog box without changing memory contents.

When filling memory blocks, you must be aware that:

Copyright © 2003, 2004 ARM Limited. All rights reserved.ARM DUI 0234B
Non-Confidential