how to use gdb to explore the stack/heap?

后端 未结 4 1263
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-04 03:31

Could anyone please give me a quick overview/point me to documentation of a way to inspect the stack (and heap?) of a C program? I thought this should be done with GDB, but if t

4条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-04 04:14

    View stack: gdb> backtrace

    View current stack frame: gdb> info frame

    View arguments of current stack frame: gdb> info args

    View local variable of current stack frame: gdb> info locals

    Navigate to parent stack frame: gdb> frame 1

    Examining the Stack

提交回复
热议问题