title: What useful GDB scripts have you used/written?
body: <p>People use <a href="http://www.gnu.org/software/gdb/" rel="noreferrer">gdb</a> on and off for debugging, 
  of course there are lots of other debugging tools 
  across the varied OSes, <a href="http://en.wikipedia.org/wiki/Category:Debuggers" rel="noreferrer">with and without GUI and, 
  maybe other fancy IDE features</a>.</p>
  
  <p>I would like to know <b><a href="http://sourceware.org/gdb/current/onlinedocs/gdb_22.html#SEC240" rel="noreferrer">what useful gdb scripts you have written and liked</a></b>.<br>
  While, I do not mean a dump of commands in a <code>something.gdb</code> file that you source to pull out a bunch of data, if that made your day, go ahead and talk about it.</p>
  
  <ul>
  <li>Lets think <em>conditional processing</em>, <em>control loops</em> and <em>functions</em> written for more elegant and refined programming to debug and, maybe even for whitebox testing</li>
  <li>Things get interesting when you start <a href="http://en.wikipedia.org/wiki/GNU_Debugger#Remote_debugging" rel="noreferrer">debugging remote systems</a> (say, over a serial/ethernet interface)</li>
  <li>And, what if the target is a multi-processor (and, multithreaded) system</li>
  </ul>
  
  <p>Let me put a simple case as an example...<br>
  Say, </p>
  
  <blockquote>
    <p>A script that traversed serially over entries<br>
    to locate a bad entry in a large hash-table<br>
    that is implemented on an embedded platform.  </p>
  </blockquote>
  
  <p>That helped me debug a broken hash-table once.</p>