在iOS私有代码中调试iOS信号异常

发布于 2025-01-06 21:28:44 字数 780 浏览 4 评论 0原文

我知道一个相当不错的标题。

然而我似乎不断收到这些神秘的错误& 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

得不到的就毁灭 2025-01-13 21:28:44

打开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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文