Sun Studio 12 Update 1: Debugging a Program With dbx

Printing the Value of a Variable, Expression, or Identifier

An expression should follow current language syntax, with the exception of the meta syntax that dbx introduces to deal with scope and arrays.

To evaluate a variable or expression in native code, type:


print expression

You can use the print command to evaluate an expression, local variable, or parameter in Java code.

For more information, see print Command.


Note –

dbx supports the C++ dynamic_cast and typeid operators. When evaluating expressions with these two operators, dbx makes calls to certain rtti functions made available by the compiler. If the source doesn’t explicitly use the operators, those functions might not have been generated by the compiler, and dbx fails to evaluate the expression.