None of my breakpoints are being hit.
I've tried the following:
Debug
and Debug executable
is tickedGenerate debug symbols
is set to Yes
Optimization level
to No optimization
The breakpoints are still not being hit.
Had this exact issue today - breakpoints in Swift projects were failing in XCode 9.3 (objective-c ones were fine).
The following fixed it:
change Optimization level under the Swift Compiler - Code Generation submenu. Move it from -O to -Onone
Try below steps
None of the existing answers worked for me so I dug into what was going on. By forcing a breakpoint in code (ie an asm("int3;") instruction) I was able to see that the symbols weren't loading. Naturally breakpoints depend on symbol information being loaded.
The code for which my breakpoints weren't working was in a C++ framework and the framework has a build setting called " Strip linked product " which was defaulted to "Yes" for both release and debug builds. By setting this to "No" for the debug build (and doing a full rebuild) my breakpoints now work again.
I had set Deployment Postprocessing
to NO
in my Build Settings for my target. Setting this to YES
made my breakpoints work again.
In my case problem was in the Debug information format setting. It was set to DWARF
instead of DWARF with dSYM File
. Reseting it to the default value solved the problem.
Check Preferences > Behaviors > Running > Pauses options. The Show for navigator and debugger must have ticked.
None of the previous solutions worked for me either. I had an issue where all my breakpoints would work except on a c++ project among other projects in an xcode (9.4.1) workspace. For that project, I noticed that only some breakpoints were working. Digging deeper showed that it was breakpoints made within private methods that did not work.
After a good deal of investigation, I found my particular issue. In my main project, I had declared some static objective-c initializers in a header file. Not entirely sure why, but after I moved these to the implementation file where they were referenced, my broken breakpoints started working again. Hope this saves someone some time.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.