查找 C++ 的符号源文件

发布于 2024-08-09 04:45:50 字数 270 浏览 8 评论 0原文

我有一个项目是C++ WIN32项目。我发现了一个问题 有些符号可以被windbg识别,但有些则不能。我不 知道为什么。 其特点是:

1)都是C++方法

2)两个函数都在一个.cpp文件中

3)两个函数在源文件中非常接近并且两者都不是 它们被 #ifdef 包围

4) 我已经使用 dbh.exe 来检查符号,符号在 Windbg 也不在 pdb 文件中。

我猜测符号丢失是否可能是由于继承的原因 班级? 请推荐,谢谢! 垃圾桶

I have a project that is C++ WIN32 project. I found a problem that
some symbol can be recognized by the windbg but some don't. I don't
know why.
The characteristics are:

1) both are C++ method

2) both function are in one .cpp file

3) the two functions are very close in the source file and neither of
them are enclosed by a #ifdef

4) I have used dbh.exe to check the symbol, the symbol missing in the
windbg is also not in the pdb file.

I am guessing if the symbol missing may due to the inheritance of the
class?
Please suggest, thanks!
Bin

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

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

发布评论

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

评论(3

剩余の解释 2024-08-16 04:45:50

如果你不使用函数,只要它不是虚函数,它就可能被链接器deadstripped。未使用的全局数据对象也可能被删除。

If you don't use a function, as long as it is not a virtual function, it may be deadstripped by the linker. Unused global data objects may be deadstripped as well.

绝不放开 2024-08-16 04:45:50

该函数是否被调用过?

提供更多关于为什么您认为这是“由于类的继承”的详细信息可能会有所帮助

Is the function ever called?

It might help to give some more details on why you think it is "due to the inheritance of the class"

山田美奈子 2024-08-16 04:45:50

听起来源代码可能与 PDB 文件不兼容。

也许该功能是在生成PDB文件后添加的?

您可以通过以下方式验证这一点:

  1. 将断点添加到您知道将执行的代码行。
  2. 单步调试代码并确保调试器不会在任何空白代码行处停止(这意味着代码和 PDB 文件之间不匹配)。

我建议的第一件事是重建源代码,看看是否可以解决问题。

如果这不起作用,请提供更多信息,以便我们帮助您进一步诊断。

It sounds like the source code may be incompatible with the PDB files.

Maybe the function was added after the PDB file was generated?

You can validate this by:

  1. Add a break point to a line of code that you know will be executed.
  2. Step through the code and ensure that the debugger doesn't stop on any blank lines of code (this would imply a mismatch between code and PDB file).

The first thing I would suggest is to rebuild the source code to see if that fixes the problem.

If this doesn't work, please provide more information to allow us to help you diagnose this further.

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