xCode3 and run-time errors line highlighting?
I'm used to xCode 4, but I need to use xCode 3 for a project.
when I get a run-time error, xcode3 doesn't highlight the code line where the issue is.
Shouldn't it show me instead ?
Check this screenshot:
I've written this code to make the app to crash and I'm s开发者_如何学Gotepping forward with the debugger.
The current code is highlighted, but if I step over further, I don't see any line highlighted.
Try turning on NSZombieEnabled, malloc stack logging, and guard malloc (env variable, or by checking the boxes in the xcode debug menu and it should give you a lote more usefuly info about the exception.
Check out this article for more info on NSZombieEnabled.
This one for MallocStackLogging info
More info on guard malloc here
Sometimes exceptions dont break at the bad line of code because the message causing the error isnt actually where the problem takes place, it usually throws the exception somewhere in the framework code, which is why you will see a bunch of assembly when gdb finally pauses execution. If this happens, you can run:
(gdb) info malloc-history 0x123456
Where 0x123456 is the address of the object that gets sent a message after being released, and it will display a much more helpful stack trace.
精彩评论