title: Gdb dump memory in specific region, save formatted output into a file
body: <p>I have a buggy (memory leaked) software.
  As an evidence, I have 1GB of core.dump file.  Heap size is 900MB, so obviously, something allocates, but does not free the memory.</p>
  <p>So, I have a memory region to examine like this.</p>
  <pre><code>(gdb) x/50000s 0x200000000
  </code></pre>
  <p>However, this is hard to guess only with naked eyes, which object or struct is not freed.
  My idea to trace is, &quot;Save gdb formatted output into a file, and run a pattern match to see which magic string comes up the most.&quot;  So, here is my question:</p>
  <p>How can I save output of following command into a textfile, so that I can write an analyzer?</p>
  <pre><code>(gdb) x/10000000s 0x20000000    &lt;-- I need this output into a file
  </code></pre>