使用 VS 2005 编译时如何使用 dumpbin /symbols 获取源文件信息?

发布于 2024-08-13 08:23:57 字数 543 浏览 2 评论 0原文

我有一个工具,它使用 dumpbin /symbols 的输出来对我们的 C/C++ 库进行一些依赖性分析。当我们使用 VS 6.0 编译库时,dumpbin COFF SYMBOL TABLE 包含一些条目,例如

000 00000008 DEBUG  notype       Filename     | .file
    x:\mydir\mysource.c

允许我获取源和定义/使用的符号之间的关系,这对于我的工具至关重要。 当我们用 VS 2005 编译时,这些条目丢失了。当我用十六进制编辑器查看库时,二进制文件中似乎根本不包含文件名信息,因此这似乎不是一个愚蠢的问题,而是与编译相关。所以我正在寻找一种方法,在使用 VS 2005 进行编译时将文件名条目放回我的库中。


谢谢 Scott。

调试帮助 API 看起来很有趣,但我还无法弄清楚如何获取与我能够从 COFF 中提取的相同信息,即。对于每个符号

  1. ,定义它的源文件
  2. 以及使用该符号的源文件列表

有任何指针吗?

I have a tool which uses the output of dumpbin /symbols to do some dependency analysis with our C/C++ libraries. When we compiled the libs with VS 6.0, the dumpbin COFF SYMBOL TABLE contained entries like

000 00000008 DEBUG  notype       Filename     | .file
    x:\mydir\mysource.c

allowing me to get the relationship between sources and defined/used symbols, which is essential for my tool.
When we compile with VS 2005, these entries are missing. When I look at the libs with a hex editor, it seems that there is no filename information at all included in the binary files, so it seems not to be a dumbin problem but is compilation related. So I'm looking for a way to get the Filename entries back into my libraries when compiling with VS 2005.


Thanks Scott.

The Debug Help API looks interesting, but I wasn't able yet to figure out how to get the same information I was able to extract from the COFF, ie. for each symbol

  1. the source file that defines it
  2. and the list of source files using the symbol

Any pointers on this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

云淡风轻 2024-08-20 08:23:57

VS 2005 不发出 COFF 调试信息。 Microsoft 已弃用它,转而使用 PDB。这意味着它们不再生成它,并且最终 link.exe 将停止使用它。

您可以使用调试帮助 API 读取 PDB 信息。

http://msdn.microsoft.com/en-us /library/ms679309(VS.85).aspx

VS 2005 doesn't emit COFF debugging information. Microsoft has deprecated it in favor of PDBs. That means they no longer produce it, and eventually link.exe will stop consuming it.

You can read PDB information using the debug help API.

http://msdn.microsoft.com/en-us/library/ms679309(VS.85).aspx

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