Debugging with GDB Manual HP WDB v6.3 (5900-2180, August 2012)

14.24.3 Evaluating Decimal Floating Point data types
HP WDB versions 5.9 and above enable you to evaluate the decimal floating point variable and
displays the output. Use the commonly used GDB commands for evaluating and displaying
expressions, such as print to evaluate the decimal floating point variable.
HP WDB supports:
Evaluation of expressions with decimal floating point constants and variables.
Setting or assignment of decimal floating point constant or variable.
Arithmetic operations such as addition, subtraction, multiplication, division, and negation with
decimal floating point constants or variables.
Comparison operations such as ==,!=, >, >=, <, <= with decimal floating point constants or
variables.
Conversion between data types during assignment, arithmetic and comparison operations
and while printing values in specified format.
Assignment of Decimal floating point value to variable:
(gdb) print <variable> = <dfp-const>/<dfp-var>
<dfp-const> = decimal floating point constant
<dfp-var> = decimal floating point variable
This assigns decimal floating point value to the variable according to its data type.
Arithmetic Operations:
(gdb) print a(op1)b
(gdb) print (op2)a
op1 = addition, subtraction, multiplication and division.
op2 = negation
This performs arithmetic operation with decimal floating point data types.
Comparison Operations:
(gdb) p <dfp-val> (op) <dfp-val>
where,
op = ==, !=, >, >=, <, <=
If expression contains comparison operation, then GDB compares the decimal floating point data
types accordingly.
(gdb) p 1.2dd == 1.2dd
(gdb) 2.4
14.24.3.1 Printing type of Decimal Floating Point variable
(gdb) ptype <dfp-const>/<dfp-var>
This prints the type of the Decimal floating point variable or constant.
(gdb) ptype 1.22dd
type = _Decimal64
Conversion of types:
GDB handles conversion of data types during assignment, printing, and arithmetic and comparison
operation.
(gdb) p 1.2df +1.2dd
170 HP-UX Configuration-Specific Information