dSYM中未包含iOS静态库调试符号 [英] iOS Static Library Debug Symbols not being in included in dSYM

查看:347
本文介绍了dSYM中未包含iOS静态库调试符号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一系列iOS应用程序,这些应用程序将共享一个通用代码库.我已经将通用代码库开发为静态库,并且希望将其调试符号包含在主应用程序的.dSYM文件中.我的理解是这是可能的,但是我还没有开始工作.

I'm working on a series of iOS apps which will share a common codebase. I've developed the common codebase as a static library and want it's debug symbols included in the primary app's .dSYM file. My understanding is that this is possible, but I have not gotten it working yet.

其自身项目中的通用代码库,该库具有一个静态库作为目标.该项目被拖到主应用程序的项目中.在主应用程序目标的构建阶段中,我将静态库作为目标依赖项添加到了与库链接二进制文件"下.该项目将根据需要构建并运行.

The common codebase in its own project which has a static library as a target. This project is dragged into the primary app's project. In the primary app's target's Build Phases I've added the static library as a Target Dependency and under Link Binary With Libraries. The project builds and runs as desired.

现在,如果我从主项目中生成档案,则可以在Finder中查看该档案,并且其中包含一个.dSYM文件,该文件可用于表示崩溃日志.但是,.dSYM仅包含主要应用程序的符号,而不包含静态库的符号.为了对此进行过度确认,我运行了以下命令:

Now, if I generate a archive from the main project, I can view that archive in Finder, and it contains a .dSYM file that can be used to symbolicate crash logs. However, the .dSYM only contains symbols for the primary app, not for the static library. To over-confirm this, I ran the following:

dwarfdump /path/to/app.dSYM

并且输出(大部分)不包含静态库中的任何符号.我发现的唯一例外是我的主项目的AppDelegate是静态库中对象的子类,并且.dSYM中有该超类的条目.但是,没有其他类别.

And the output (mostly) did not contain any symbols from the static library. The only exception I have found is that my primary project's AppDelegate is a subclass of an object in the static library, and there are entries for that super class in the .dSYM. However, none of the other classes are present.

在静态库项目的目标的构建设置"中,我进行了以下设置:

In the static library's project's target's Build Settings, I have set the following:

  • 复制过程中的条形调试符号:否
  • 带状链接产品:否
  • 生成调试符号:是
  • 默认隐藏的符号:否

如果有人可以提供一些指导,我将不胜感激.

If anyone can offer some guidance, I would greatly appreciate it.

推荐答案

静态lib符号 do 显示在应用程序的dSYM文件中,而dwarfdump会显示出来.

Static lib symbols do show up in an app's dSYM file, and dwarfdump will reveal that.

 dwarfdump -a path/to/app.dSYM >dsymAsText.txt

这应该向您显示lib的符号.

That should show you the lib's symbols.

但是,如果您(就像我最近一样)正在寻找要与静态库一起生成的符号表,那么我得出的结论是,它将毫无用处.一旦将其编译到新的应用程序中,这些符号和地址都将更改,并且您的所有设置都将具有完全不同的偏移量(如果我错了,请纠正我).

However if you are (as I have been recently) looking for a symbol table to be generated to go along with just your static lib, I have come to the conclusion that it will be fairly useless; once it get compiled into a new app those symbols and addresses will all change and you will have an entirely different offset for everything (please someone correct me if I'm wrong).

我不完全确定有办法解决这个问题.

I'm not entirely sure there's a way to get around that part.

这篇关于dSYM中未包含iOS静态库调试符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆