title: GDB: Listing all mapped memory regions for a crashed process
body: <p>I've got a full-heap core dump from a dead process on an x86 Linux machine (kernel 2.6.35-22 if it matters), which I'm attempting to debug in GDB. </p>
  
  <p>Is there a GDB command I can use that means "show me a list of all the memory address regions allocated by this process?" In other words, can I figure out what all the possible valid memory addresses are that I can examine in this dump?</p>
  
  <p>The reason I ask is that I need to search across the <em>entire process heap</em> for a certain binary string, and in order to use the <code>find</code> command, I need to have a start and end address. Simply searching from 0x00 to 0xff.. doesn't work because <code>find</code> halts as soon as it encounters an address it can't access:</p>
  
  <blockquote>
    <p>(gdb) find /w 0x10000000, 0xff000000,
    0x12345678 </p>
    
    <p>warning: Unable to access target memory at 0x105ef883, halting
    search.</p>
  </blockquote>
  
  <p>So I need to get a list of all the readable address regions in memory so I can search them one at a time.</p>
  
  <p>(The reason I need to do <em>that</em> is I need to find all the structs in memory that point <em>at</em> a certain address.)</p>
  
  <p>None of <code>show mem</code>, <code>show proc</code>, <code>info mem</code>, <code>info proc</code> seem to do what I need.</p>