我如何知道在Xcode调试器(iPhone)中抛出什么异常? [英] How do I find out what exception was thrown in the Xcode debugger (for iPhone)?
问题描述
调用UIApplicationMain()后抛出异常,从我的主()。如果我查看调试器中的堆栈跟踪,我看到的(当然)汇编。如何找出抛出什么样的异常?
更新:从调试器控制台了解异常的详细信息足以帮助我解决问题。 (请参阅 http://groups.google.com/group/iphonesdk / browse_frm / thread / 6f44a90fdb8da28a?hl = en 。)我验证了我可以在 objc_exception_throw
上设置一个符号断点,但是我没有看到是否
将断点放在 objc_exception_throw
并通过调试运行您的应用程序,而不是运行
要澄清一点,当您没有断点获得异常时,您实际看到的是一致的堆栈跟踪 - 这是未捕获的异常处理程序。异常的类型被记录到运行控制台,但是如果你想看到异常引发的地方,那就是断点是什么。
I'm learning iPhone programming from Erica Sadun's The iPhone Developer's Cookbook. When I run the app I created by following the steps in the Temperature Conversion Example starting on page 81 in the simulator, it terminates due to an uncaught exception. (See http://groups.google.com/group/iphonesdk/browse_frm/thread/6f44a90fdb8da28a?hl=en for the question I posted to the iPhoneSDK Google Group.)
The exception is thrown after calling UIApplicationMain() from my main(). If I look through the stack trace in the debugger, all I see is (of course) assembly. How do I find out what kind of exception was thrown?
Update: Learning the details of the exception from the Debugger Console was enough to help me solve the problem. (See http://groups.google.com/group/iphonesdk/browse_frm/thread/6f44a90fdb8da28a?hl=en.) I verified that I could set a symbolic breakpoint on objc_exception_throw
, but I didn't look to see if the backtrace from there would have been helpful.
Put a breakpoint at objc_exception_throw
and run your app via Debug instead of Run
To clarify, what you're actually seeing when you get an exception without the breakpoint is the same stack trace always - it's the uncaught exception handler. The type of exception is logged to the Run console, but if you want to see a backtrace for where the exception was raised, that's what the breakpoint is for.
这篇关于我如何知道在Xcode调试器(iPhone)中抛出什么异常?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!