Sun Studio 12 Update 1: Debugging a Program With dbx

display Command

In native mode, the display command reevaluates and prints expressions at every stopping point. In Java mode, the display command evaluates and prints expressions, local variables, or parameters at every stopping point. Object references are expanded to one level and arrays are printed itemwise.

The expression is parsed the current scope at the time you type the command, and reevaluated at every stopping point. Because the expression is parsed at entry time, the correctness of the expression can be immediately verified.

If you are running dbx in the IDE in the Sun Studio 12 release or the Sun Studio 12 Update 1 release, the display expression command effectively behaves like a watch $(which expression) command.

Native Mode Syntax

display

Print the list of expressions being displayed.

display expression, ...

Display the value of expressions expression, ... at every stopping point.

display [-r|+r|-d|+d|-p|+p|-L|-fformat|-Fformat|--] expression, ...

See print Command for the meaning of these flags.

where:

expression is a valid expression.

format is the output format you want used to print the expression. For information on valid formats, see print Command.

Java Mode Syntax

display

Print the list of variables and parameters being displayed.

display expression|identifier, ...

Display the value of variables and parameters of identifier, ... at every stopping point.

display [-r|+r|-d|+d|-p|+p|-fformat|-Fformat|-Fformat|--] expression|identifier, ...

See print Command for the meaning of these flags.

where:

class_name is the name of a Java class, using either the package path (using period (.) as a qualifier; for example, test1.extra.T1.Inner) or the full path name (preceded by a pound sign (#) and using slash (/) and dollar sign ($) as qualifiers; for example, #test1/extra/T1$Inner). Enclose class_name in quotation marks if you use the $ qualifier.

expression is a valid Java expression.

field_name is the name of a field in the class.

format is the output format you want used to print the expression. For information on valid formats, see print Command.

identifier is a local variable or parameter, including this, the current class instance variable (object_name.field_name) or a class (static) variable (class_name.field_name).

object_name is the name of a Java object.