title: How to read local variables with gdb?
body: <p>I know that you can find any parameters by looking at a positive offset from $ebp using gdb:</p>
  
  <pre><code>(gdb) x/4wx $ebp
  </code></pre>
  
  <p>Then, I would look at the 3rd and 4th addresses using <code>x/s</code> because they would be the first and second parameter. What about for local variables? How would I look at the values at a negative offset from $ebp?
  Also, is there anyway to look at the value of $eax?
  Whenever I try to print the value of $eax using <code>x/s $eax</code>, the address is out of bound or the value is 0, which I am sure that it is not because I just put a constant value in the register.</p>
  
  <p>I tried <code>info locals</code> but I get the message "No symbol table info available".</p>