www.delorie.com/djgpp/v2faq/faq12_9.html   search  
Node:Complex vars, Next:, Previous:Bool vars, Up:Debugging

12.9 Debugging the complex data type

Q: I cannot display in GDB the values of my variables of type __complex__....

A: Current versions of GDB don't support __complex__ variables. A work-around is to manually cast them to a pair of numbers. For example, to access the real and imaginary part of a variable foo declared __complex__ double, do this:

 (gdb) print *(double *)&foo
 $1 = 4
 (gdb) print *((double *)&foo + 1)
 $2 = 6



  webmaster   donations   bookstore     delorie software   privacy  
  Copyright 2001   by Eli Zaretskii     Updated Apr 2001