1
打印一個Objective-C場在GDB我得到一個分段錯誤,如果我試圖做到以下幾點:分段故障試圖在gdb
print bg->top
代碼看起來有點像這樣:
@interface Sprite : Object
{
@public
int top;
/* Other fields */
}
@end
bg = [Sprite load: "test.png"];
/* GDB is at a breakpoint after the above line */
我得到的消息是:
(gdb) print bg->top
Program received signal SIGSEGV, Segmentation fault.
0x6a7e3048 in libobjc-2!__objc_class_links_resolved() from C:\MinGW\bin\libobjc-2.dll
The program being debugged was signaled while in a function called from GDB.
GDB remains in the frame where the signal was received.
To change this behavior use "set unwindonsignal on".
Evaluation of the expression containing the function
(objc_lookup_class) will be abandoned.
When the function is done executing, GDB will silently stop.
這是爲什麼?
我正在使用GNU Objective-C運行時,而我沒有使用GNUStep。
我使用'雪碧* bg'和我的GDB版本的一些表現是使用MINGW32 windows下7.2。 'Sprite'在主應用程序中實現。 – Justin 2011-04-21 08:43:34
你的應用程序是否使用*任何*靜態庫? – matt 2011-04-21 13:35:08
是 - '-lobjc -lglfw -lSOIL -lopengl32',爲什麼這可能會有所作爲?這發生在所有Objective-C對象上,而不僅僅是'Sprite'。 – Justin 2011-04-22 06:09:23