title: How do I print the bits of a double in hex, in GDB?
body: <p>I thought it would be <code>p/x</code>, but it gives strange results. Is this a bug or am I doing something wrong?</p>
  
  <pre><code>(gdb) ptype row.DBL_NPIO2.m_value
  type = double
  (gdb) p row.DBL_NPIO2.m_value
  $6 = -1.5707963267948966
  (gdb) p/x row.DBL_NPIO2.m_value
  $7 = 0xffffffffffffffff
  (gdb) print (double)0xffffffffffffffff
  $8 = 1.844674407370955e+19
  </code></pre>
  
  <p>This is on a CentOS5 x86 machine, and I'm debugging C++ code built with gcc 4.4 (unoptimized, w/ -g)</p>
  
  <pre><code>mattheww@SEN-CentOS5: ~$ uname -a
  Linux SEN-CentOS5 2.6.18-238.9.1.el5 #1 SMP Tue Apr 12 18:10:13 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux
  mattheww@SEN-CentOS5: ~$ gdb --version
  GNU gdb (GDB) CentOS (7.0.1-45.el5.centos)
  Copyright (C) 2009 Free Software Foundation, Inc.
  License GPLv3+: GNU GPL version 3 or later &lt;http://gnu.org/licenses/gpl.html&gt;
  This is free software: you are free to change and redistribute it.
  There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
  and "show warranty" for details.
  This GDB was configured as "x86_64-redhat-linux-gnu".
  For bug reporting instructions, please see:
  &lt;http://www.gnu.org/software/gdb/bugs/&gt;.
  </code></pre>