title: configuring gdb to change the display of objects
body: <p>In GDB, objects typically display with lots of tripe due to included template objects.
  There's a lot of useless std::char_traits ...</p>
  
  <p>Is there a way to filter this stuff out?  Basically, I'd like to know if I can configure .gdbinit to display the text only for a std::string, and perhaps the first few elements for a vector.</p>
  
  <p>Alternatively, is there some sort of macro I can write to let me print out just a particular field of an object instead of writing by hand</p>
  
  <p>For a string, I can write:</p>
  
  <pre><code>p s.c_str()
  </code></pre>
  
  <p>but I'll get a seg fault if it's NULL.<br>
  I'd like enough logic to ignore that but don't know that gdb has any facility for it?</p>