dSYM文件是什么 ?

在这里插入图片描述

Overview 概述

dSYM的全称是debug symbol, 所以dSYM文件就是debug symbol (dSYM) file, dSYM文件中的每个 debug symbol, 对应了一个关系, 这个关系一端是源代码里真实的符号(类名称、全局变量以及方法和函数名称), 另一端则是其定义的文件号和行号.

Apple Documentation 苹果文档

When Xcode compiles your source code into machine code, it generates a list of symbols1 in your app — class names, global variables, and method and function names. These symbols correspond to the file and line numbers where they’re defined; this association creates a debug symbol, so you can use the debugger in Xcode, or refer to2 line numbers reported by a crash report. Debug builds of an app place the debug symbols inside the compiled binary file by default, while release builds of an app place the debug symbols in a companion debug symbol (dSYM) file to reduce the size of the distributed app.

Each binary file in an app — the main app executable, frameworks, and app extensions — has its own dSYM file. The compiled binary and its companion dSYM file (配套dSYM文件) are tied together by a build UUID that’s recorded by both the built binary and dSYM file. If you build two binaries from the same source code but with different Xcode versions or build settings, the build UUIDs for the two binaries won’t match. A binary and a dSYM file are only compatible with each other when they have identical (完全相同的) build UUIDs. Keep the dSYM files for the specific builds you distribute, and use them when diagnosing issues from crash reports.

DWARF 是什么 ?

Xcode

熟悉 Xcode > Build Settings 的同学一定记得 Build Options > Debug Information Format 的两个选项: DWARF 和 DWARF with dSYM File
Debug Information Format

Wikipedia

DWARF3 is a widely used, standardized debugging data format. 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 had no official meaning, although the backronym4 “Debugging With Arbitrary Record Formats” has since been proposed.


  1. 此处的 symbol 并非指 dSYM 文件中的 debug symbol, 而是 source code 中的真实符号 ; ↩︎

  2. refer to, 这里表示"查阅", 文中的意思是根据dSYM文件内的 debug symbol, 就可以查阅 crash report 中的 line numbers 具体指的是什么 ; ↩︎

  3. DWARF in Wikipedia ; ↩︎

  4. 提到 backronym 这个词, 就不得不说 acronym, 简单来说 acronym 是取不同单字的第一个字母结合一起;而反之backronym 是先有字母再「伸展出」(回推) 不同的单字, 它是由 backwards 与acronym 组合创造而成, 感兴趣可以看下 YouTube 上的详细来龙去脉 ; ↩︎

  • 3
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 4
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

依旧风轻

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值