14.3.3. Filling memory with a pattern

To fill a specified area of memory with a predefined pattern:

  1. Select View → Memory from the Code window main menu to open the Memory view.

  2. Enter 0x88A0 in the Start Address field to view the memory contents at that location.

  3. Right-click on a memory cell in the Memory view to display the context menu.

  4. Select Fill Memory... from the context menu to open the Fill Memory dialog box.

    The fields in the Fill Memory dialog box are populated as follows:

    • the Start address field is set to the last address you entered in the Start address field of the Memory view

    • the value for the End address and Length depend on the option you have selected for Display sizes in the Memory view.

    Figure 14.21 shows an example:

    Figure 14.21. Fill Memory dialog box

    Fill Memory dialog box

  5. Enter the start address of the memory range to be filled in the Start Address: field. For example, enter 0x88A0.

  6. Do one of the following:

    • To specify the memory region as a length (number of locations), select the Length:, and enter the length. For example, enter 14 (decimal).

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

    • To specify the end address of the memory region, select the End Address: check box, and enter the address that marks the end of the memory block.

  7. Select the access size to be used in the Fill Size: field. The options are:

    • default indicates the native format for the debug target

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

    • 16 bits indicates support for 16-bit signed and unsigned halfwords

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

  8. Enter the pattern to be used as the fill in the Expression: field. For example, enter "AB", "String",0, or 0,1,0,1,0.

    Note

    Strings must be enclosed in single or double quotes.

  9. Click OK to confirm your settings and close the Fill Memory dialog box. Memory contents are rewritten and the Memory view is automatically updated with changed values displayed in blue.

Considerations when filling memory with a pattern

When filling memory with a pattern, you must be aware of the following:

  • No C-style zero terminator byte is written to memory after a specified string. To write a NUL-terminated string, add a zero value expression after the string, for example:

    "Test Message",0

  • You cannot use an empty string to add a NUL character.

  • Use the /8 qualifier if you want to write the characters of a string to consecutive bytes.

  • All expressions in an expression string are padded or truncated to the size specified by the Size value if they do not fit the specified size evenly.

  • If the number of values in an expression string is less than the number of bytes in the specified address range, RealView Debugger repeats the pattern to fill the remaining number of blocks specified. For example, if you specify a pattern of 10 bytes and a fill area of 16 bytes, RealView Debugger repeats the pattern to fill the remaining six bytes.

  • If more values are given than can be contained in the specified address range, excess values are ignored.

  • If a pattern is not specified, RealView Debugger displays an error message.

See also

  • the following in the RealView Debugger Command Line Reference Guide:

Copyright © 2002-2011 ARM. All rights reserved.ARM DUI 0153N
Non-ConfidentialID052111