符号文件和调试

发布于 2024-09-14 21:10:09 字数 258 浏览 7 评论 0原文

假设我有一个用 VC++ 6.0 编写的自定义服务,并且我已将其作为特定版本的一部分提供。不幸的是我在构建二进制文件时没有获取 pdb。

后来,我的客户报告了一次崩溃,我必须让 pdb 来确定崩溃原因。我现在使用的 pdb 足以确定崩溃点吗?

换句话说,我分别获取了二进制文件和 pdb,但是在获取二进制文件后我没有对源代码进行任何更改。

我的理解是,即使他的符号在构建时的日期和时间方面不会匹配,但在内容方面它会匹配。

我的理解正确吗?

Assume i have a custom service written in VC++ 6.0 and i have shipped it as part of a particular release. Unfortunately i did not take the pdb while building the binary.

At a later point of time my customer reported a crash and i had to get the pdb to identify the crash cause. Will a pdb that i take now be enough to identify the point of crash.

In other words i have taken binary and pdb separately however i did not make any changes to the sourcecode after taking the binary.

My understanding is that even thought he symbols wont match in terms of date and time when they were built but in terms of the content it will match.

Is my understanding correct?

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

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

发布评论

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

评论(3

哎呦我呸! 2024-09-21 21:10:09

您需要确保使用完全相同的编译器版本(补丁可能会更改代码生成和地址)、编译器/链接器选项集、相同的库版本以及相同的源进行编译,以确保地址匹配。如果您能够做到这一点,那么您应该能够获取稍后生成的 pdb。

然而,即使它不完全匹配,它也可能让您足够接近以通过检查看到错误。

You'll need to make sure you compiled with exactly the same compiler version (patches could change code generation and addresses), set of compiler/linker options, the same library versions as well as the same source to make sure the addresses match. If you're able to do that then you should be able to take a pdb generated later.

However even if it doesn't match exactly it's possible that it gets you close enough to see the bug by inspection.

凤舞天涯 2024-09-21 21:10:09

是的,这应该仍然可以毫无问题地工作(不过,如果没记错的话,您可能会收到有关时间戳不匹配的警告)。

Yes, that should still work without a problem (though, if memory serves, you can expect a warning about the mismatched time-stamps).

夏有森光若流苏 2024-09-21 21:10:09

如果 .pdb 和二进制文件是从相同的源代码构建的,即使不是同时构建,它们也应该能够完美地协同工作。但是您将无法在任何调试器中加载它。例如,Visual Studio 调试器将拒绝加载它,因为它会说它们不匹配。

您需要一个可以接受不匹配符号的调试器,例如 WinDbg。要加载不匹配的符号,请键入魔术命令 symopt +0x40。

The .pdb and the binary should be able to work together perfectly if the were built from the same source code even if not at the same time. However you will not be able to load this in any debugger. For example, the Visual Studio debugger will refuse to load it because it will say they are mismatched.

You need a debugger that can accept mismatched symbols such as WinDbg. To load with mismatched symbols type the magic command symopt +0x40.

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