Previous frame inner to this frame (gdb could not unwind past this frame)

-DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_ISOC9X_SOURCE -pipe -force_cpusubtype_ALL -Wno-sign-compare -mdynamic-no-pic -fomit-frame-pointer -g -Wdeclaration-after-statement -Wall -Wno-switch -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wno-pointer-sign -Wcast-qual -Wwrite-strings -O3 -fno-math-errno


可能与gcc 的编译选项有关






Previous frame inner to this frame (gdb could not unwind past this frame)


Error from Debugger: Previous frame inner to this frame (gdb could not unwind past this frame)

How can I debug that? and how can I get the call stack? GDB doesn't show me where it crash and from which call in my code. Only if I step through I can see where it pop but that extremely slow to debug like that... please help

Tks in advance,

If it's i386, do you have symbols for the functions you're stepping around, 

or have you stripped(vt. 脱衣, 被剥去, 剥夺, 拆卸) the symbols from your binaries (e.g. people often strip almost all the symbols from a plugin).

gdb inspects(vt.检阅; 检查; 审查; 视察; 探伤; 试验) the prologue(n.序言, 开场白序幕) of functions on i386 to determine how the stack is being used to backtrace(计】 回溯); 
if it can't find the starting address of the function it has to make a guess about how to backtrace out. And that guess is not always correct.


Optimizer bug? Try compiling the file manually and twiddling the 
compiler flags (e.g. using -O1 instead of -O2, turning off inlining, 
etc). 


函数在函数开始过程中(称为函数序言(function prologue))创建堆栈帧
函数结束时(称为函数尾声(function epilogue))销毁它。


In assembly language programming, the function prologue is a few lines of code which appear at the beginning of a function, which prepare the stack and registersfor use within the function. Similarly, the function epilogue appears at the end of the function, and restores the stack and registers back to the state they were in before the function was called.

The prologue and epilogue are not a part of the assembly language itself - rather, they represent a convention used by assembly language programmers, andcompilers of many higher-level languages. Both of them are fairly rigid, having the same form in each function.




GDB采用的算法不是很复杂,关键在于很容易迷失在具体的细节/特殊情况(和OS面临的处境差不多).

Frame
GDB 为了支持DWARF标准的Call Frame而重新定义了GDB自己的Frame结构.GDB的Frame用于跟踪calling 和called 函数.就是一个调用
栈的back trace过程.GDB 的Frame不仅仅是个call frame,每级frame都包含当前cpu状态的snapshot(或可以取到)(fix me).

sentinel frame:当前指令的frame,调用栈的顶端,level是-1,类型是SENTINEL_FRAME,而当前函数的frame(fix me)其level是0.
unwind操作:取自DWARF标准, frame_register_unwind,就是返回上一级frame.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值