简体   繁体   English

Visual Studio调试器会降低内联代码的速度

[英]Visual Studio debugger slows down in in-line code

Since I upgraded to Visual Studio 2008 from vs2005, I have found a very annoying behaviour when debugging large projects. 自从vs2005升级到Visual Studio 2008之后,在调试大型项目时发现了一个非常烦人的行为。 If I attempt to step into inline code, the debugger appears to lock up for tens of seconds. 如果我尝试进入内联代码,调试器似乎会锁定数十秒钟。 Each time that I step inside such a function, there is a similar pause. 每当我进入此类功能时,都会有类似的停顿。 Has anyone experienced this and is anyone aware of a work around? 有没有人遇到过这种情况,并且有人知道可以解决吗?

Postscript: 后记:

After learning that MS had a service pack for vs2008 and needing to get it because of other compiling issues, the problem that I was encountering with the debugger was resolved. 在得知MS具有适用于vs2008的Service Pack并由于其他编译问题而需要获得该Service Pack之后,解决了我在调试器中遇到的问题。

I used to get this - I think it's a bug with the 'Autos' debug window: 我曾经得到这个-我认为这是“自动”调试窗口中的错误:

http://social.msdn.microsoft.com/Forums/en-US/vsdebug/thread/eabc58b1-51b2-49ce-b710-15e2bf7e7516/ http://social.msdn.microsoft.com/Forums/en-US/vsdebug/thread/eabc58b1-51b2-49ce-b710-15e2bf7e7516/

I get delays like this when debugging ASP.NET apps and it seems to happen when a symbol(pdb) file is getting accessed in the background. 在调试ASP.NET应用程序时会出现这样的延迟,并且似乎是在后台访问symbol(pdb)文件时发生的。 The larger the library, the longer the wait. 库越大,等待时间越长。 My delay is at most about 10 seconds, but it does seem to happen with symbols that have already been accessed. 我的延迟最多约为10秒,但似乎确实发生在已访问的符号上。

I do get a lot of 1-3 second waits when i try to step over items that cause VS to give me the "Step into Specific" message ( http://blogesh.wordpress.com/category/visual-studio-2008/ #3). 当我尝试跳过导致VS给我“具体步骤”消息的项目时,我确实得到了1-3秒的等待时间( http://blogesh.wordpress.com/category/visual-studio-2008/ #3)。 Perhaps this may be causing a real blow up for you. 也许这可能会给您带来真正的打击。

值得一看的是,Visual Studio 2008 Service Pack 1中似乎已解决了该问题。

As a workaround, you could use something like this for debugging purposes: 作为一种解决方法,您可以将以下内容用于调试目的:

#ifdef _DEBUG
  #define INLINE
#else
  #define INLINE inline
#endif

For extra neatness you can place the functions in a separate .inc file that is included either in the header or the cpp file depending on build type. 为了更加简洁,您可以将函数放在单独的.inc文件中,该文件包含在标头或cpp文件中,具体取决于构建类型。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM