开发者

iPhone SDK 3.0 not displaying error messages

开发者 https://www.devze.com 2022-12-30 10:54 出处:网络
I could resolve this problem just now but assuming others might have the same problem, I post the \"solution\" here anyway.

I could resolve this problem just now but assuming others might have the same problem, I post the "solution" here anyway. When building a project in XCode using "Build and Debug" and then running it the iPhone开发者_运维技巧 simulator would exit without printing an error message to the console. Like for example I would access an invalid pointer and it would just terminate without printing Program received signal: “EXC_BAD_ACCESS”.

I used to use SDK 2.X and never experienced this and now I switched to 3.2 and this bug totally sucks. Anyway. The "solution", if you want to call it that, is to set a breakpoint on the line where you access your invalid pointer, open the debugger, step over it and in the next cycle step into it. After that press continue and then close the debugger and simulator. Then running the project using the "Build and Debug" button on the "Debugger Console" was fixed, i.e. when the simulator crashes it now prints "EXC_BAD_ACCESS" just like it used to in SDK 2.X.


Xcode will "normally" continue on an untrapped exception and display the appropriate message in the Debugger Console. However, if you have set "Run->Stop on Objective-C Exceptions" it will first pause in gdb before displaying the message. I would imagine that you may have set this breakpoint at some time - there are a few related breakpoints you can set in .gdbinit that will have a similar effect.

0

精彩评论

暂无评论...
验证码 换一张
取 消