如何调试 Intel C++来自托管代码的库?
我有一个 C#/NUnit 测试调用到使用 Intel C++ 编译器(版本 12,我相信)编译的 C++ 库。我已经获得了 PDB,禁用了“仅我的代码”,启用了非托管代码调试。尽管如此,普通的调试仍然不起作用——它说它还没有获得源代码并提供反汇编。
另外:我在做这个工作时经常遇到VS2010崩溃的情况。
只是好奇是否有人遇到过这个问题。
I've got a C#/NUnit test calling into a C++ library compiled using the Intel C++ compiler (version 12, I beleive). I've got the PDB, disabled 'Just My Code', enabled Unmanaged Code Debugging. Still, ordinary debugging doesn't work - it says it hasn't got the sources and offers to show disassemly.
In addition: I'm constantly experiencing VS2010 crashing while working on this.
Just curious whether anyone has encountered this problem.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
PDB 文件需要位于加载程序集的同一目录中。 NUnit 将测试 dll 复制到临时目录并从那里加载它 - 它是否复制了 PDB。
一种检查方法是使用 ProcMon(它可以显示所有文件访问)并过滤 PDB 文件以查看它尝试从何处加载它。 ProcMon 可从 MS 免费获取:
http://technet.microsoft.com/en-us /sysinternals/bb896645
The PDB file needs to be in the same directory that the assembly is loaded out of. NUnit copies the test dll to a temp directory and loads it from there -- did it copy the PDB.
One way to check is to use ProcMon (which can show all file accesses) and filter for PDB files to see where it's trying to load it from. ProcMon is available for free from MS:
http://technet.microsoft.com/en-us/sysinternals/bb896645
没有神奇的解决方案。您需要源代码才能在源代码级别单步调试代码。
您应该能够单步执行汇编代码,但根据您的 ASM 熟练程度,这可能不是很有帮助。 ;)
如果您无法访问源代码,您只需尽力而为,调试您可以看到的代码。
There is no magic solution. You need the source code in order to step through the code at the source-level.
You should be able to step through the assembly code, but depending on your ASM proficiency, that might not be very helpful. ;)
If you don't have access to the source code, you just have to do the best you can, debugging the code you can see.