2.3.99. PRINTVALUE

Displays the value of a variable or expression.

Syntax

PRINTVALUE [{/H|/MB|/R|/S|/T}] {expression | expression_range}

where:

/T

Displays the value in decimal format.

/H

Displays the value in hexadecimal format.

/MB

Displays multibyte characters using the current encoding, for example UTF-8. You must use the GUI to set up the character encoding.

/R

Suppresses the display of the address when you specify a variable in an image.

/S

Suppresses the display of characters in the string, but displays the character pointer.

expression

Specifies an expression to be displayed. If you are using the GUI, then the expression is displayed in the Output view.

expression_range

Specifies an expression range to be displayed. If you are using the GUI, the expressions range is displayed in the Output view.

Description

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.

Examples

The following examples show how to use PRINTVALUE:

printvalue /mb pchUTF8

Prints 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_Glob

The 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'}}}

Note

For the same expression, CEXPRESSION prints the address, not the full value:

> ce *Ptr_Glob 
  Result is: data address 0x00011540
p Ptr_Glob

Printing the value of the pointer tells you the address of the pointer, its type and the value stored there:

0x0000EBBC = (record *)0x00011540

Note

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

See also

Copyright © 2002-2011 ARM. All rights reserved.ARM DUI 0175N
Non-ConfidentialID052111