Is Xcode debugging/crash report in Swift broken?

左心房为你撑大大i 提交于 2019-12-10 12:44:35

问题


I've been working with Swift for over a year now and things seems to be only getting worse with each new Xcode release.

Is it only here that crashes in a app aren't reported correctly? Most of the time it's only SIGBRT or EXC_BAD_INSTRUCTION on main() (yes I use a main.m in my project):

That's not helpful. If I don't add an 'All Exceptions' breakpoint, I can't find where the crash happened. I just got used with not having any help at all from LLVM about any errors on my Swift code, and even then:

Is there something I'm missing here? I feel like back when I was programming with Objective-C things were much better.

UPDATE

I found this solution: https://stackoverflow.com/a/27356008/447360

Which helps sometimes:

Still looking on how to get the exception/error message to show up (again) in Xcode.


回答1:


Ok, so I finally was able to improve the debugging info for breakpoints.

Basically you should create a "All Exceptions" breakpoint like this:

This is for Xcode 7+ only.

Credit:

http://natashatherobot.com/xcode-debugging-trick/

https://stackoverflow.com/a/31471663/447360

https://stackoverflow.com/a/4535007/447360




回答2:


Check if the "Debug -> Debug Workflow -> Always Show Disassembly" is turned off.



来源:https://stackoverflow.com/questions/33922625/is-xcode-debugging-crash-report-in-swift-broken

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!