如何设置Windows符号服务器 [英] How to get a Windows symbol server set up

查看:359
本文介绍了如何设置Windows符号服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在网络上有一个备用服务器,希望托管我们所有的构建符号.我已经知道如何在本地开发系统上设置符号缓存,并将调试器(例如Windbg)指向符号文件路径"中的该路径.我以为我可以对网络上另一个具有自己的符号缓存(例如\\ host \ symbols)的系统执行相同的操作.

I have a spare server on the network that I'd like to have host all of our build symbols. I already know how to set up a symbol cache on my local development system and pointing my debugger (e.g. Windbg) to that path in 'Symbol File Path'. I presumed that I could do the same with another system on the network that has its own symbol cache (e.g. \\host\symbols).

我在目录中设置了服务器并启用了文件共享,因此可以通过Windows资源管理器远程访问它.但是,当我尝试在WinDbg中指向它时,似乎没有在其中拾取符号.

I set up the server and enabled file sharing on the directory, so I'm able to access it remotely through Windows Explorer. However, when I try pointing to it in WinDbg, it doesn't seem to pick up the symbols there.

符号文件路径的设置如下:

The Symbol File Path is set up like this:

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

似乎我没有在服务器上正确配置它-我是否可能缺少一个步骤?

It seems like I'm not configuring it correctly on the server -- is there a step that I may be missing?

推荐答案

设置符号服务器和/或符号网络共享时需要了解几件事.

There are a several things to know when setting up a symbol server and/or symbol network share.

在符号路径中从头到尾搜索符号,即在符号路径C:\a;C:\b中搜索,它将首先在C:\a中查找,然后在C:\b中查找.尽管这并不重要,但它会对性能产生很大影响.如果您有自己的符号,请始终将其放在第一位,以便将HTTP往返行程保存到Microsoft服务器.

Symbols are searched in the symbol path from the beginning to the end, i.e. in the symbol path C:\a;C:\b, it will first look in C:\a and then in C:\b. While this does not really matter, it influences performance a lot. If you have your own symbols, always put them first, so you're saving the HTTP round-trip to the Microsoft server.

共有三种符号存储类型:

There are three symbol store types:

  • 本地存储(磁盘上的目录)
  • 服务器存储(网络共享)
  • 符号服务器/HTTP存储(带有HTTP URL)

您可以使用三种类型的符号存储,并且不应将它们混合在单个目录中:

You can have three types of symbol stores and you should not mix them in a single directory:

  • PDB文件的0层或简单列表,通常是作为构建脚本或复制/粘贴操作的输出而创建的.
  • 2层:符号存储为<filename>.pdb\<hash>\<filename>.pdb.您可以从现有的空(0字节)pingme.txt文件和000Admin文件夹中识别2层符号存储.不要删除这些.
  • 3层:符号存储为<fi>\<filename>\<hash>\<filename>.pdb>.您可以从空的(0字节)index2.txt文件中识别3层符号存储.不要删除它.三层商店应该可以提高性能.
  • 0-tier or simply a flat list of PDB files, usually created as output of a build script or a copy/paste operation.
  • 2-tier: Symbols are stored as <filename>.pdb\<hash>\<filename>.pdb. You recognize a 2-tier symbol store from an existing empty (0 byte) pingme.txt file and a 000Admin folder. Don't delete those.
  • 3-tier: Symbols are stored as <fi>\<filename>\<hash>\<filename>.pdb>. You recognize a 3-tier symbol store from the empty (0 byte) index2.txt file. Don't delete it. The 3-tier store is supposed to increase performance.

您可以使用WinDbg随附的symstore.exe将符号从0层存储区放置到2层或3层存储区中. 您可以使用convertstore.exe将2层存储转换为3层存储.如果发生错误,请参见我的文章转换存储错误.

You can put symbols from a 0-tier store to a 2- or 3-tier store using symstore.exe which comes with WinDbg. You can convert a 2-tier store into a 3-tier store using convertstore.exe. In case of errors, see my article Convertstore Errors.

您设置的不是符号服务器,而是服务器符号存储,因为您使用(并希望使用)网络共享,而不是HTTP Web服务器.以下是设置它的步骤:

What you have set up is not a symbol server, it is a server symbol store, because you use (and want to use) a network share, not a HTTP web server. The following are the steps to set it up:

  1. 在服务器上创建一个新的空目录
  2. 如果要添加其他计算机上的符号,请共享具有写访问权的文件夹.如果您从服务器本身添加符号(例如,如果该服务器是构建可执行文件的持续集成服务器),则读取访问应该足够.
  3. 如果要从其他计算机添加符号,请运行symstore add /3 /f "Filename.pdb" /s "\\server\symbols" /t "Title";如果要在本地添加符号,请使用/s "C:\share\symbols".
  1. Create a new empty directory on the server
  2. Share the folder with write access, if you want to add the symbols from a different machine. Read access should be sufficient if you add symbols from the server itself (e.g. if the server is a Continuous Integration server which builds the executables).
  3. Run symstore add /3 /f "Filename.pdb" /s "\\server\symbols" /t "Title" if you want to add symbols from a different machine or use /s "C:\share\symbols" if you add them locally.

对要添加的所有版本的PDB文件重复步骤3.您也可以使用通配符,例如*.pdb.理想情况下,您将这一步骤集成到构建过程中.

Repeat step 3 for all versions of PDB files you like to add. You can also use wildcards like *.pdb. Ideally you integrate that step into your build process.

出于性能方面的考虑,开发人员希望从本地网络以及Microsoft符号中缓存您自己的符号.因此,让我们首先创建这样的本地缓存:

For performance reasons, developers want to cache your own symbols from the network locally as well as the Microsoft symbols. Therefore, let's create such a local cache first:

.sympath cache*C:\Symbols

我通常让NTFS压缩缓存文件夹,因为符号压缩得很好.

I typically let the cache folder be compressed by NTFS, because symbols compress quite well.

接下来,让我们先找到自己的符号,以避免往返于Microsoft:

Next, let's find own symbols first to avoid the round-trip to Microsoft:

.sympath+ \\server\symbols

最后,尝试从Microsoft下载其他所有内容:

Finally, try to download everything else from Microsoft:

.symfix+

如果您对WinDbg工作区有所了解,则可以将符号路径设置保存在工作区中,因此无需在每个调试会话中都输入所有这些内容.不幸的是,如果将所有内容都放在一个用分号分隔的行中(我不太明白为什么),这是行不通的,但是您现在可以输入.sympath并复制结果.应该是

If you learn a bit about WinDbg Workspaces, you can save the symbol path setting in a workspace so you needn't type all this in each debugging session. Unfortunately it does not work if you put it all in one line separated by semicolon (I don't really understand why), but you can type .sympath now and copy the result. It should be

cache*c:\symbols;\\server\symbols;SRV*http://msdl.microsoft.com/download/symbols

潜在问题

我现在无法重现此内容,但我记得有一些问题.原因是:WinDbg在访问网络共享时不会要求提供凭据.解决方法是:如果没有从\\server\symbols接收符号,请在Windows资源管理器中打开该网络共享.资源管理器将要求提供凭据,这些凭据将被Windows缓存,从而被WinDbg隐式使用.

Potential problems

I could not reproduce this now, but I remember some problems. The reason was: WinDbg will not ask for credentials when accessing the network share. The workaround is: if you don't receive symbols from \\server\symbols, open that network share in Windows Explorer. Explorer will ask for credentials and they will be cached by Windows and thus be used by WinDbg implicitly.

这篇关于如何设置Windows符号服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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