I am wondering how do I print out data through advanced indexing in GDB? For example, say I want to print out the value at 8(%ebp) to get the first parameter passed into a function. How would I do that? The following command does not seem to work:
p (int)8 ($esp)
I always get this segmentation fault error:
Program received signal SIGSEGV, Segmentation fault. 0x00000008 in ?? () The program being debugged was signaled while in a function called from GDB. GDB remains in the frame where the signal was received. To change this behavior use "set unwindonsignal on". Evaluation of the expression containing the function (at 0x0x8) will be abandoned. When the function is done executing, GDB will silently stop.