(gdb)5. 栈►-stack-info-frame尚没实现►-stack-info-depth用法:-stack-info-depth [ max-depth ]语义:显示栈深度,如果指定了max-depth,超过max-depth的帧不会被计算►-stack-list-arguments用法:-stack-list-arguments show-values [ low-frame high-frame ]语义:显示帧参数,show-values为0只显示参数...
=0x7fffffffe2fc) at gdb_example.c:17 #2 0x0000555555554841 in main () at gdb_example.c:28 #只显示前2个栈帧 (gdb) bt 2 #0 minus (a=3, b=2) at gdb_example.c:4 #1 0x00005555555547c0 in print (xx=10, xxptr=0x7fffffffe2fc) at gdb_example.c:17 (More stack frames follow....
info args -- Argument variables of current stack frame l -- List specified function or line list -- List specified function or line r -- Start debugged program run -- Start debugged program set args -- Set argument list to give program being debugged when it is started show args -- ...
bt指令可以打印出当前的调用堆栈, 在前面的操作中我们都有演示。 调用堆栈由连续的堆栈帧(stack frames)组成,每一帧(frame)对应一个函数调用,每一帧都包含了参数信息(args), 局部变量信息(locals), 寄存器信息(registers)和函数执行时的地址。 gdb使用一个数值来标识堆栈帧的层级,最后被调用到函数为0,往上值递增。
-stack-list-frames Context:This command is used by VisualGDB to query the current call stack (i.e. the function calling the current function and so on). Cause:Some optimization settings, RTOSes, or corrupt stack may trigger an infinite loop in gdb when unwinding the stack (i.e. determinin...
(More stack frames follow...) # 从外向内显示2个栈帧,及其局部变量 (gdb) bt full -2 #1 0x00005555555547c0 in print (xx=10, xxptr=0x7fffffffe2fc) at gdb_example.c:17 c = 5 d = 21845 #2 0x0000555555554841 in main () at gdb_example.c:28 ...
c:17 (More stack frames follow...) # 从外向内显示2个栈帧,及其局部变量 (gdb) bt full -2 #1 0x00005555555547c0 in print (xx=10, xxptr=0x7fffffffe2fc) at gdb_example.c:17 c = 5 d = 21845 #2 0x0000555555554841 in main () at gdb_example.c:28 x = 10 ptr = 0x7fffffffe2fc...
backtrace命令可以在遇到断点而暂停执行时显示栈帧。该命令简写为bt。此外, backtrace的别名还有where和info stack(简写为info s)。 backtrace bt 显示所有栈帧 backtraceN btN 只显示开头N个栈帧 backtrace-N bt-N 只显示最后N个栈帧 backtracefull btfull ...
files being debugged.infofloat-- Print the status of the floating point unit.info frame-- All about the selected stack frame.info frame-filter-- List all registered Python frame-filters.info functions-- All function names or those matching REGEXPs.info guile-- Prefix command for Guile info ...
使用bt查看当前调用栈信息(call stack,即函数调用层次信息),当前进程的是由main() -> sleep() -> nanosleep() -> __kernel_vsyscall()一层一层调入。注意“#数字”,在GDB中这叫stack frames,或直接称为frame,运行栈由一个或多个连续的frame组成,数字越小代表调用层次越深。