前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >SIGABRT错误的调试办法[通俗易懂]

SIGABRT错误的调试办法[通俗易懂]

作者头像
全栈程序员站长
发布2022-08-01 07:59:19
2.2K0
发布2022-08-01 07:59:19
举报
文章被收录于专栏:全栈程序员必看

大家好,又见面了,我是你们的朋友全栈君。

iOS经常会遇到一个头疼的error就是在main函数上显示“ Thread 1: signal SIGABRT ”这个错误,终于在stackoverflow上找到了调试的办法:

原文链接: http://stackoverflow.com/questions/9782621/i-have-an-error-in-main-m-thread-1-signal-sigabrt-how-can-i-fix-this

重点就是 Set an exception breakpoint.

之前我们遇到的在main函数上的那个崩溃信息,如果想要调试就加入一个 an exception breakpoint ,它会在exception 被 cathc 的时候停下来,这样就可以追踪到造成 exception 的代码了。

加入一个exception breakpoint的方法就是:在navigator的断点页面,点击左下角的加号就能看到 exception breakpoint;

加入的时候可以设置,默认是 all,也可以选择针对 oc 还是 c 的断点。

原文:

When you get SIGABRT on that line of main, it means that your program is raising an exception. The stack trace shows where the exception is being caught, not where it’s being raised. Usually this is not helpful. To debug the problem, you can do two things:

1. Click the “Continue Program Execution” button in the debugger control bar, or choose Program > Debug > Continue from the menu bar. This will let the program continue the exception-raising process. It will print a message to the debugger console that will help you understand what’s wrong. (You may have to continue execution a couple of times before it actually prints messages.) Read the messages carefully! They usually continue helpful information.

2. Set an exception breakpoint. This will make Xcode stop your program at the point where the exception is being raised, so you can see the code and the stack trace that is causing the problem.

发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/127403.html原文链接:https://javaforall.cn

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2022年4月1,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档