memory set

This command writes to memory.

Show/hideSyntax

memory set address width expression

Where:

address

Specifies an address at which to write the first value. The address must be correctly aligned for the type of the specified expression.

width

Specifies the access width (bits) to use when writing to memory. If the width is narrower than the value being written then more than one access is used to write the value. For example:

0

enables the debugger to determine the access width

8

8-bit

16

16-bit

32

32-bit

64

64-bit.

Widths are dependent on the target, address region and address alignment. Some access sizes might not be supported.

expression

Specifies either a single expression or an aggregate of expressions with the same size enclosed in curly braces. If there is more than one expression, then the values are written to memory sequentially with the addresses determined by the width of the type of the values.

Note

This command sets a default address variable to the value of the memory address. Some commands, such as x, use this default value if no address is specified.

Show/hideExample

Example 81. memory set

memory set 0x1000 0 {(char)0x10,(char)0xFF,(char)1,(char)2,(char)3,(char)42}
                             # Is equivalent to the following commands:
                                            # set variable *(char*)0x1000 = (char)0x10
                                            # set variable *(char*)0x1001 = (char)0xFF
                                            # set variable *(char*)0x1002 = (char)1
                                            # set variable *(char*)0x1003 = (char)2
                                            # set variable *(char*)0x1004 = (char)3
                                            # set variable *(char*)0x1005 = (char)42
memory set 0x1008 0 0x1234   # Equivalent to set variable *(int*)0x1008 = 0x1234
memory set 0x1008 8 0x1234   # Same effect but forces use of 4 writes of one byte each

Show/hideSee also

Copyright © 2010, 2011 ARM. All rights reserved.ARM DUI 0452H
Non-ConfidentialID111711