xcode DWARF 和 DWARF with dSYM 文件有什么区别?

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

What's the difference between DWARF and DWARF with dSYM file?

iosxcode

提问by Lio

XCode supports those 2 values for this Build Setting:

XCode 支持此构建设置的这 2 个值:

Build Settings > Build Options > Debug Information Format.

构建设置 > 构建选项 > 调试信息格式。

Could anybody explain the differences?

有人可以解释这些差异吗?

采纳答案by malex

The difference is that in the case of DWARF with dSYM file your Archive app.xcarchive (for adHoc distribution) contains also dSYM file needed for reverse symbolication of your code in crash reports. In general, .xcarchive contains

不同之处在于,在带有 dSYM 文件的 DWARF 的情况下,您的存档 app.xcarchive(用于临时分发)还包含在崩溃报告中对您的代码进行反向符号化所需的 dSYM 文件。一般来说,.xcarchive 包含

dSyms
Products
info.plist

So if you need it for external analysis of crash reports under archiving you app for distribution you should use DWARF with dSYM file.

因此,如果您需要在归档应用程序以进行分发时对崩溃报告进行外部分析,则应将 DWARF 与 dSYM 文件一起使用。

回答by Honey

As always understanding the abbreviations help!

一如既往地理解缩写帮助!

DWARFis a widely used, standardized debugging data format:

DWARF是一种广泛使用的标准化调试数据格式:

DWARF was originally designed along with Executable and Linkable Format(ELF), although it is independent of object file formats. The name is a medieval fantasy complement to "ELF" that has no official meaning. Only that both (dwarf and elf) are mythological creatures

DWARF 最初是与可执行和可链接格式(ELF)一起设计的,尽管它独立于目标文件格式。这个名字是对“ELF”的中世纪幻想补充,没有官方意义。只是两者(矮人和精灵)都是神话生物

Debug Symbol(dSYM):

调试符号(dSYM):

By default, debug builds of an application store the debug symbolsinside the compiled binary while release builds of an application store the debug symbols in a companion dSYM file to reduce the binary size.

默认情况下,应用程序的调试版本将调试符号存储在已编译的二进制文件中,而应用程序的发布版本将调试符号存储在配套的 dSYM 文件中以减小二进制文件的大小。

The Debug Symbol file and application binary are tied together on a per-build-basis by the build UUID. A new UUID is generated for each build of your application and uniquely identifies that build. Even if a functionally-identical executable is rebuilt from the same source code, with the same compiler settings, it will have a different build UUID.

调试符号文件和应用程序二进制文件通过构建 UUID 以每个构建为基础绑定在一起。为应用程序的每个构建生成一个新的 UUID,并唯一标识该构建。即使使用相同的编译器设置从相同的源代码重建功能相同的可执行文件,它也会具有不同的构建 UUID。

For example, if you have a library libfoo.dylib, the debug symbol file would be libfoo.dylib.dSYM.

From here

例如,如果您有一个库 libfoo.dylib,则调试符号文件将是 libfoo.dylib.dSYM。

这里

So long story short

长话短说

  • DWARFis just a debug file

  • DWARF with dSYM Fileis a debug file along with symbolification file

  • DWARF只是一个调试文件

  • 带有 dSYM 文件的 DWARF是一个调试文件和符号文件



Pro tip:

专家提示:

On our project's GitHub repo, on the releases section we have something like this:

在我们项目的 GitHub 存储库中,在发布部分,我们有这样的内容:

enter image description here

在此处输入图片说明

We manually upload the .ipaand dysmfile so then if 3 months from now a user has a weird crash for our 10.16 build then we'd go to this release branch and run it with this dsym and try to reproduce the issue.

我们手动上传.ipadysm文件,所以如果 3 个月后用户在我们的 10.16 版本中遇到奇怪的崩溃,那么我们将转到此发布分支并使用此 dsym 运行它并尝试重现该问题。

回答by dengApro

DWARF (debugging with attributed record formats) is a debugging file format used by many compilers and debuggers to support source-level debugging. It is the format of debugging information within an object file. The DWARF description of a program is a tree structure where each node can have children or siblings. The nodes might represent types, variables, or functions.

DWARF(使用属性记录格式进行调试)是一种调试文件格式,许多编译器和调试器使用它来支持源代码级调试。它是目标文件中调试信息的格式。程序的 DWARF 描述是一个树结构,其中每个节点都可以有子节点或兄弟节点。节点可能代表类型、变量或函数。

source: https://www.ibm.com/developerworks/aix/library/au-dwarf-debug-format/index.html

来源:https: //www.ibm.com/developerworks/aix/library/au-dwarf-debug-format/index.html



DWARF with dSYM File stores the debug symbols for your app

带有 dSYM 文件的 DWARF 存储应用程序的调试符号

Services like crashlytics use it to replace the symbols in the crash logs with the appropriate methods names so it will be readable and will make sense.

像 crashlytics 之类的服务使用它来用适当的方法名称替换崩溃日志中的符号,因此它是可读的并且有意义的。

source : What's the dSYM and how to use it? (iOS SDK)

来源:什么是 dSYM 以及如何使用它?(iOS SDK)

回答by Viton Zhang

From "Project Editor Help":

从“项目编辑器帮助”:

Debug Information Format (DEBUG_INFORMATION_FORMAT)

调试信息格式 (DEBUG_INFORMATION_FORMAT)

The type of debug information to produce.

要生成的调试信息的类型。

DWARF: Object files and linked products will use DWARF as the debug information format. dwarf

DWARF:目标文件和链接产品将使用 DWARF 作为调试信息格式。矮人

DWARF with dSYM File: Object files and linked products will use DWARF as the debug information format,and Xcode will also produce a dSYM file containing the debug information from the individual object files (except that a dSYM file is not needed and will not be created for static library or object file products). dwarf-with-dsym

带有 dSYM 文件的 DWARF:目标文件和链接产品将使用 DWARF 作为调试信息格式,并且 Xcode 还将生成一个 dSYM 文件,其中包含来自各个目标文件的调试信息(除非不需要并且不会创建 dSYM 文件)用于静态库或目标文件产品)。dsym 矮人