An expression format exp_format is of the form:
where count is the number of times to apply the format style style, and size indicates the number of bytes to format. Both count and size are optional. For example, print/4d2 fly prints, starting at fly, four 2-byte numbers in decimal. count defaults to one, and size defaults to the size of the type printed.
In addition to a number, size can be specified as one of the following values:
b |
One byte (byte-integer) |
s |
Two bytes (short-integer) |
l (lowercase L) |
Four bytes (long-integer) |
These are appended to style. For example, print/xb fly prints a hex byte. The formats which print numbers allow an uppercase version of the character to be synonymous with appending the letter `l' to lowercase. For example, fly/O prints a long octal, which is the same as typing print/ol fly.
The following values are available for style:
Values for style | |
---|---|
Format | Meaning |
a |
Prints a string using exp as the address of the first byte. This prints to the first null character or 128 characters, whatever happens first. The size value forces printing of a given number of bytes, regardless of the occurrence of null characters. For example, if the string "hello" is at location 0x40a8, then to see the string, enter: print/a *0x40a8 |
b |
Prints exp in decimal as 1 byte. |
c |
Prints exp as a character. |
d |
Prints exp in decimal. |
e |
Converts exp to the style [-]d.ddde+dd where there is one digit before the radix character and the number after is equal to the precision specification given for size. If size is not present, then the system default is used. |
f |
Converts exp to the decimal notation in the style [-]ddd.ddd where the number of d's after the radix character is equal to the precision specification given for size. If size is not present, then the system default is used. If size is explicitly zero, then no digits or radix characters are printed. |
g |
exp prints in style d, in style f, or in style e. The style depends on the converted value. Style e is used only if the exponent resulting from the conversion is less than -4 or greater than the precision given for size. Trailing zeroes are removed from the result. A radix character appears only if followed by a digit. This is the default for floats and doubles. |
i |
Using the exp as an address, disassembles a machine instruction. |
I |
(Uppercase `i') Using the exp as an address, disassembles a machine instruction. If the address maps evenly to a line number in the source, it prints the source line first. This allows you to see what the compiler generated for a line of source. Using the mixed source/assembly mode in the source pane is an easier way to view the same information. However, this command may be useful if you want to save the information to a file. For example: >> tempfile print/200I myfunc >> c This sequence prints the first 200 instructions of the function, myfunc, and saves the output to the file tempfile. See "Record and playback commands". |
n |
Uses the "normal" format based on type. If no format is specified, this is the default. |
o |
Prints exp in octal. |
p |
Prints the name of the procedure containing address exp, along with the filename and the source line or instruction that addresses maps. If size is 1 (print/pb), only the procedure name will be printed. If size is 2 (print/ps), only the filename and procedure name will be printed. |
r |
Prints the bounds of a ranged type or variable of a ranged type such as a C bitfield or an Ada subrange. |
s |
Prints a string using exp as a pointer to the first byte of the string. Same as print /a *exp. |
S |
Creates a formatted dump of a structure. This is the default for items of type struct. |
t |
The debugger shows the "type" of variable or procedure. |
u |
Prints exp in unsigned decimal. |
x |
Prints exp in hexadecimal. |