title: GDB - Accessing real and imaginary parts of a complex number
body: <p>When debugging a program which uses  (either C or C++), <code>gdb</code> displays complex numbers as <code>_M_value =  xxx + yyy*I</code> (with a type of <code>complex double</code>).</p>
  
  <p>While debugging, I need to print that number multiplied by a factor.</p>
  
  <p>The following <em>does not</em> work:</p>
  
  <pre><code>print a * 8.0
  </code></pre>
  
  <p>I get <code>Argument to arithmetic operation not a number or boolean</code>.</p>
  
  <p>Also, I cannot access the <em>real and imaginary parts</em> so that I can write a gdb macro to do the above. My current solution is to write a C function for manipulating complex values and arrays, and calling that function from gdb. Somehow, this just doesn't feel right.</p>