Operating System - HP-UX
1844036 Members
2333 Online
110226 Solutions
New Discussion

print complex number in xdb

 
Joan Coleman
Occasional Contributor

print complex number in xdb

How do I print a complex (and dcomplex) number in the debugger - I've run out of ideas and can't seem to find it in any manual. Printing consecutive floating point numbers doesn't seem to work. Thanks in advance for any help.
1 REPLY 1
Dennis Handly
Acclaimed Contributor

Re: print complex number in xdb

This works fine in with C99 and gdb on IPF. You can just print the variable. Or you can treat it like an array:
(gdb) p c
$1 = 1 + 1 * _Imaginary_I
(gdb) p *(double*)&c@2
$2 = {1, 1}