title: How to determine the Stack space after overwriting the EIP
body: <p>I am learning Stack Based Buffer overflow on the x86 Linux.
  How to count the size of the stack space after overwriting the EIP in GDB with some value?</p>
  <pre><code>(gdb) info registers
  eax            0x1  1
  ecx            0xffffd7a0   -10336
  edx            0xffffd17b   -11909
  ebx            0xff5f8948   -10516152
  esp            0xffffd180   0xffffd180
  ebp            0x80ad26dc   0x80ad26dc
  esi            0xf7fc2000   -134471680
  edi            0x0  0
  eip            0x66666666   0x66666666
  eflags         0x10282  [ SF IF RF ]
  cs             0x23 35
  ss             0x2b 43
  ds             0x2b 43
  es             0x2b 43
  fs             0x0  0
  gs             0x63 99
  
  
  (gdb) info frame
  Stack level 0, frame at 0xffffd184:
   eip = 0x66666666; saved eip = 0xffffd300
   called by frame at 0x80ad26e4
   Arglist at 0xffffd17c, args: 
   Locals at 0xffffd17c, Previous frame's sp is 0xffffd184
   Saved registers:
    eip at 0xffffd180
  
  
  (gdb) info stack
  #0  0x66666666 in ?? ()
  #1  0xffffd300 in ?? ()
  Backtrace stopped: previous frame inner to this frame (corrupt stack?)
  </code></pre>
  <p>EDIT: Thanks for the answers, the exact command in GDB giving the right answer for this question is <code>info proc</code></p>
  <p>(gdb) info proc all</p>