c - How to read local variables with gdb? -
i know can find parameters looking @ positive offset $ebp using gdb:
(gdb) x/4wx $ebp
then, @ 3rd , 4th addresses using x/s
because first , second parameter. local variables? how @ values @ negative offset $ebp? also, there anyway @ value of $eax? whenever try print value of $eax using x/s $eax
, address out of bound or value 0, sure not because put constant value in register.
i tried info locals
message "no symbol table info available".
first need compile debugging symbols binary. use -g option on gcc current command this. if you're using different compiler need consult documentation. after this, 'info locals' , print command work.
to @ local variable need use 'print' command. example @ local variable 'i' it's easy 'print i'.
you should able handle $eax in same way $ebp. suspect have problems because you're using x/s. x/s try , print out string, , continue until hits null character. if doesn't happen long time length of string go out of bounds. try 'x/d $eax'. can 'print $eax'. can use 'info registers' register data.
Comments
Post a Comment