这是一个错误吗?

时间:2009-08-14 23:19:44

标签: objective-c iphone-sdk-3.0 gdb

当我测试我的应用时,控制台会显示:

GNU gdb 6.3.50-20050815 (Apple version gdb-966) (Tue Mar 10 02:43:13 UTC 2009)
Copyright 2004 Free Software Foundation, Inc.  
GDB is free software, covered by the GNU General Public License, and you are  
welcome to change it and/or distribute copies of it under certain conditions.  
Type "show copying" to see the conditions.  
There is absolutely no warranty for GDB.  Type "show warranty" for details.  
This GDB was configured as "i386-apple-darwin".sharedlibrary apply-load-rules all  
Attaching to process 7356.  
(gdb)

模拟器停止运转。

然后......我在控制台中写了“bt”并显示出来:

(gdb) bt
#0  0x937f0688 in objc_msgSend ()
#1  0x30201368 in CFRetain ()
#2  0x30200e75 in CFArrayCreate ()
#3  0x302440a3 in -[__NSPlaceholderArray initWithObjects:count:] ()
#4  0x0036116d in -[CALayerArray copyWithZone:] ()
#5  0x302386aa in -[NSObject copy] ()
#6  0x3091cc24 in -[UIView(Hierarchy) _makeSubtreePerformSelector:withObject:withObject:copySublayers:]
()
#7  0x30920a6a in -[UIView(Hierarchy) removeFromSuperview] ()
#8  0x30926864 in -[UIScrollView removeFromSuperview] ()
#9  0x30975313 in -[UIViewController setView:] ()
#10 0x00005719 in -[VideosTableViewController loadView] (self=0xd47970, _cmd=0x93882dfc) at
/Users/Miriam/Desktop/MyApp/Classes/VideosTableViewController.m:92
#11 0x000039c7 in -[WelcomeViewController stopLoading] (self=0xd1cc50, _cmd=0x9388f10c) at
/Users/Miriam/Desktop/MyApp/Classes/WelcomeViewController.m:156
#12 0x0000ec82 in -[Connection connectionDidFinishLoading:]
(self=0xdaa1e0, _cmd=0x9384e564,
connection=0xda91a0) at
/Users/Miriam/Desktop/MyApp/Classes/Connection.m:94
#13 0x30561dc4 in -[NSURLConnection(NSURLConnectionReallyInternal)
sendDidFinishLoading] ()
#14 0x30561d33 in _NSURLConnectionDidFinishLoading ()
#15 0x00791868 in URLConnectionClient::_clientDidFinishLoading
()
#16 0x007910c8 in URLConnectionClient::ClientConnectionEventQueue::processAllEventsAndConsumePayload
()
#17 0x00791d4c in URLConnectionClient::processEvents ()
#18 0x0073fb29 in MultiplexerSource::perform ()
#19 0x302452c1 in CFRunLoopRunSpecific ()
#20 0x30244628 in CFRunLoopRunInMode ()
#21 0x32044c31 in GSEventRunModal ()
#22 0x32044cf6 in GSEventRun ()
#23 0x309021ee in UIApplicationMain ()
#24 0x0000252c in main (argc=1, argv=0xbfffef24) at
/Users/Miriam/Desktop/MyApp/main.m:14

1 个答案:

答案 0 :(得分:1)

这是因为调试器正在等待您调试代码。 GDB通常会启动您的进程然后停在main(如果您使用调试器启动您的进程)。在您的情况下,通过附加到已经运行的进程,调试器会在您附加时将其停止。你的程序现在停止了。

然后由您决定通知调试器您要继续运行代码(continue)或单步执行(s以进行步入,n执行步骤 - (或)你想做的其他事情。

bt命令(backtrace)只是在附加时为您提供当前的堆栈转储。