合并符号服务器

保护总是好的,公司有两台符号服务器。其中一个已不再使用,但为以前发布的项目保留了符号。因为PDB文件和源代码一样重要,所以想知道是否有办法将符号服务器合并在一起。

由于符号服务器是用作数据库的文件系统,存储方案为\ServerShareFile.PDBGUIDFile.PDB,因此可以将资源管理器中的文件从一个符号服务器拖到另一个符号服务器。这并不理想,因为如果您正在积极地管理符号服务器来修剪死符号,那么那些通过拖放添加的符号将永远停留在那里。为了避免死符号问题,您只需要运行同一个命令,该命令使构建以SYMSTORE.EXE开始,SYMSTORE.EXE是Windows调试工具(也称为WinDBG)的一部分,可以作为Windows SDK的一部分安装。

symstore add /r /f \\Retiring\Share /s \\Combined\Share /t "Merging Symbol Servers"

这个例子很简单,但是如果您遇到了一个更复杂的情况,即将退役的symbol服务器得到了正确的使用,并且日常构建可以追溯到很久以前,但是您只需要外部发布的产品构建,那会怎么样?让我们更感兴趣的是,你想要的能力,修剪个人建立在道路上。比如说,alpha发布版或每日构建版超过两个月?(我假设您已经阅读了symbol服务器上的文档并设置了一个。如果你还没有开始:http://msdn.microsoft.com/en-us/library/windows/desktop/ms680693(v=v s.85.aspx)

幸运的是,合并符号服务器并保留所有添加数据(如版本、产品和允许单个构建)是可行的,但必须编写脚本。稍微看一下这个问题,这里是你必须遵循的基本算法。

    Open the \\Retiring\Share\000Admin\history.txt
    For each line in history.txt
        Ignore any symbol delete lines
        For each add line
            Find the index number
            Open that index file from \\Retiring\Share\000Admin
            For each line in that index file
                Map the first field from "file\GUID" to
                        \\Retiring\Share\File\GUID\File
                Copy \\Retiring\Share\File\GUID\File to a temp directory
                Delete \\Retiring\Share\File\GUID\File
                Remove the path \\Retiring\Share\File\GUID
            End for
            Execute SYMSTORE on the temp directory to add the
                    files using the product,
                    version, and comment from the add line
        End for
    End for

虽然世界上可能只有两个人需要在这个级别上合并符号服务器,但是自从我经历了这些步骤之后,我想我会把它写下来。对于这两个人,我希望你觉得这个有用。

 

posted on 2020-03-06 14:50  活着的虫子  阅读(240)  评论(0编辑  收藏  举报

导航