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?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
For the current stack frame:
- 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
回答2:
You can view the contents of the stack with x/10x $sp
This will print the top 10 elements of the stack.
回答3:
bt
(orbacktrace
) will give you a call stack.frame <args>
will give you information about a specific frame from the stack.info locals
can give you information about any local variables on the stack.