如何使用 GDB 检查堆栈帧?堆栈、如何使用、GDB

2023-09-07 03:02:58 作者:喜你入三分

现在我一直在使用 GDB 反汇编二进制文件并检查不同的寄存器等等.是否有一个简单的命令来检查堆栈上的所有内容?这可以仅限于函数中的所有内容吗?

Right now I've been using GDB to disassemble a binary file and check out different registers and whatnot. Is there an easy command to examine everything on the stack? Can this be limited to everything in a function?

推荐答案

对于当前栈帧:

信息框架列出有关框架的一般信息(事物在内存中的起始位置等)info args 列出函数的参数info locals列出存储在框架中的局部变量 info frame lists general info about the frame (where things start in memory, etc.) info args lists arguments to the function info locals lists local variables stored in the frame