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