| |||
| Home > RealView Debugger Commands > Alphabetical command reference > PRINTVALUE | |||
Displays the value of a variable or expression.
PRINTVALUE [{/H|/MB|/R|/S|/T}]
{expression | expression_range}
where:
/TDisplays the value in decimal format.
/HDisplays the value in hexadecimal format.
/MBDisplays multibyte characters using the current encoding, for example UTF-8. You must use the GUI to set up the character encoding.
/RSuppresses the display of the address when you specify a variable in an image.
/SSuppresses the display of characters in the string, but displays the character pointer.
expressionSpecifies an expression to be displayed. If you are using the GUI, then the expression is displayed in the Output view.
expression_rangeSpecifies an expression range to be displayed. If you are using the GUI, the expressions range is displayed in the Output view.
The PRINTVALUE command prints to the screen the value of a variable or expression using its natural type for formatting. It can display all of aggregate types, such as structures, and expressions can be type cast to display it in a different format. All values that make up a complex type are printed. If you are using the GUI, then they are displayed in the Output view.
Each value within an expression_range is
displayed according to the base type if one exists. All expressions
printed with this command are displayed according to their type. If
the type of the expression is unknown, it defaults to type byte.
The PRINTVALUE command runs synchronously unless access to target memory is required and background access is not possible. Use the WAIT command to force it to run synchronously.
The following messages can be displayed by the PRINTVALUE command:
<ENUM: xx>Invalid enum value, xx = value.
<INFINITY>Floating-point value is infinity.
<NAN>Not a number. A floating-point error.
The following examples show how to use PRINTVALUE:
printvalue /mb pchUTF8Prints the multibyte character variable pchUTF8,
encoded in UTF-8, as multibyte characters. Without the /mb switch
the characters are displayed as escaped characters.
printvalue *Ptr_GlobThe command can be used to print the full contents
of a record, for example this instance from a run of dhrystone:
printv *Ptr_Glob
0x00011540 = {Ptr_Comp=(record *)0x00011508,Discr=Ident_1,variant={var_1=
{Enum_Comp=Ident_3,Int_Comp=17,Str_Comp="DHRYSTONE PROG
RAM, SOME STRING"},var_2={E_Comp_2=Ident_3,Str_2_Comp="C
\x02\xC7\x11"},var_3={Ch_1_Comp='\x02',Ch_2_Comp='C'}}}
For the same expression, CEXPRESSION prints the address, not the full value:
> ce *Ptr_Glob Result is: data address 0x00011540
p Ptr_GlobPrinting the value of the pointer tells you the address of the pointer, its type and the value stored there:
0x0000EBBC = (record *)0x00011540
For the same expression, CEXPRESSION prints the value of the pointer, but not its type and address:
> ce Ptr_Glob Result is: data address 0x00011540
the following in the RealView Debugger Essentials Guide: