| |||
| Home > armsd > Working with armsd > Alphabetical list of armsd commands > let | |||
The let command enables you to change the
value of a variable or contents of a memory location.
The syntax of the let command is:
{let} { variable | location}
= expression{{,} expression}*
where:
variableNames the variable to change.
locationNames the memory location to change.
expressionContains the expression or expressions.
You use the let command in low-level debugging
to change memory. If the left-side expression is a constant or a
true expression (and not a variable), it is treated as a word address,
and memory at that location (and if necessary the following locations)
is changed to the values in the following expression(s).
An equals sign (=) or a colon (:) can separate the variable or location from the expression. If you specify multiple expressions, separate them by commas or spaces.
Variables can only be changed to compatible types of expression. However, the debugger converts integers to floating-point and vice versa, rounding to zero. The value of an array can be changed, but not its address, because array names are constants. If the subscript is omitted, it defaults to zero.
If you specify multiple expressions, each expression is assigned
to variable[n-1], where is
the nth expression.n
See also let for
more information on the let command.
You can use the variable $sourcedir to
specify alternative search paths for source files for the image
currently loaded. This variable defaults to NULL if no alternative directories
are specified. You can set the value of $sourcedir using
the command:
{let} $sourcedir = string
where must
be a valid pathname, or pathnames. The string must be enclosed in double
quotes. If you are using armsd in a Windows DOS environment you
must escape the backslash directory separator with another backslash
character.string
For example:
let $sourcedir="c:\\myhome"
Multiple paths must be separated by a semicolon. For example:
ARMSD: let $sourcedir = "/home/usr/me/src;/home/usr/me/src2"
ARMSD: p $sourcedir
"/home/usr/me/src;/home/usr/me/src2"
ARMSD: let $sourcedir = "/home/usr 2/her name/proj B files"
No warning is displayed if you enter an invalid pathname.
You can specify command-line arguments for the debuggee using
the let command with the root-level variable $cmdline.
The syntax is:
{let} $cmdline = string
The program name is automatically passed as the first argument,
so you must not include it in the string. You can examine the setting
of $cmdline using print. Commands that
use the program name are:
goStarts execution of the program.
getfileReads the contents of an area of memory from a file.
loadLoads an image for debugging.
putfileWrites the contents of an area of memory to a file.
reloadReloads the object file specified on the armsd command line, or the last load command.
typeTypes the contents of a source file, or any text file, between a specified pair of line numbers.
When you specify a write to memory in armsd, a word value is used. For example:
let 0x8000 = 0x01
makes armsd transfer a word (4 bytes) to memory starting at
the address 0x8000. The bytes at 0x8001, 0x8002,
and 0x8003 are zeroed.
To write only a single byte, you must indicate that a byte transfer is required. You can do this with:
let *(char *)0xaddress = value
Similarly, to read from an address use:
print *(char *)0xaddress
You can also read and write halfwords (shorts) in a similar way:
let *(short *)0x8000 = valueprint /%x *(short *)0x8000
where /%x displays in hex.