阻止 Visual Studio 尝试加载特定 DLL 的符号

发布于 2024-07-20 02:03:10 字数 532 浏览 8 评论 0原文

我已将 Visual Studio 2005 设置为使用 Microsoft 的符号服务器。 我还安装了 UltraMon,它将钩子 DLL 注入每个进程。 每当我开始调试我的 MFC 应用程序时,Visual Studio 都会说:

"Loading symbols for C:\Program Files\UltraMon\RTSUltraMonHookX32.dll..."

从眨眼到几十秒。 它永远不会找到那些符号......我可以告诉它不要费心寻找吗?

(我尝试创建一个空的 RTSUltraMonHookX32.pdb 文件,但 Visual Studio 发现它不好并继续查找。)

I have Visual Studio 2005 set up to use Microsoft's symbol servers. I also have UltraMon installed, which injects a hook DLL into every process. Whenever I start debugging my MFC application, Visual Studio says:

"Loading symbols for C:\Program Files\UltraMon\RTSUltraMonHookX32.dll..."

for anything from the blink of an eye to several tens of seconds. It's never going to find those symbols... Can I tell it not to bother looking?

(I tried creating an empty RTSUltraMonHookX32.pdb file, but Visual Studio sees that it's not good and carries on looking.)

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

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

发布评论

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

评论(10

碍人泪离人颜 2024-07-27 02:03:10

您无法以非常细粒度的方式执行此操作,但您可以禁用自动符号加载,然后通过“模块”窗口(调试 -> Windows -> 模块)手动选择要加载的符号。

禁用自动符号加载

  • 工具 -> 选项-> 调试-> 符号
  • 勾选“仅在手动加载符号时搜索上述位置”

You can't do this in a very fine grained fashion but you can disable automatic symbol loading and then manually choose the symbols to load via the Modules window (Debug -> Windows -> Modules).

To Disable Automatic Symbol loading

  • Tools -> Options -> Debugging -> Symbols
  • Check "Search the above locations only when symbols are loaded manually"
嘿咻 2024-07-27 02:03:10

另请检查您是否没有“_NT_SYMBOL_PATH”环境变量。 如果你有这个 var 符号,无论 VS 设置如何都会加载。

Also check that you have no "_NT_SYMBOL_PATH" environment variable. If you have this var symbols will load regardless of VS settings.

深海夜未眠 2024-07-27 02:03:10

从 Visual Studio 2010 开始,您可以转到:

Tools -> Options -> Debugging -> Symbols -> Specify excluded modules

并输入加载时间过长的 dll 列表。 我使用输出窗口给出的完整路径; 也许它接受通配符或简单的文件名。

From Visual Studio 2010 onwards, you can go to:

Tools -> Options -> Debugging -> Symbols -> Specify excluded modules

and enter the list of the dlls which take too long to load. I use the full path, given by the Output Window; maybe it accepts wildcards or simple file names.

妞丶爷亲个 2024-07-27 02:03:10

就我而言,这是因为我已将“启用 .Net 源步进”设置为 true,而

Tools > Options > Debugging > General. 

不是将其设置为 false,而是将“仅启用我的代码”设置为 true,这会自动设置“启用 .Net”源步进”为 false。 在这样做之前,它给了我一个警告:

Enabling Just my code automatically disabled .Net framework source stepping

这表明 Just My Code.Net 源代码步进互斥的

我希望这可以帮助别人。

In my case it was because I had set "Enable .Net Source Stepping" to true in

Tools > Options > Debugging > General. 

Rather than setting it to false, I set "Enable Just My Code" to true which automatically set "Enable .Net Source Stepping" to false. It gave me a warning before doing so:

Enabling Just my code automatically disabled .Net framework source stepping

Which suggests Just My Code and .Net source stepping are mutually exclusive.

I hope this helps someone.

离线来电— 2024-07-27 02:03:10

如果你进入调试选项-> 符号然后选中“仅加载指定的符号”,它不会自动加载符号并且调试器工作没有问题。

If you go to Debug Options -> Symbols and then check "load only specified symbols" , it won't load symbols automatically and the debugger works without problem.

孤单情人 2024-07-27 02:03:10

您还可以在 HKEY_CURRENT_USER\Software\Microsoft\Symbol Server\Exclusions 或 HKEY_LOCAL_MACHINE\Software\Microsoft\Symbol Server\Exclusions 中或通过位于 %WINDIR%\ 的 .ini 文件中设置不会尝试下载的符号服务器排除项。 system32\inetsrv\Symsrv.ini(使用标题 [exclusions] 并将每个排除项放在自己的行上)。 排除是简单的模式匹配,因此请使用 msxml5.* 例如。

You can also set up symbol server exclusions which will not be attempted to download in HKEY_CURRENT_USER\Software\Microsoft\Symbol Server\Exclusions or possibly also HKEY_LOCAL_MACHINE\Software\Microsoft\Symbol Server\Exclusions or via a .ini file at %WINDIR%\system32\inetsrv\Symsrv.ini (use the header [exclusions] and put each exclusion on its own line). The exclusions are simple pattern matches, so use msxml5.* for example.

酷遇一生 2024-07-27 02:03:10

不仅 _NT_SYMBOL_PATH 会导致这种行为,而且对我来说,是 _NT_ALT_SYMBOL_PATH 环境变量导致了延迟。

(我相信我在尝试 WinDbg 时添加了这个变量)

Not only the _NT_SYMBOL_PATH can cause this behavior, but for me it was the _NT_ALT_SYMBOL_PATH environment variable that was causing the delays.

(I believe I added this variable when experimenting with WinDbg)

御守 2024-07-27 02:03:10

在Visual Studio 2013 Pro中,如果选中了Microsoft Symbol Server,VS将尝试加载其服务器上的所有符号,从而导致大量额外时间。

In Visual Studio 2013 Pro, if the Microsoft Symbol Server is checked, VS will attempt to load all symbols on their server, causing a lot of extra time.

恋你朝朝暮暮 2024-07-27 02:03:10
  • Load all symbol packages from MS website manually, put them on a SSD drive for speed :-)
  • If you have a "_NT_SYMBOL_PATH" environment variable, remove the part "http://msdl.microsoft.com/download/symbols" from "SRVe:\symbols*http://msdl.microsoft.com/download/symbols", so you have only the symbol path where your symbols live preciously downloaded.
  • Now you have support for symbols but they wont be downloaded from MS, but loaded from drive
太阳哥哥 2024-07-27 02:03:10

VS 2022:看看工具 -> 选项-> 调试-> 输出窗口-> 常规输出设置。
提供对发出的信息的精细控制。
为我的项目做了这个技巧,甚至在 Docker 中从 VS 调试时也受到尊重。

VS 2022: Have a look at Tools -> Options -> Debugging -> Output Window -> General Output Settings.
Offers granular Control over the emitted nessages.
Did the trick for my project, and is even respected when debugging from VS in Docker.

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