how to use gdb to explore the stack/heap?

后端 未结 4 1208
佛祖请我去吃肉
佛祖请我去吃肉 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 03:54

    Try using ffffd. ffffd manual

    Ok. Maybe I elaborate a little. I use it like this.

    compile my program with debug symbols:

    gcc -g program.c -o program
    

    run ffffd:

    ffffd program
    

    In gui you can do all sorts of things, view machine code, view memory, etc. . Look around. In manual there is also a section of examining stack. ffffd provides good interface for you to examine C program.

提交回复
热议问题