为什么有些可执行文件和库引用 PDB 文件而有些则不引用
在开发我自己的PE分析工具期间,我注意到一些exe和库(例如Adobe Reader)引用了Debug PDB文件。有些根本不引用任何 PDB 文件。有些具有显示构建计算机上的目录的完整路径,有些具有相对路径,有些仅具有 PDB 文件名。最好的解决方案是什么?根本没有PDB,只引用相对路径,引用完整路径?
During the development of my own PE analysing tool, I noticed that some exe and libraries (e.g. Adobe Reader) reference a Debug PDB file. Some do not reference any PDB file at all. Some with the full path showing the directory on the build machine, some with the relative path, some just with the PDB file name. What is the best solution? No PDB at all, only reference to the relative path, the reference to the full path?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您询问“最佳解决方案”,但没有说出什么问题的解决方案。
如果指定 /debug 开关并且使用调试信息(/Zi 或 /ZI)编译目标文件,则链接器将添加 PDB 记录。它是相对的还是绝对的取决于它的构建方式。我认为 Microsoft 有一个内部工具可以编辑路径,这样您就可以在最终的 .exe 中看到文件名。由于它是由 GUID 标识的,因此实际路径并不是很重要。
You ask about "best solution" but did not say solution for what problem.
The PDB record is added by the linker if you specify /debug switch and the object files were compiled with debug info (/Zi or /ZI). Whether it's relative or absolute depends on the way it way it was built. I think Microsoft has an internal tool to edit the path, so that you might see just the filename in the final .exe. Since it's identified by a GUID, the actual path is not very important.