问题描述:

I am looking for a program to observe the execution stack of a c/c++ program. Currently I am using gdb for this purpose.

The following command shows the content of the stack:

x/12xg $rsp

to execute instruction after instruction I am using

stepi

Is it possible to combine these to commands so that I would be able to stept through the assembly code and observing the stack? If you have another possible solution/program I am looking forward to hear that as well.

网友答案:

You can combine commands using define, like:

(gdb) define mystep
> stepi
> x/whatever $rsp
> end

Now mystep should step and then dump some memory.

相关阅读:
Top