title: gdb: see unused struct typedef
body: <p>I am having trouble seeing all the typedefs of a struct I defined. In particular, if a typedef is not used, gdb does not show it when the type is printed. Here's an example:</p>
  
  <pre><code>struct D
  {
    typedef double dtype;
    typedef int itype;
  };
  
  int main(int /*argc*/, char** /*argv*/)
  {
    D::dtype t;
  
    t = 2;
    return 0;
  }
  </code></pre>
  
  <p>When I run gdb, I then type <code>ptype D</code>, but I get only the following</p>
  
  <pre><code>(gdb) ptype D
  type = struct D {
      typedef double dtype;
  }
  (gdb) 
  </code></pre>
  
  <p>Is there a way to print all the typedefs even if they are not used?
  Miscellaneous info:</p>
  
  <ol>
  <li>I have <code>set print type typedefs on</code></li>
  <li>I compiled with debug symbols: <code>g++ -g -o test main.cpp</code></li>
  <li>gdb version is 7.10</li>
  <li>gcc version is 5.3</li>
  </ol>