在iOS私有代码中调试iOS信号异常
我知道一个相当不错的标题。
然而我似乎不断收到这些神秘的错误& GDB 向我显示的只是 Apple 代码的行号,这些代码已经消失了。即
0x028235bd <+0025> jne 0x28235dd <_ZN2CA5Layer15collect_layers_EPNS0_17CollectLayersDataE+57>
0x028235bf <+0027> mov 0x4(%eax),%ecx
0x028235c2 <+0030> test %ecx,%ecx
0x028235c4 <+0032> js 0x28235dd <_ZN2CA5Layer15collect_layers_EPNS0_17CollectLayersDataE+57>
0x028235c6 <+0034> mov 0x8(%ebp),%edx
0x028235c9 <+0037> mov 0x78(%edx,%ecx,4),%edx <---- EXC_BAD_ACCESS
我只想迭代一下,我知道上面的内容表明已释放的对象正在被再次访问。然而问题是,当我没有堆栈跟踪甚至寄存器值时,如何调试它?
它不仅是 EXC_BAD_ACCESS,还有 SIGABRT 错误,否则我可以使用 NSZombieEnabled 技巧。
(进一步说明,此调用跟踪与 ViewController 等相关,因此任何调试这些的指针也会很有帮助)
再次感谢。
I know quite a title.
However I seem to keep getting these mysterious errors & all GDB shows me is the line number of Apples code thats gone bang. I.e.
0x028235bd <+0025> jne 0x28235dd <_ZN2CA5Layer15collect_layers_EPNS0_17CollectLayersDataE+57>
0x028235bf <+0027> mov 0x4(%eax),%ecx
0x028235c2 <+0030> test %ecx,%ecx
0x028235c4 <+0032> js 0x28235dd <_ZN2CA5Layer15collect_layers_EPNS0_17CollectLayersDataE+57>
0x028235c6 <+0034> mov 0x8(%ebp),%edx
0x028235c9 <+0037> mov 0x78(%edx,%ecx,4),%edx <---- EXC_BAD_ACCESS
I just want to iterate that the above I know indicates that a released object is being accessed again. However the issue is how do I debug this when I don't have a stacktrace or even the register values?
Its not just EXC_BAD_ACCESS but also SIGABRT errors otherwise I could use the NSZombieEnabled trick.
(As a further note, this call trace is related to ViewControllers and the like, so any pointers debugging these would be helpful too)
Thanks again.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
打开xCode,按command+6,点击底部的“+”按钮,选择“添加异常断点”,按完成。现在,如果抛出任何异常,xCode 将突出显示抛出该异常的代码行。
Open the xCode, press command+6, tap the '+' button at the bottom, select Add Exception Breakpoint, press done. Now if any exception is being thrown, the xCode will highlight the line of code that threw it.