xcode 4 调试显示大多数对象的“摘要不可用”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5301582/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 20:29:48  来源:igfitidea点击:

xcode 4 debugging shows 'Summary Unavailable' for most objects

iphonexcode

提问by theiOSDude

Whilst using Xcode 4.0 and trying to debug and see what value is held in what variable - or see what objects are in an array etc, I always seem to get "Summary Unavailable" or "Invalid Summary".

在使用 Xcode 4.0 并尝试调试并查看什么值保存在什么变量中 - 或者查看数组中的对象等时,我似乎总是得到“摘要不可用”或“无效摘要”。

The problem seems much like the one in 3.2.6 if you built and ran a release version with the symbols stripped.

如果您构建并运行了一个删除了符号的发行版,这个问题看起来很像 3.2.6 中的问题。

Any chance that any one knows where I am going wrong, or what the resolution is For years things worked smoothly - then Apple stepped in - again.

任何人都知道我哪里出错了,或者解决方案是什么的任何机会多年来,事情进展顺利——然后苹果再次介入。

Thanks

谢谢

采纳答案by Tom Harrington

You're not going wrong, Xcode 4 is. This problem is pretty common, unfortunately. Report it at http://bugreport.apple.com/and hope for the best.

你没有错,Xcode 4 是。不幸的是,这个问题很常见。在http://bugreport.apple.com/报告它并希望最好。

In the meantime you can inspect variables using the console, which appears at the bottom of Xcode 4's window during debugging. If you have an object "myObj", you can inspect it in the console by typing "po myObj". It's a lot less convenient but it's better than not getting the information at all.

同时,您可以使用控制台检查变量,该控制台在调试期间出现在 Xcode 4 窗口的底部。如果您有一个对象“myObj”,您可以在控制台中输入“po myObj”来检查它。它不太方便,但总比根本不获取信息要好。

回答by ferdil

You can also try changing the "Summary Format" in the GDB window. Try something like {(NSString *)[$VAR description]}:s as the Summary format - this works for NSManagedObject derived objects.

您还可以尝试更改 GDB 窗口中的“摘要格式”。尝试类似 {(NSString *)[$VAR description]}:s 作为摘要格式 - 这适用于 NSManagedObject 派生对象。

回答by Rob Bailey

Start your app up in debug

在调试中启动您的应用程序

IN XCODE 4.02, go to Product/Debug/Shared Libraries

在 XCODE 4.02 中,转到产品/调试/共享库

The window that appears tells you which dynamicLibs are loaded

出现的窗口告诉您加载了哪些动态库

Scroll down until you see "libXcodeDebuggerSupport.dylib Click the "Load" button, and then "Done"

向下滚动直到看到“libXcodeDebuggerSupport.dylib 单击“加载”按钮,然后“完成”

After stopping on a breakpoint, the contents of a string should be printed in blue after the object's address.

在断点处停止后,字符串的内容应在对象地址后以蓝色打印。

Hope this helps!

希望这可以帮助!

回答by Atte Kotiranta

While waiting for Apple to fix Xcode 4 you can try using "Print Description", which prints the value to console.

在等待 Apple 修复 Xcode 4 时,您可以尝试使用“打印描述”,它将值打印到控制台。

回答by Matt__C

This happened to me upon upgrade to xCode 4.3.1.

这发生在我升级到 xCode 4.3.1 时。

I found that editting the Run/Debug scheme and changing the Debugger setting in the Info tab from LLDB to GDB fixed the problem.

我发现编辑运行/调试方案并将信息选项卡中的调试器设置从 LLDB 更改为 GDB 解决了该问题。

回答by Jeff Wolski

I had that problem. If you explicitly declare the ivars in your h file, they should show up in the debugger as expected.

我有那个问题。如果您在 h 文件中明确声明了 ivars,它们应该按预期显示在调试器中。

@synthesizewill create the proper ivers for you, but it does not always make them accessible in the debugger endless you use the command line po to look at them.

@synthesize将为您创建合适的 ivers,但它并不总是使您可以在调试器中无限地访问它们,您可以使用命令行 po 来查看它们。

回答by TPoschel

I have battled this issue for quite a while and I finallyfigured out the issue. I have several build configurations in my application (Debug, Release, UAT). When I hit 'Run' on my main scheme then I am using the 'UAT' configuration -- not 'Debug'. I realized that I was stripping debug symbols for my 'UAT' and 'Release' configurations. I simply modified my build settings to not strip debug symbols for the 'UAT' build configuration and voila, all my symbols are available again.

我已经与这个问题斗争了很长一段时间,我终于弄清楚了这个问题。我的应用程序中有几个构建配置(调试、发布、UAT)。当我在我的主要方案上点击“运行”时,我使用的是“UAT”配置——而不是“调试”。我意识到我正在剥离我的“UAT”和“发布”配置的调试符号。我只是修改了我的构建设置,以不去除“UAT”构建配置的调试符号,瞧,我的所有符号都再次可用。

Build Settings -- Strip Debug Symbols

构建设置——剥离调试符号

I am using XCode 4.5.1, but have seen this issue for quite a while on various projects. I assume that most of my projects use the 'Debug' build configuration by default and therefore were working fine. Only when I started getting fancy with my schemes and build configurations did I come across this issue.

我正在使用 XCode 4.5.1,但在各种项目中看到这个问题已经有一段时间了。我假设我的大多数项目默认使用“调试”构建配置,因此工作正常。只有当我开始喜欢我的方案和构建配置时,我才遇到这个问题。