当前位置: 动力学知识库 > 问答 > 编程问答 >

c++ - Link commands in gdb to observe the execution stack

问题描述:

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.

分享给朋友:
您可能感兴趣的文章:
随机阅读: