在Windows 7上的.NET源代码调试 [英] .NET source debugging on Windows 7

查看:132
本文介绍了在Windows 7上的.NET源代码调试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正尝试通过的SQL Server Compact 问题调试在Windows 7 RTM企业( 64位)桌面运行 .NET 框架3.5,SP1。该应用程序是一致的崩溃,我们正在试图建立的.NET Framework调试的Visual Studio 2008,SP1。使用在互联网的资源分散,我们设置选项:

We are trying to debug through a SQL Server Compact issue on a Windows 7 Enterprise RTM (64-bit) desktop running the .NET Framework 3.5, SP1. The application is crashing consistently, and we are trying to set up .NET Framework debugging for Visual Studio 2008, SP1. Using the scattered resources around the Internet, we set the options:

  • 符号服务器= http://referencesource.microsoft.com/symbols
  • 菜单的工具的 - >的选项的 - >的调试的 - >的只是我的 code 的=禁用
  • 菜单的工具的 - >的选项的 - >的调试的 - >的启用 .NET框架调试的=启用
  • 工具的 - >的选项的 - >的调试的 - >的已启用 源服务器支持的=启用
  • Symbol Server = http://referencesource.microsoft.com/symbols
  • Menu Tools -> Options -> Debugging -> Just My code = Disabled
  • Menu Tools -> Options -> Debugging -> Enable .NET Framework Debugging = Enabled
  • Tools -> Options -> Debugging -> Enabled Source Server Support = Enabled

当我们运行应用程序,我们无法踏入源,我们仍然得到错误

When we run the application, we are unable to step into the source and we still get the error

没有源$ C ​​$ C在这个位置。

There is no source code at this location.

我们做得到表明SQL Server精简符号已加载的堆栈跟踪,当我们点击错误对话框上的细节,我们得到了一个消息,表明SQL Server精简版的 PDB 文件加载正确。

We do get the stack trace indicating that the SQL Server Compact symbols have loaded and when we click the details on the error dialog, we get a message indicating that the SQL Server Compact PDB file was loaded correctly.

我没有找到一个博客后,表示这是一个问题的符号不被更新 对于Windows 7,但是,的 <一个href="http://software.intel.com/en-us/blogs/2009/09/07/visual-studio-2008-sp1-net-framework-source-debugging/"相对=nofollow>的Visual Studio 2008 SP1的.NET Framework源代码调试 的。

I did find a blog post indicating that this is an issue with the symbols not being updated for Windows 7, yet, Visual Studio 2008 SP1 .NET Framework Source Debugging.

不过,我找不到任何官方的这个问题。有什么我失踪?这是真的,Windows 7的符号是不正确。如果是的话,他们什么时候更新?

However, I cannot find anything official about this issue. Is there anything I'm missing? Is it true that Windows 7 symbols are being incorrect. If so, when will they be updated?

我的Windows 7版本是64位。我们还刚刚测试此相同的情况下在Windows Vista 64位,并获得了同样的问题和错误。它说,它加载的PDB,但它声称没有源$ C ​​$ C的位置。

My Windows 7 build is 64-bit. We also just tested this same scenario on Windows Vista 64-bit and received the same problem and error. It says that it loaded the PDB, but it claims there is no source code at the location.

推荐答案

我的猜测是,你的DLL文件发布版本,所以JIT编译器优化掉一些函数调用(这常常内联小函数)。这意味着,当运行时尝试从即时编译code回到PDB翻译,它被混淆。

My guess is that your DLL files are release build, and so the JIT compiler is optimising away some of the function calls (it often inlines small functions). That means that when the runtime tries to translate from the jitted code back to the PDB, it gets confused.

尝试添加一个.ini文件到您的应用程序根目录;所以如果你的应用程序是 prog.exe 添加 prog.ini ,其内容如下;

Try adding an .ini file to your application root; so if your app is prog.exe, add prog.ini with the following content;

[.NET Framework Debugging Control] 
GenerateTrackingInfo=1
AllowOptimize=0

这将停止JIT编译器优化掉了电话,并让您的PDB文件是指在code中的正确调用。你需要重新启动应用程序,因为它没有的优化运行,它会减慢它来调试生成的水平,但你应该能够正确地附加调试。

This will stop the JIT compiler from optimising away the calls, and let your PDB files refer to the correct calls in your code. You'll need to restart the application, and because it's running without optimisations, it'll slow it down to DEBUG build levels, but you should be able to attach the debugger correctly.

这篇关于在Windows 7上的.NET源代码调试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆