为什么在设置 _NT_SYMBOL_PATH 后我的本地 dll 需要永远加载?

发布于 2024-09-15 18:58:07 字数 491 浏览 9 评论 0原文

我已经设置了 _NT_SYMBOL_PATH 并将其指向

srv*c:\symbols*http://msdl.microsoft.com/download/symbols

启动调试器时,我注意到 Windows 相关的 dll 加载速度很快。然而,我们公司的 dll 加载时间非常长。当我摆脱 _NT_SYMBOL_PATH 并重新启动 Visual Studio 时,所有内容都会很快加载(尽管我没有 MS 符号)。

这几乎就像是在上面的符号服务器中搜索我的内部公司 dll 的 pdb,而不是首先检查它们是否存在于本地。其中一些 dll 我没有 pdb。有些是我的解决方案的一部分,所以我在调试时构建它们,并且总是有 pdb。

Visual Studio 如何搜索符号?我是否可以控制 Visual Studio 搜索符号的方式?我可以明确地说,对于给定目录中的 dll 不搜索符号吗?还有其他什么可能会降低符号的加载速度或者我可以采取什么措施来加快该过程吗?

I've setup _NT_SYMBOL_PATH and have pointed it to

srv*c:\symbols*http://msdl.microsoft.com/download/symbols

When starting the debugger, I notice that the Windows related dlls load quickly. However, our company's dlls are taking a god awful long time to load. When I get rid of _NT_SYMBOL_PATH, restart visual studio, then everything loads pretty quickly (albeit I don't have MS symbols).

It's almost as if the symbol server above is being searched for my internal company dll's pdbs instead of first checking to see if they exist locally. Some of these dlls I do not have pdbs for. Some are part of my solution, so I build them when debugging and always have pdbs.

How is Visual Studio searching for symbols? Is there anyway I can control how visual studio searches for symbols? Can I explicitly say that for dlls from a given directory are not to be searched for symbols? Is there anything else that might drag down how fast symbols are loaded or anything I can do to speed up the process?

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

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

发布评论

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

评论(2

寂寞美少年 2024-09-22 18:58:07

Visual Studio 在 Visual Studio 内配置的任何路径之前搜索_NT_SYMBOL_PATH。这是调试引擎的一个“功能”。这意味着将在 Microsoft 的符号服务器中搜索您的符号。

在 Visual Studio 2010 中,他们通过(如果已设置)在“调试符号”对话框中包含 _NT_SYMBOL_PATH 来明确这一点。不幸的是,此条目 无法上下移动

要解决此问题,请将符号服务器放在 _NT_SYMBOL_PATH Microsoft 内容之前:

_NT_SYMBOL_PATH=cache*C:\symbols;\\mysymsvr\Symbols;SRV* C:\symbols*http://msdl.microsoft.com/download/symbols

Visual Studio searches _NT_SYMBOL_PATH before any paths configured inside Visual Studio. This is a "feature" of the debugging engine. This means that Microsoft's symbol servers will be searched for your symbols.

In Visual Studio 2010, they've made this explicit by (if it's set) including _NT_SYMBOL_PATH in the Debugging Symbols dialog. Unfortunately, this entry cannot be moved up or down.

To get around this, put your symbol server in _NT_SYMBOL_PATH before the Microsoft stuff:

_NT_SYMBOL_PATH=cache*C:\symbols;\\mysymsvr\Symbols;SRV*C:\symbols*http://msdl.microsoft.com/download/symbols

回梦 2024-09-22 18:58:07

除了@Roger的正确答案之外。

如果您在 Visual Studio 中进行调试,我会避免使用 _NT_SYMBOL_PATH 环境变量,而是使用 Visual Studio 设置。

工具->选项->调试符号

在 2010 年,这允许您比原始环境变量路由更精细。例如,您可以筛选 Visual Studio 默认尝试加载符号的 DLL 列表。这对于您只对 DLL 的一小部分感兴趣并希望减少加载时间的大型项目非常有价值。

In addition to @Roger's correct answer.

If you're debugging in Visual Studio I would avoid using the _NT_SYMBOL_PATH environment variable in favor of using the Visual Studio settings.

Tools -> Options -> Debugging Symbols

In 2010 this allows you more granularity than the raw environment variable route. For example you can filter down the list of DLL's for which Visual Studio attempts to load symbols for by default. This is very valuable in large projects where your only interested in a small subset of the DLL's and want to reduce load time.

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