title: Limit the GDB output length
body: <p>I have a structure that describes a bitmap. It looks like this</p>
  
  <pre><code>struct bitmap {
      int XSize;
      int YSize;
      unsigned char *pData;
  };
  </code></pre>
  
  <p>When an instances of this structure is initialized pData points to thousands of random-like but non-zero bytes. When I print the instance of the structure GDB shows a lot of meaningless bytes. That very time consuming. When the <code>disp</code> of such a variable is active I get the output for each step what delays debugging.</p>
  
  <p>Is there a GDB option that limits the output length?</p>
  
  <p>When the bytes are meaningless I could change the type of <code>pData</code> to <code>void *</code>. But since the structure is used in a precompiled library the type can't be changed. Can the type that GDB uses for <code>print</code> and <code>disp</code> be "overridden"? </p>