| |||
| Home > RealView Debugger Commands > Alphabetical command reference > FILL | |||
The FILL command fills a memory block with values.
FILL [/B|/H|/W|/8|/16|/32] addressrange ={expression | expressionlist}
where:
/B, ,
/8Sets the fill size to byte (8 bits).
If the processor naturally addresses bytes (for example, ARM7TDMI) then this is the default setting.
/H, , /16Sets the fill size to halfword (16 bits).
/W, , /32Sets the fill size to word (32 bits).
addressrangeSpecifies the range of addresses whose memory contents are
filled with the pattern. The start and the end of the range is included
in the range. For example a byte fill from 0x400..0x500 writes
to 0x400 and to 0x500.
expressionSpecifies the pattern 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 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.
expressionlistSpecifies the pattern used to fill memory. An expressionlist is
a sequence of values separated by commas, for example:
0x20,0x40,0x20
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.
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
If the number of values in is
less than the number of bytes in the specified address range, the
debugger repeatedly writes the list to memory until all of the designated
memory locations are filled.expressionlist
If more values than can be contained in the specified address
range are given, the last repetition is completed before the process
stops, so up to (length(expressionlist)-1) bytes,
halfwords or words might be written beyond the range end address.
If you specify an address range with equal start and end addresses,
the memory at that address is modified. 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.
The following examples show how to use FILL:
fill 0x1000..0x1004="hello"Writes h,e,l,l,o,
to locations 0x1000...0x1004.
fill 0x1000..0x1001="hello"Writes h,e,l,l,o,
to locations 0x1000...0x1004.
fill 0x1000..0x1013Writes as bytes the value 0 to
locations 0x1000...0x1013.
fill /h 0x1000..0x1014Writes the 16-bit value 0 to
locations 0x1000...0x1014.
fill 0x1000..0x1013="hello"Writes h,e,l,l,o,h,e,l,l,o,...
to locations 0x1000...0x1013.
fill /w 0x2032..0x2053=0xDEADC0DEFor a little-endian memory system, writes 0xDE to 0x2032, 0xC0 to 0x2033, 0xDC to 0x2034 and
on to: 0xDE to 0x2052, 0xC0 to 0x2053.
fill 0x3000..0x4756
=0xEA000000/2Writes 0x00 to 0x3000..0x4576.
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..0x4756
=0xEA000000Writes 1373 ARM processor NOP instructions
to memory, changing locations 0x3000..0x4578,
and so writing 2 bytes more than the specified range.