13

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):

enter image description here

enter image description here

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:

enter image description here

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:

enter image description here

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

Community
  • 1
  • 1
diogocarmo
  • 960
  • 1
  • 11
  • 30

2 Answers2

4

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

Community
  • 1
  • 1
diogocarmo
  • 960
  • 1
  • 11
  • 30
3

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

The Debug dropdown menu, workflow section

Armin
  • 629
  • 6
  • 23
  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - [From Review](/review/low-quality-posts/10377556) – vinayakj Nov 29 '15 at 17:27
  • Actually I uploaded an image, which ilustrates what I've said above, but due to my currently low rep I can only post it as a link. :) – Armin Nov 29 '15 at 17:29
  • There is upload image option available in editor (Ctrl+G), do check out, I dont think its restrictive by rep. , please check the option once, It would be useful for you later. – vinayakj Nov 29 '15 at 17:36
  • Not what I was looking for. With this option turned on, Xcode now shows the Assembly code where the exception/error happened - but that doesn't help with finding the actual problem. I'm still getting "signal SIGABRT" without much explanation, only this time in the Assembly code. – diogocarmo Nov 30 '15 at 11:13
  • As I said, check if the option is **turned off**. But that doesn't seem to be causing the issue you're having anyway. – Armin Nov 30 '15 at 11:19