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.

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章