问题
I have searched for topics specifically to this question but have not found anything close to my experience. Forgive me if I have overlooked the answer. I am familiar with GDB and exception points, break points, etc... but the following test of debugging in GDB vs LDB left me without a plausible response.
Global Test Values
- Xcode 4.2.1
- New Single Window Project (Default template w/no changes)
- Arc Enabled
- Storyboard Enabled
Case 1 - GDB Debugger
Exception Breakpoint Values:
- Exception - All
- Break on - Throw
- Arguments - None
- Result - No Crash
Case 2 - LLDB Debugger
Exception Breakpoint Values:
- Exception - All
- Break on - Throw
- Arguments - None
- Result - Crash with Sigbart & machine code; no discernible stack trace
Case 3 - LLDB Debugger
Exception Breakpoint Values:
- Exception - Objective-C
- Break on - Throw
- Arguments - None
- Result - No Crash
Case 4 - LLDB Debugger
Exception Breakpoint Values:
- Exception - C++
- Break on - Throw
- Arguments - None
- Result - Crash with Sigbart and machine code; no discernible stack trace
Question: Should I simply assume that selecting "Objective-C" as an Exception option is a safe way to go, or am I potentially ignoring a glaring issue? It is my understanding that as of Xcode 4.2.1, it is recommended I use LLDB and would like to. However, I am curious about the results above.
Thanks in advance to all community responses!
回答1:
Thanks to the thoughtful suggestion of @Mike K, I was able to address my concern of potentially ignoring a glaring issue.
When I reproduce the above mentioned scenario on an actual device iPhone/iPad, Cases 2 and 4 using LLDB no longer produce a crash and the application runs as intended. The issue seems to be limited to the simulator.
I am interested in the root cause of the problem on the simulator for posterity's sake, but am quite happy that I can proceed using LLDB as intended.
来源:https://stackoverflow.com/questions/8997547/exception-breakpoints-lldb-results-vs-gdb