问题
I have been working on an App today and have been able to debug it. All of the sudden I can't use breakpoints without Xcode 5.1 crashing. It will stop on the breakpoint, look like it's trying to display the local variables in the bottom left window, and then crash.
This is the crash report:
Process: Xcode [8084]
Path: /Applications/Xcode.app/Contents/MacOS/Xcode
Identifier: com.apple.dt.Xcode
Version: 5.1 (5084)
Build Info: IDEFrameworks-5084000000000000~21
App Item ID: 497799835
App External ID: 444172641
Code Type: X86-64 (Native)
Parent Process: launchd [189]
Responsible: Xcode [8084]
User ID: 294396280
Date/Time: 2014-04-03 14:57:52.981 -0600
OS Version: Mac OS X 10.9.2 (13C64)
Report Version: 11
Anonymous UUID: 5BFD5C24-5465-3BC8-137A-4BF1A8D48B38
Sleep/Wake UUID: F94AB6A7-9517-4F94-93DA-CC2C9154C8A7
Crashed Thread: 30 DBGLLDBSessionThread
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Application Specific Information:
ProductBuildVersion: 5B130a
Assertion failed: (!isNull() && "Cannot retrieve a NULL type pointer"), function getCommonPtr, file /SourceCache/lldb/lldb-310.2.36/llvm/tools/clang/include/clang/AST/Type.h, line 547.
(I can supply the rest of the report of what the threads are doing if it is helpful).
I have placed breakpoints in various files and locations in the code. I am able to use breakpoints in some places, but the majority of the breakpoints cause the crash.
I have looked through several SO pages with no luck. Among other things I have tried deleting all the breakpoints and just adding 1 back in. I have deleted and regenerated the schemes.
Any ideas?
I updated to 5.1.1. and the problem still exists:
Process: Xcode [19072]
Path: /Applications/Xcode.app/Contents/MacOS/Xcode
Identifier: com.apple.dt.Xcode
Version: 5.1.1 (5085)
Build Info: IDEFrameworks-5085000000000000~10
Code Type: X86-64 (Native)
Parent Process: launchd [197]
Responsible: Xcode [19072]
User ID: 294396280
回答1:
I happened to have two iPhones connected via USB (a 4 with iOS 7.1 and a 5 with iOS 7.1.1), and Xcode 5.1.1 was "beach-balling" on me at the first break-point, wherever it might be, whichever breakpoint was hit first.
Just disconnected the iPhone 4 from USB.
I can use breakpoints again :)
YMMV of course ...
回答2:
I encountered this problem as well recently with the same exact LLVM error:
Assertion failed: (!isNull() && "Cannot retrieve a NULL type pointer"), function getCommonPtr
In my case it was a piece of code where I was storing an enum value (Permission) within another object as a reference, rather than a value:
Correct:
@property(nonatomic, readwrite) Permission permission;
Wrong:
@property(nonatomic) Permission *permission;
I was able to narrow down the problem by running Xcode's code analysis. After I made a correction to one or more of the warnings in each class I would rerun the analysis, then test and commit. Tedious but effective, and now I can debug again properly. Hope this helps steer someone in the right direction.
来源:https://stackoverflow.com/questions/22849021/xcode-5-1-crashes-when-it-hits-a-break-point