2.3.65. FILL

Fills a memory block with values.

Syntax

FILL [{/8|/16|/32}] [/NW] addressrange ={expression | expressionlist}

where:

/8

Sets the access size to 8 bits.

/16

Sets the access size to 16 bits.

/32

Sets the access size to 32 bits.

Note

If no access size is specified, the default is the native format for the debug target. For example, the ARM7TDMI processor naturally addresses 8 bits.

/NW

Suppresses the warning prompt when filling a large area of memory.

addressrange

Specifies the range of addresses that identify the memory contents to be filled with the pattern. The start and the end of the range is included in the range, which is never to be exceeded. For example a byte fill from 0x400..0x500 writes to 0x400 and to 0x500.

expression

An expression to be evaluated to a value and used to fill memory. The expression can be:

  • a decimal or hexadecimal number

  • a debugger expression, for example a math calculation

  • a string enclosed in single or double quotation marks.

If you use a quoted string:

  • each character of the string is treated as a byte value in an expressionlist

  • no C-style zero terminator byte is written to memory.

Also, see Rules for specifying strings in the FILL command for more details on using strings with the FILL command.

expressionlist

Specifies the pattern used to fill memory. An expressionlist is a sequence of expressions separated by commas, for example "Test",0,0x20.

Note

All expressions in an expression string are padded or truncated to the size specified by the size qualifiers if they do not fit the specified size evenly. This also applies to each character of a string.

Description

The FILL command fills a memory block with values obtained from evaluating an expression or list of expressions. The size qualifier is used to determine the size of each element of expressionlist.

Considerations when using the FILL command

Be aware of the following when using the FILL command:

  • 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 length of the expression list 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. The specified address range is never exceeded.

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

  • If you specify only a start address, one copy of the expression is written, taking up only as many bytes as required for the expression.

  • If you specify an address range with equal start and end addresses, the memory at that address is modified, taking up only as many bytes as required for the expression. If an expression is not specified, the debugger acts as if =0 had been specified as the expression.

  • The FILL command runs synchronously unless background access to target memory is supported. Use the WAIT command to force it to run synchronously.

Rules for specifying strings in the FILL command

Follow these rules when specifying a string:

  • 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 write a NUL character.

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

Examples

The following examples show how to use FILL:

fill 0x1000..0x1005="hello",0

Writes hello with a zero termination in the locations 0x1000...0x1005.

fill 0x1000..0x1001="hello"

Writes h in the location 0x1000 and e in the location 0x1001.

fill 0x1000..0x1013

Writes as bytes the value 0 to locations 0x1000...0x1013.

fill /16 0x1000..0x1014

Writes the 16-bit value 0 to locations 0x1000...0x1014.

fill 0x1000..0x1013="hello"

Writes hellohellohellohello in the locations 0x1000...0x1013.

fill /32 0x2032..0x2053=0xDEADC0DE

For a little-endian memory system, writes 0xDE to 0x2032, 0xC0 to 0x2033, 0xAD to 0x2034, 0xDE to 0x2035 and on to: 0xDE to 0x2052, and 0xC0 to 0x2053.

fill 0x3000..0x4756 =0xEA000000/2

Writes 0x00 to 0x3000..0x4756. The value of 0xEA000000/2 is calculated as 0x75000000. Because fill defaults to a byte expression width, this is then truncated to 0x00 and written.

fill /32 0x3000..0x4758 =0xEA000000

Writes 0xEA000000 to 0x3000..0x4756, 0xEA to 0x4757, and 0x00 to 0x4758, so truncating the last two bytes of the data.

See also

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