Xcode 调试器停止显示本地和自变量
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3321980/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Xcode debugger stopped displaying local and self variables
提问by Paul
I don't understand this at all, but I can no longer see any locals or ivars when debugging my iPhone app with Xcode 3.2.3. Everything seemed normal until yesterday afternoon, and now I just see the globals and registers, which are not of much interest to me.
我根本不明白这一点,但是在使用 Xcode 3.2.3 调试我的 iPhone 应用程序时,我再也看不到任何本地人或 ivars。直到昨天下午,一切似乎都很正常,现在我只看到全局变量和寄存器,我不太感兴趣。
HAs anyone else had this experience? I feel like I have gone crazy. How can the debugger "forget" to show me variables? Its the debug build, non-optimized code generation, breakpoints work, where are the variables?
有没有其他人有这种经验?我觉得我已经疯了。调试器如何“忘记”向我显示变量?它的调试构建,未优化的代码生成,断点工作,变量在哪里?
I am so sorry I upgraded to Xcode 3.2.3. What a mistake that was. I am so not impressed.
很抱歉我升级到 Xcode 3.2.3。那是多么大的错误啊。我没有留下深刻的印象。
Oh, yeah, I built a template app just to see if THAT one would debug normally and it does, so I am looking at the differences in the project settings to see if that holds a clue.
哦,是的,我构建了一个模板应用程序只是为了看看它是否会正常调试并且确实如此,所以我正在查看项目设置中的差异以查看是否有线索。
回答by Tibidabo
In my cases it was the optimisation for debug.
在我的情况下,它是调试的优化。
In the build settings Optimization Levelwas set to Fastest for both Debug and Release. I switched Debug to Noneand it solved the issue.
在构建设置中,优化级别对于调试和发布都设置为最快。我将 Debug 切换为None并解决了这个问题。
回答by Paul R
Close the project, open Terminal, cd into the <project>.xcodeproj
directory, delete all <username>.*
files (i.e. delete everything exceptproject.pbxproj
), then try opening your project again.
关闭项目,打开终端,cd 进入<project>.xcodeproj
目录,删除所有<username>.*
文件(即删除除 之外的所有文件project.pbxproj
),然后再次尝试打开您的项目。
(Note: don't worry about the files you are deleting - they are just per-user setting files for things like window positions, saved breakpoints, etc - the important stuff is all in project.pbxproj
.)
(注意:不要担心您要删除的文件 - 它们只是针对窗口位置、保存的断点等内容的每个用户设置文件 - 重要的内容都在project.pbxproj
.)
One other thing that has also solved problems for me in the past is to trash the entire build folder.
过去也为我解决了问题的另一件事是删除整个构建文件夹。
回答by Rob
I just had the same problem and it turned out to be which compiler I had set in the project settings. Switched it to GCC 4.2 and they started showing up again.
我刚刚遇到了同样的问题,结果是我在项目设置中设置了哪个编译器。将其切换到 GCC 4.2,它们又开始出现了。
回答by Gulshan Kooky Infomedia
In my build settings Optimization Levelwas set to Nonethen also having same issue, For me it resoloved by following step:
在我的构建设置中,优化级别设置为无然后也有同样的问题,对我来说它通过以下步骤解决:
1-) select your target near run button on xcode where you select device and simulators.
1-) 在 xcode 上选择您的目标接近运行按钮,您可以在其中选择设备和模拟器。
2-) then go to edit schemeof selected target.
2-) 然后去编辑选定目标的方案。
3-) now check in run sectionthat Build Configuration is set to Debug
3-) 现在检查构建配置设置为调试的运行部分
4-) now check in archive sectionthat Build Configuration is set to Release
4-) 现在检查存档部分,将构建配置设置为发布
in my case archive section was set to Debug, i changed it to release and its works.
在我的情况下,存档部分设置为调试,我将其更改为发布及其作品。
refer screenshot: https://i.stack.imgur.com/J6nGI.png
回答by macrene
With Xcode 7.1 appeared the same problem, while I'm not sure, if it really was the update, because I changed the Architecture also to "Universal (32/64bit)" and Valid Architectures to "x86_64 i386" in the Project->Build settings.
Xcode 7.1 出现了同样的问题,虽然我不确定,如果它真的是更新,因为我在项目中将架构也更改为“通用(32/64 位)”并将有效架构更改为“x86_64 i386”->构建设置。
Anyway, I checked all advices I could find, but my settings were correct.
无论如何,我检查了我能找到的所有建议,但我的设置是正确的。
Changing the Product->Destination from 32 bit to 64 bit solved. I could also recreate the problem by switching from 64 bit to 32 bit.
将 Product->Destination 从 32 位更改为 64 位已解决。我也可以通过从 64 位切换到 32 位来重现这个问题。
回答by Rn222
I upgraded from Xcode 3.2.3 to 3.2.4 and changed the SDK version to 4.1 and this problem went away. Other work arounds didn't work for me.
我从 Xcode 3.2.3 升级到 3.2.4 并将 SDK 版本更改为 4.1,这个问题就消失了。其他解决方法对我不起作用。