为什么可以’;我在崩溃/异常后运行Xcode调试器突出显示调用堆栈吗?

为什么可以’;我在崩溃/异常后运行Xcode调试器突出显示调用堆栈吗?,xcode,debugging,Xcode,Debugging,因此,在开发时,我在iPhone模拟器中运行应用程序时会崩溃。在控制台里说这样的话 2010-08-01 19:28:04.228 FakeCreme[32888:207] adding bucket: (null) 2010-08-01 19:28:04.230 FakeCreme[32888:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSMut

因此,在开发时,我在iPhone模拟器中运行应用程序时会崩溃。在控制台里说这样的话

2010-08-01 19:28:04.228 FakeCreme[32888:207] adding bucket: (null)
2010-08-01 19:28:04.230 FakeCreme[32888:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSMutableArray insertObject:atIndex:]: attempt to insert nil object at 0'
*** Call stack at first throw:
(
    0   CoreFoundation                      0x02641919 __exceptionPreprocess + 185
    1   libobjc.A.dylib                     0x0278f5de objc_exception_throw + 47
    2   CoreFoundation                      0x0263b571 -[__NSArrayM insertObject:atIndex:] + 225
    3   CoreFoundation                      0x026369c4 -[__NSArrayM addObject:] + 68
    4   FakeCreme                           0x0000b645 -[BucketsTable didReceiveEvents:withVerb:forDomain:] + 557
    5   FakeCreme                           0x0002e2fa -[EventManager addObject:withVerb:inDomain:] + 3206
    6   FakeCreme                           0x0000a7a8 -[BucketsTable viewDidLoad] + 1389
    7   UIKit                               0x003cac26 -[UIViewController view] + 179
    8   UIKit                               0x003c9050 -[UIViewController contentScrollView] + 42
    9   UIKit                               0x003d8df7 -[UINavigationController _computeAndApplyScrollContentInsetDeltaForViewController:] + 48
    10  UIKit                               0x003d74ff -[UINavigationController _layoutViewController:] + 43
    11  UIKit                               0x003d8789 -[UINavigationController _startTransition:fromViewController:toViewController:] + 524
    12  UIKit                               0x003d3329 -[UINavigationController _startDeferredTransitionIfNeeded] + 266
    13  UIKit                               0x004ee209 -[UILayoutContainerView layoutSubviews] + 226
    14  QuartzCore                          0x040e50d5 -[CALayer layoutSublayers] + 177
    15  QuartzCore                          0x040e4e05 CALayerLayoutIfNeeded + 220
    16  QuartzCore                          0x040e464c _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 302
    17  QuartzCore                          0x040e42b0 _ZN2CA11Transaction6commitEv + 292
    18  UIKit                               0x0032563f -[UIApplication _reportAppLaunchFinished] + 39
    19  UIKit                               0x00325a68 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 545
    20  UIKit                               0x0032f452 -[UIApplication handleEvent:withNewEvent:] + 1958
    21  UIKit                               0x00328074 -[UIApplication sendEvent:] + 71
    22  UIKit                               0x0032cac4 _UIApplicationHandleEvent + 7495
    23  GraphicsServices                    0x02cbbafa PurpleEventCallback + 1578
    24  CoreFoundation                      0x02622dc4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
    25  CoreFoundation                      0x02583737 __CFRunLoopDoSource1 + 215
    26  CoreFoundation                      0x025809c3 __CFRunLoopRun + 979
    27  CoreFoundation                      0x02580280 CFRunLoopRunSpecific + 208
    28  CoreFoundation                      0x025801a1 CFRunLoopRunInMode + 97
    29  UIKit                               0x00325226 -[UIApplication _run] + 625
    30  UIKit                               0x00330b58 UIApplicationMain + 1160
    31  FakeCreme                           0x000025a0 main + 102
    32  FakeCreme                           0x00002531 start + 53
    33  ???                                 0x00000001 0x0 + 1
)
terminate called after throwing an instance of 'NSException'
(车祸的细节无关紧要,只是一个例子。)

现在,以前的情况是,当我遇到这样的崩溃时,我可以运行Xcode调试器并在那里方便地加载调用跟踪,这样调试器就可以加载调用堆栈,并且我可以交互式地导航当时调用的方法

但自从安装Xcode 3.2.3和/或交换计算机后,这就不起作用了。我在应用程序停止时加载调试器,但调试器是空的,没有调用堆栈


我肯定有一个Xcode设置我在什么地方错过了,但我自己没有找到任何东西快速浏览设置。此时,我需要做什么才能将调用堆栈加载到调试器中?

有时,由于某种原因,XCode调试器会停在一个它根本无法拾取调试值的地方。我在尝试停止调用动画时看到过。没有一个设置可以真正修复此问题(尽管您应该检查您是否在Debugn中运行,而不是在Release中运行,并且调试符号生成仍然在项目设置中检查)

您可以尝试在XCode 4中使用LLVM调试器


但是,为了解决您的特殊问题,很明显您正在尝试在+didReceiveEvents:WithVerb:ForDomain:in BucketsTable中将一个对象插入到数组中,在该数组中,您在数组中最后一个元素之后插入的点太远了。您可以使用索引和对象值在任何数组插入周围尝试NSLog。

是的,对于这个特殊问题,我可以使用console轻松解决,我的问题更一般,有一段时间没有看到调试器让我调试崩溃。@Jaanus不幸的是,LLVM调试器不可用于iOS调试:很抱歉-它以前在早期的Beta中。