HP (Hewlett-Packard) IA-64 Computer Accessories User Manual


 
Copyright © 2000 Hewlett-Packard Co. Debugging 8-1
Ski IA-64 Simulator Reference Manual 1.0L
8 Debugging
The simulator provides many facilities to help you debug your programs. You can modify the current state of the simu-
lated processor, set program breakpoints, trace program execution, and dump a memory image into a file.
8.1 Changing Registers and Memory with Assignment Commands
Use the = command to assign a value to a register. The = command takes two arguments: the first is the name of a register
and the second is the value to be assigned.
To change the contents of memory, you use one of five different commands, depending on whether you want to set a byte,
two bytes, four bytes, eight bytes, or a C-language string (a sequence of bytes terminated by a byte with the value zero, the
“null” byte). The commands are =1, =2, =4, =8, and =s respectively. Each command takes at least two arguments (some
take more): an address or symbol or expression resolving to an address, and the new value you want placed there.
8.1.1 Summary of Assignment Commands
= register_name value
The value is assigned to the register specified by register_name. The old value is lost. Unless a modifying prefix such as
0d, 0b,or0o is used, value will be treated as a hexadecimal number. Floating point registers must be set piecewise, using
the register name (f2 through f127) followed by a .s to set the sign, .m to set the mantissa, or .e to set the exponent. The
first general register, r0, is “hardwired” to 0 and any attempt to assign to it will be rejected. Similarly, floating registers f0
and f1 are “hardwired” to be 0.0 and 1.0, respectively, and predicate register p0 is “hardwired” to 1 and they too cannot be
changed. Some IA-64 registers are read-only according to the IA-64 architecture specification, but all non-hardwired reg-
isters are writable with Ski’s = command to assist your debugging.
=1 address value+
=2 address value+
=4 address value+
=8 address value+
The value is assigned to the specified location in memory. The old value at the location is lost. The location may be on
any allocated page, including instruction pages, as discussed in Section 8.1.3.3, “Page Allocation”. Multiple values,
separated by spaces, may be supplied; if so, they will be assigned to sequential memory addresses. Unless a
modifying prefix such as 0d, 0b, or 0o is used, value will be treated as a hexadecimal number.
The =1 command truncates any extra high-order bytes of the value to make a single byte. The =2 command truncates
or pads (with zero) the high order bytes of the value as necessary to make a two-byte quantity. Similarly, the =4 and
=8 commands truncate or pad high order bytes to make four- and eight-byte quantities, respectively.
The =2, =4, and =8 commands respect the current value of the psr.be bit, which controls whether multi-byte data
memory references are big-endian (if the bit is set) or little-endian (if the bit is clear). The bit also controls the format
of data display in the Data Window (see Section 3.6, “The Data Window”). You can set the psr.be bit with the
command “= psr.be 1” and you can clear it with “= psr.be 0”.
Ski supports physical and virtual addressing. For more information, see Section 4.4.1.3, “Addresses”.
=s address string_without_spaces+
The string_without_spaces is assigned to memory locations starting at the location specified by address. A null byte
is added to the end of the string automatically. The old value at the location is lost. The location may be on any
allocated page, including instruction pages, as discussed in Section 8.1.3.3, “Page Allocation”. Multiple values may
be supplied, separated by a space. The strings may not contain spaces and quoting it is not a workaround.
8.1.2 Examples of Assignment Commands
= r1 1234