LIVE
News Cnblogs.com

GDB函数调用栈管理 - ttkwzyttk

GDB函数调用栈管理 - ttkwzyttk

一、栈帧 当程序进行函数调用时,系统需要保存该函数调用过程中的上下文信息,例如:函数是从哪里被调用的、传入了哪些参数、局部变量有哪些、函数返回后应该回到哪里继续执行,以及部分寄存器状态等。这些与一次函数调用相关的上下文信息,就可以理解为一个栈帧。 从调试角度看,一个栈帧对应一次尚未结束的函数调用。程

A B B B B B A 1 GDB backtrace bt bt bt 3 3 bt full bt fullbt 2 frame n f n n bt #0 add(int, int) at main.cpp:6 #1 calc(int) at main.cpp:13 #2 work(int) at main.cpp:19 #3 main() at … [+942 chars]

Discussion (0)

No comments yet. Be the first to share your thoughts!

Join the Conversation

You need to be logged in to leave a comment.

Sign In Create Account