title: Pretty-printing with gdb/Python, and type conversion
body: <p>I have a C++ object that contains some binary representation of some data (think of a binary JSON format). I would like to pretty print it using gdb.</p>
  
  <pre><code>class Info {
   private:
    unsigned char* p_
  
   ...
  }
  </code></pre>
  
  <p>As a consequence, I would like to display the next 8 bytes pointed to by the pointer <code>p_</code> as a <code>double</code> or the next 4 bytes as an <code>int</code>. How can I do that? I am looking on what to do in the following Python code whew I placed the <code>...</code>.</p>
  
  <pre><code>def children(self):
      pointer = self.val['p_']
      ...
      yield string, value
  </code></pre>