Why aren't Xcode breakpoints functioning?

126,898

Solution 1

First of all, I agree 100% with the earlier folks that said turn OFF Load Symbols Lazily.

I have two more things to add.

(My first suggestion sounds obvious, but the first time someone suggested it to me, my reaction went along these lines: "come on, please, you really think I wouldn't know better...... oh.")

  1. Make sure you haven't accidentally set "Active Build Configuration" to "Release."

  2. Under "Targets" in the graphical tree display of your project, right click on your Target and do "Get Info." Look for a property named "Generate Debug Symbols" (or similar) and make sure this is CHECKED (aka ON). Also, you might try finding (also in Target >> Get Info) a property called "Debug Information Format" and setting it to "Dwarf with dsym file."

There are a number of other properties under Target >> Get Info that might affect you. Look for things like optimizing or compressing code and turn that stuff OFF (I assume you are working in a debug mode, so that this is not bad advice). Also, look for things like stripping symbols and make sure that is also OFF. For example, "Strip Linked Product" should be set to "No" for the Debug target.

Solution 2

In Xcode 7, what worked for me was:

  1. Make sure that the Target > Scheme > Run - is in Debug mode (was Release)

  2. Make sure to check the option "Debug executable":

Debug executable

Solution 3

Go to the Xcode Debugging preferences. Make sure that "Load Symbols lazily" is NOT selected.

Solution 4

I was just having this same issue (again). After triple-checking "Load symbols lazily" and stripping and debug info generation flags, I did the following:

  1. quit Xcode
  2. open a terminal window and cd to the project directory
  3. cd into the .xcodeproj directory
  4. delete everything except the .pbxproj file (I had frank.mode1v3 and frank.pbxuser)

You can accomplish the same task in finder by right/option-clicking on the .xcodeproj bundle and picking "Show Package Contents".

When I restarted Xcode, all of my windows had reset to default positions, etc, but breakpoints worked!

Solution 5

One of the possible solutions for this could be ....go to Product>Scheme>Edit scheme>..Under Run>info>Executable check "Debug executable".

Share:
126,898
AlanKley
Author by

AlanKley

I'm an Android developer converted from a Windows Stack Desktop developer. I enjoy developing my personal projects using Flutter

Updated on February 11, 2022

Comments

  • AlanKley
    AlanKley about 2 years

    I have breakpoints set but Xcode appears to ignore them.

  • taxilian
    taxilian over 11 years
    On XCode 4.5.2 I had this issue and it turned out to be because I had enabled "Link-time optimization", so that's another thing to check
  • Rémi Doolaeghe
    Rémi Doolaeghe almost 11 years
    This works, but it deletes all your preferences... This should be done when nothing else worked.
  • Oscar
    Oscar over 10 years
    Unfortunately there are no "debugging" preferences in Xcode 6, and "lazily" doesn't appear in the documentation. Sigh.
  • Duck
    Duck over 9 years
    worked for me, thanks. I wonder why Xcode sucks that much. Xcode is the worst piece of software ever written by Apple.
  • Frank Szczerba
    Frank Szczerba over 9 years
    Wow, that's 5 years old. Hard to believe it still works, and that it's still an issue!
  • Jeffrey Sun
    Jeffrey Sun over 9 years
    To change the Build Configuration, go to Product -> Scheme -> Edit Scheme, under Run - Info. For me what worked was checking "Debug Executable" in that menu.
  • RNA
    RNA over 9 years
    alright, now I can't find 'Load Symbols Lazily' option in XCode 6
  • Native_Mobile_Arch_Dev
    Native_Mobile_Arch_Dev over 9 years
    Did not work for me. I am running Xcode 6.01. Now when I build, I receive multiple missing file errors. I'm reverting my code to resolve.
  • Dave
    Dave over 9 years
    Hijacking the top answer to add that Bison syntax seems to be another (exotic) cause of breakpoints not working (see my answer below). Hopefully will save some time to the next person with that problem.
  • dsgrnt
    dsgrnt over 9 years
    It's also super easy to inadvertently toggle breakpoint activation with ⌘Y. So watch out for that, kids.
  • user2067021
    user2067021 almost 9 years
    In Xcode 6.4, there is now only a Run button and whether it runs a debug configuration or not depends on the currently selected scheme settings.
  • user1601259
    user1601259 over 8 years
    I had same issue since working off an open source project which had a appstore release build run config as well as a debug one, you have to make sure to select the debug one.
  • anoop4real
    anoop4real over 8 years
    This is exactly what happened to me, checkbox was unchecked
  • Maheswaran Ravisankar
    Maheswaran Ravisankar about 8 years
    After updating to XCode 7, This setting was somehow YES only in my subproject and then breakpoints didnt work in subprojects. And after setting to NO, it was perfect!
  • Ran
    Ran about 8 years
    This worked for me only after cleaning the project so a full rebuild will take place.
  • Juan Boero
    Juan Boero about 8 years
    Only had to re start Xcode, my case was due to git versioning, when commiting the xcode user interface state data.
  • Michael Osofsky
    Michael Osofsky about 7 years
    "Load Symbols Lazily" is not an option in my Xcode 8. Seems to have disappeared in Xcode 6 stackoverflow.com/questions/26231671/…
  • Michael Osofsky
    Michael Osofsky about 7 years
    To set "Active Build Configuration" to "Debug" instead of "Release" in Xcode 8 go to Product -> Scheme -> Edit Scheme. Click Run on left side. Click Info on top of screen. In Build Configuration drop-down, choose "Debug".
  • Noel Widmer
    Noel Widmer almost 7 years
    @IshantMrinal Why is this not relevant? The user provided an answer that worked in his scenario.
  • elitalon
    elitalon over 6 years
    Another setting that might prevent breakpoints to take effect is "Strip Debug Symbols During Copy"
  • dgmz
    dgmz almost 6 years
    Same issue for me. Shouldn't that option be enabled by default (XCode 8.3) ? Aren't we supposed to be all devs, willing to debug anyway ?
  • Kazi Abdullah Al Mamun
    Kazi Abdullah Al Mamun almost 6 years
    Worked for me in Xcode 9.3, it would be great if you provide another image for option 1.
  • llamacorn
    llamacorn almost 5 years
    This suggestion isn't really relevant for xcode 10.2.1 which is the version I am using.
  • Chewie The Chorkie
    Chewie The Chorkie almost 5 years
    Any Xcode 10 solution? I need to keep building my project until breakpoints finally work.
  • Erkki Nokso-Koivisto
    Erkki Nokso-Koivisto almost 5 years
    @llamacorn ... your comments are delivered to me, but I no longer code on Mac at the moment, so I cannot help with Xcode 10 (sadly). I'm sorry about that! You may need to post a fresh new question with Xcode 10 in the title.
  • Erkki Nokso-Koivisto
    Erkki Nokso-Koivisto almost 5 years
    @chewie-the-chorkie please see my comment to llamacorn just now. Sorry I cannot be of assistance with Xcode 10.
  • Chewie The Chorkie
    Chewie The Chorkie almost 5 years
    @pestophagous thank you, I coincidentally already posted about it here if anyone can help: stackoverflow.com/questions/57117144/…
  • mrchance
    mrchance over 4 years
    omfg thx @taxilian. that solved it for me. xcode 11, 2019, this was driving me crazy. somewhat incredible that xcode does not warn you about that, facilitate turning off while debugging. lost 1 day "debugging" the user-interface of xcode – ㄈㄟㄈㄟ 23 mins ago
  • Jim75
    Jim75 over 3 years
    Thank you! This also fixed the slow responsiveness of debugging logs
  • אורי orihpt
    אורי orihpt about 3 years
    I deleted it while Xcode while running. Now everything is saved and breakpoints are working too! +1
  • Carl G
    Carl G over 2 years
    This same answer was already provided years ago (2012, 2015.) Please ensure that you are not duplicating other answers.
  • Carl G
    Carl G over 2 years
    Note that the get-task-allow entitlement may be included by an Xcode Managed Profile: imgur.com/a/qS27asO
  • Jayprakash Dubey
    Jayprakash Dubey over 2 years
    What does 'Always Show Disassembly' mean? This didn't worked for me. :-(
  • elliotching
    elliotching almost 2 years
    Under "Targets" in the graphical tree display of your project <<<--- can u please attach a screenshot pleassssssee?
  • elliotching
    elliotching almost 2 years
    right click on your Target and do "Get Info." << there is no "Get info" options