如何重置VisualStudio(VS2010,VS2012)调试器缓存? [英] How to reset the VisualStudio (VS2010, VS2012) debugger cache?

查看:2101
本文介绍了如何重置VisualStudio(VS2010,VS2012)调试器缓存?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图使用Qt调试一个大项目,但我有调试的问题。
此问题相同,但答案有没有帮助,我使用VS2010所以我不能安装修复提到那里。

我转载了VS2008的问题(以及解决方案,见下文)

I'm trying to debug a large project using Qt, but I have problems debugging. It's the same as in this question, but the answers there didn't help and I'm using VS2010 so I can't install the fix mentioned there.
I reproduced the problem with VS2008 (as well as the solution, see below).

>问题:


  • 成员变量的鼠标悬停和local窗口内容错误(与上面链接的问题相比)。

  • 鼠标悬停和本地窗口内容显示旧成员名称。我将一个变量从'size'重命名为'sizeMm',调试器仍然显示'size'。

这里是我试过的:


  • 重新启动Visual Studio

  • 清除并重建了我的项目文件夹

  • 尝试了不同的项目设置再次)

  • 手动删除.obj文件

  • 手动删除了.sdf文件


  • 中的成员从类

    中删除了大多数Qt代码 EDIT:

  • Neil Kirk在一个答案中建议,我尝试编译器选项/ Z7,/ Zi和/ ZI。

    / Z7应该将调试信息写入目标文件。

  • 已删除所有./Debug目录中的所有内容

  • restarted Visual Studio
  • cleaned and rebuilt my project folder
  • tried different project settings (e.g. turning optimizations on and off again)
  • manually deleted the .obj files
  • manually deleted the .sdf file
  • reordered the members in the class
  • removed most Qt code from the class
    EDIT :
  • as Neil Kirk suggested in an answer, I tried the compiler options /Z7, /Zi and /ZI.
    /Z7 is supposed to write the debug information into the object files.
  • deleted all content in all ./Debug directories

调试程序必须资源。但是从哪里?

The debugger must take its information from another source. But from where?

我需要做些什么来使调试器清除缓存,重新扫描我的类并更新其内部信息? >

What do I have to do to make the debugger clear its cache, re-scan my class and update its internal information?

目前的调查状态:

我发现大约有6个地方,例如 ipch 文件夹/文件。但仍然没有成功。

我对每个硬盘驱动器运行全文搜索。它在我删除的其他项目中找到一些pdb文件。

现在我修复了错误,但我没有找到它。

Current investigation status:
I found about 6 places where the information could have been, e.g. the ipch folder / files. But still no success.
I ran a fulltext search against each hard drive. It found some pdb files in other projects that I deleted.
Now I fixed the bug, but I didn't find it.

VS2012问题仍然存在。 pdb文件现在名为 vc110.pdb

The problem persists with VS2012. The pdb files are now named vc110.pdb, though.

推荐答案

全文搜索找到一些 .pdb 文件(主要是vc100.pdb),部分在链接到同一个lib的其他项目的目录中,其中包含旧的符号名称。

A fulltext search found some .pdb files (mostly vc100.pdb), partially in directories of other projects linking to the same lib, which contained old symbol names.

我删除了所有找到的 .pdb (和 .idb )文件,重新编译,现在它再次显示正确的行为。

I deleted all found .pdb (and .idb) files, recompiled and now it shows correct behavior again.

遇到相同问题的人应该尝试这个解决方案。

Whoever experiences the same problem should try this solution.

//Yet I have no answers as to
//- where exactly the debugger searches for its information and
//- in which way the pdb files are (re)created and interconnected and
//- how the problem came to be in the first place.

编辑

我能够重现这个问题。我想我知道发生了什么:

I was able to recreate the problem. And I think I know what happened:

我包括几个基于一个公共基础库的lib。如果我重新编译它们,基础库中的变化只会反映在其他包含的libs中。如果我在基本库中的一些小改变后不重建这些库(在我的例子:添加一个成员到类),适当的 vc100.pdb 文件保持不变。因为包含路径被设置为该库的目录,所以它的vc100.pdb文件似乎被VS调试器使用。

I'm including several libs that are based on a common base lib. Changes in the base lib only get reflected in the other included libs if I rebuild them. If I don't rebuild these libs after some minor change in the base lib (in my case: adding a member to a class), the appropriate vc100.pdb file remains unchanged. Because an include path is set to that library's directory, its vc100.pdb file seems to be used by the VS debugger.

解决方案是删除这些vc100.pdb文件或重建所有库。

The solution is to delete these vc100.pdb files or to rebuild all libraries.

VS2012

文件名从版本更改为版本。 VS2012使用 vc110.pdb 等。我现在删除代码目录+子目录中的所有* .pdb文件。

The file names change from version to version. VS2012 uses vc110.pdb and so on. I now delete all *.pdb files in the code directory + subdirectories.

这篇关于如何重置VisualStudio(VS2010,VS2012)调试器缓存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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