Re:Xcode 9.1 Improves Display of Fatal Errors
by nielsbot on Friday October 06, 2017 @01:31PM
(#15418572)
not entirely true. if you use Obj-C data types (NSArray etc) you get an exception for out-of-range accesses.
[ Parent
| on HN ]
Re:Xcode 9.1 Improves Display of Fatal Errors
by 0x0 on Friday October 06, 2017 @01:49PM
(#15418755)
Right, I feel like I've seen exceptions for a lot of errors ending up with xcode hanging on an exc_bad_whatever disassembly of some sort of main() routine, things like putting nil values in arrays, inconsistent uitableview datasource implementations, etc. Usually shows an alright stack trace logged to the console but the main xcode editor still opens a useless disassembler in system code?
Re:Xcode 9.1 Improves Display of Fatal Errors
by eridius on Friday October 06, 2017 @02:51PM
(#15419335)
Stick `po $arg1` in your exception breakpoint and it will print the exception (well, for Obj-C exceptions; I don't remember offhand how to look at C++ exceptions since I so rarely deal with them).
Re:Xcode 9.1 Improves Display of Fatal Errors
by 0x0 on Friday October 06, 2017 @03:20PM
(#15419610)
Thanks for the tip. It's usually not a problem to figure out what's wrong (the exception is dumped to the debugger), but it's a bit useless that the main editor in xcode switches to an irrelevant disassembly view at the same time :)
Re:Xcode 9.1 Improves Display of Fatal Errors
by eridius on Friday October 06, 2017 @03:31PM
(#15419703)
It shouldn't. Xcode usually switches to the shallowest stack frame that has source code available when hitting a breakpoint.
Re:Xcode 9.1 Improves Display of Fatal Errors
by 0x0 on Friday October 06, 2017 @03:50PM
(#15419844)
Oh, I was talking about uncaught exceptions where no breakpoint has been set.
Re:Xcode 9.1 Improves Display of Fatal Errors
by eridius on Friday October 06, 2017 @04:27PM
(#15420158)
Uncaught exceptions don't enter the debugger until it bubbles back up to main(), so the stack in the debugger is useless there.
Re:Xcode 9.1 Improves Display of Fatal Errors
by 0x0 on Friday October 06, 2017 @05:32PM
(#15420636)
Right, I was hoping this new Xcode 9.1 feature could improve upon that for Objective-C as well. Perhaps capturing a copy of the stack when the exception is raised, so it open the main editor window on the appropriate source line where that exception was raised.