为什么有些可执行文件和库引用 PDB 文件而有些则不引用

发布于 2024-09-24 19:04:15 字数 160 浏览 7 评论 0原文

在开发我自己的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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

腻橙味 2024-10-01 19:04:15

您询问“最佳解决方案”,但没有说出什么问题的解决方案。
如果指定 /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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文