Xcode 4 Instruments doesn't show source lines

前端 未结 8 1022
执笔经年
执笔经年 2021-01-30 14:30

I\'ve just started playing with Xcode 4, and found that, no matter how I setup debugging symbols in the project, Instruments refuses to display source lines for stack trace item

相关标签:
8条回答
  • 2021-01-30 14:37

    Here's my environment...

    • XCode 8.2
    • Mac OS v10.12 Sierra

    I had the same problem running in the simulator, and it was driving me nuts because ALL the standard go-to fixes were not working.

    What did it for me was plugging my iPad into the MacBook and running an instruments session against said app on my plugged in iPad. Instruments properly symbolicated my app when running on the iPad, and then continued to work when I disconnected the iPad and ran instruments later in the simulator.

    I suspect it had something to do with updating my project to use the following...

    • libsqlite3.tbd instead of libsqlite3.dylib
    • libstdc++.6.tbd instead of libstdc++.dylib

    I don't know why that would be the case, but that was the ONLY project change I had made before my symbols were lost in Instruments.

    0 讨论(0)
  • 2021-01-30 14:46

    The other answers are good long-term fixes. If you'd rather not wait for Spotlight to rebuild its index and just need to get symbols for one Instruments session, you can ask Instruments to symbolicate the current session.

    1. Choose File → Re-Symbolicate Document… screenshot of re-symbolicate menu item
    2. Locate your binary in the list that appears. It should be the same name you see on the Springboard. Select your binary and click "Locate." enter image description here
    3. Go back to Xcode. Control-click on your .app build product and choose "Show in Finder".right-click menu screenshot showing show in finder item
    4. This will reveal the directory containing your binary as well as its dSYM file. Go back to Instruments, navigate to this directory, and select your dSYM file. The easiest way is to just drag the dSYM file straight from the Finder to the "Select dSYM" dialog in Instruments.
    5. Finally, click "Symbolicate" in Instruments. You should now see symbols in the traces rather than hex offsets.
    0 讨论(0)
  • 2021-01-30 14:46

    One reason for instruments having no symbols could be that Spotlight cannot find the dSYM file. So your change from DWARF with dSYM to DWARF is not a good idea. You should change it back since without a dSYM file, you won't get symbols anyway (at least this seems to be the case for Snow Leopard, I have seen reports that some people also got symbols without dSYM files, however, all those people were using Lion). After making the change, make sure you create a clean build (sometimes Xcode fails to generate the dSYM file on my system for non-clean builds).

    If you still get no symbols after all that, something is wrong with your Spotlight database. Try adding the folder that contains the dSYM files after a build to the list of folders Spotlight shall not index and then remove it again from that list. This causes Spotlight to reindex the files.

    If this also doesn't help, maybe your Spotlight index is completely corrupted. In that case, try the following on a Terminal:

    sudo mdutil -i off /
    sudo mdutil -E /
    sudo mdutil -i on /
    

    This causes Spotlight to first stop indexing your main hard drive, then delete all index data collected in the past and then start reindexing it. The lines above assume that your dSYM files are located on the main hard drive (and not on any other hard drive or network volume, otherwise you must replace '/' with the appropriate mount point of that volume). Give Spotlight some time to reindex before you try again.

    0 讨论(0)
  • 2021-01-30 14:47

    It just started working; no rhyme or reason.

    I have spent the last half-hour trying to get it to fail again, in the hope of providing a more useful answer here, but I can't, even after recreating the skeleton OpenGL program from scratch, retracing all of my steps.

    I did open the symbolicatecrash script in emacs (It has been implicated elsewhere, wrt this kind of problem), and it started working after I did this. But at no point did I change or save it.

    It's a mystery.

    0 讨论(0)
  • 2021-01-30 14:47

    In newer versions of Instruments (I have 5.1.1 (55045)), you can add additional paths to be searched for the dSYMs and source code

    Open up Instruments' Preferences, then click the "dSYMs And Paths" tab.

    Preference tabs

    Then add your path to the list.

    Add a search path to the list

    0 讨论(0)
  • 2021-01-30 14:49

    Try selecting a different code signing identity, i.e. provisioning profile, for the Release configuration.

    0 讨论(0)
提交回复
热议问题