ios - XCode4 调试器总是在 Main 中中断

标签 ios xcode debugging xcode4 gdb

升级到 XCode4(v.4.2、4D199)后,似乎每次我的应用程序在调试时崩溃,调试指向 main(),并且堆栈未符号化且无用。

多年来一直运行良好,我不知道哪里出了问题。

我正在使用 GDB。我还根据 this advice 尝试了 LLDB ,它也没有用(类似的,无用的堆栈)。

我的断点有效,我得到了完整的堆栈,并且可以在我的代码遇到这些变量时检查变量。

重现步骤:

注意。这发生在我自己的项目中,但我将在此处使用 Apple 的代码从等式中删除该变量

  1. 从 Apple 下载以下样本:https://developer.apple.com/library/ios/#samplecode/UICatalog/Introduction/Intro.html#//apple_ref/doc/uid/DTS40007710

  2. ImagesViewController 类中,将以下代码添加到 viewDidLoad 方法(因此它会崩溃 - 我们希望它在这个测试中崩溃):

    // please note: this code is designed to crash! I want it to crash, to highlight my issue with XCode.
    NSMutableArray* test = [NSMutableArray new];
    [test insertObject:NULL atIndex:0];
    
  3. 然后运行应用并点击“图片”行。

  4. 它崩溃并显示如下消息:

    2011-12-23 14:07:02.788 UICatalog[13394:707] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSArrayM insertObject:atIndex:]: object cannot be nil'
    *** First throw call stack:
    (0x37bbb8bf 0x316a11e5 0x37b1020f 0x699f 0x34fac7ff 0x34fb8c39 0x34fb8aa9 0x34fb898f 0x34fb815b 0x34fb7f53 0x34fac673 0x34fac349 0x66c1 0x35026565 0x3509ece7 0x31aec943 0x37b8fa63 0x37b8f6c9 0x37b8e29f 0x37b114dd 0x37b113a5 0x3768ffcd 0x34fa1743 0x2459 0x2418)
    terminate called throwing an exception(gdb) 
    

在 xcode 中查看: enter image description here

最佳答案

感谢brigadir指点我the solution !

效果很好。下面是一些屏幕截图,说明如何为发现我的问题的任何人解决此问题:

step 1

点击断点选项卡的加号按钮

step 2

然后点击完成

关于ios - XCode4 调试器总是在 Main 中中断,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8612161/

相关文章:

ios - 在单个 tableview 单元格中显示两个数组值

iphone - 如何将 XML 作为字符串发送到 Soap Action?

debugging - 如何暂停以检查 Makefile 运行的 sh 命令的结果?

c++ - 程序在调试器中运行时触发断点,但如果在没有调试器的情况下运行则可以正常工作

android - 错误 :Unable to obtain debug bridge in android studio

ios - View之间传输时变量值没有改变

ios - 向服务器发送获取数据的请求,发生错误 : The resource could not be loaded

ios - 在 Spotify iOS 应用程序中创建播放列表

ios - audioPlayerDidFinishPlaying 用法

ios - Futura Condensed ExtraBold 在带有 UIFontDescriptor 的 ios 8 中不起作用