首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用带有指针的symstore.exe和compress.exe的符号服务器不工作

使用带有指针的symstore.exe和compress.exe的符号服务器不工作
EN

Stack Overflow用户
提问于 2016-09-24 22:52:03
回答 2查看 3.3K关注 0票数 2

我想使用微软的符号存储创建一个符号服务器,将符号存储与实际的符号服务器分开,但是我无法将指针和压缩工作在一起。出于测试目的,我在本地驱动器上创建了这样一个服务器。

我在我的环境中添加了一个符号路径(_NT_SYMBOL_PATH=srv*symbol_server_path,但我尝试过使用_NT_SYMBOL_PATH=srv*symbol_server_path)。基本上我现在做的是:

  1. 使用命令将符号添加到符号服务器: /p /r /f symbol_file_path /s symbol_server_path /t产品 其中symbol_file_path是UNC路径。
  2. 用compress.exe压缩该符号 compress.exe -R -S symbol_file_path 其中symbol_file_path是UNC路径。
  3. 检查是否存在压缩文件-如果是,请删除未压缩符号。

据我所知,在您可以阅读的symstore文档中的语句中,这是正确的:

  1. 使用SymStore和/p选项来存储指向符号文件的指针。完成SymStore后,压缩指针所引用的文件。

所以我所做的应该是有效的,对吧?嗯-这不是.

我尝试调试一些应该与我存储的符号一起工作的转储,但是我在Visual中看到的是“系统无法从指定的设备读取”错误。我尝试过使用提升的特权或将符号服务器路径更改为本地路径(基本上同时尝试了UNC和本地路径),但它并没有真正发挥作用。

我认为可能压缩实际上不适用于SymStore中的指针,正如/compress参数描述在SymStore命令行选项上所描述的那样

/compress -使SymStore创建复制到符号存储的每个文件的压缩版本,而不是使用文件的未压缩副本。此选项仅在存储文件而不是指针时有效,不能与/p选项一起使用。

但是..。我可以看到调试器正在尝试加载该符号,即使路径与指针文件中的路径不同,并且它确实在我的符号缓存中创建了一个具有正确符号名的0字节文件。

知道发生了什么或者我做错了什么吗?

更新:

在我的例子中,我已经澄清了symbol_file_path是一个UNC路径,而且我在我的符号存储调用中也包含了'/t‘。

考虑到blabb响应--在成功的压缩和删除步骤之后--我的windbg和visual studio在试图加载*.pd_文件输出时会出现一个错误:

系统无法从指定的设备读取。

在尝试为我的.exe重新加载windbg中的符号之后

代码语言:javascript
复制
 .reload /f <exe_file_name>.exe

具有对称路径

代码语言:javascript
复制
srv*<symbol_cache>*<symbol_server>*http://msdl.microsoft.com/download/symbols

我收到了以下产出:

代码语言:javascript
复制
SYMSRV:  BYINDEX: 0x3C
         <symbol_cache>*<symbol_server>*http://msdl.microsoft.com/download/symbols
         <exe_file_name>.pdb
         <pdb_hash>
SYMSRV:  <symbol_cache>\<exe_file_name>.pdb\<pdb_hash>\<exe_file_name>.pdb - file not found
SYMSRV:  <symbol_server>\<exe_file_name>.pdb\<pdb_hash>\<exe_file_name>.pdb - file not found
SYMSRV:  The file.ptr file message is: <symbol_storage_path>\<exe_file_name>.pdb
SYMSRV:  <symbol_server>\<exe_file_name>.pdb\<pdb_hash>\file.ptr
SYMSRV:  <symbol_storage_path>\<exe_file_name>.pdb - file not found
SYMSRV:  <symbol_cache>\<exe_file_name>.pdb\<pdb_hash>\<exe_file_name>.pdb - file not found
SYMSRV:  <symbol_storage_path>\<exe_file_name>.pd_
         System nie może czytać z określonego urządzenia. <-- which is equivalent to "System cannot read from the specified device"
SYMSRV:  PATH: C:\ProgramData\dbg\sym\<exe_file_name>.pdb\<pdb_hash>\<exe_file_name>.pdb
DBGHELP: ........ DIA E_PDB_FILE_SYSTEM error from 971
DBGHELP: ........ DIA E_PDB_FILE_SYSTEM error from 971
DBGHELP: C:\ProgramData\dbg\sym\<exe_file_name>.pdb\<pdb_hash>\<exe_file_name>.pdb - drive not ready
DBGHELP: <path_not_included_in_symbol_path>\<exe_file_name>.pdb - file not found
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for <exe_file_name>.exe - 
DBGHELP: <exe_file_name> - export symbols

************* Symbol Loading Error Summary **************
Module name            Error
<exe_file_name>      Drive not ready : srv*<symbol_cache>*<symbol_server>*http://msdl.microsoft.com/download/symbols
                This error indicates a .pdb file related failure.
                The error is likely caused by a network glitch or out of disk error.
                Using a local cache (CACHE*) can work around networking issues.

当我改变了我的符号

代码语言:javascript
复制
cache*<symbol_cache>*<symbol_server>*http://msdl.microsoft.com/download/symbols 

我收到了以下产出:

代码语言:javascript
复制
SYMSRV:  BYINDEX: 0x2F
         <symbol_cache>*<symbol_server>*http://msdl.microsoft.com/download/symbols
         <exe_file_name>.pdb
         <pdb_hash>
SYMSRV:  PATH: <symbol_cache>\<exe_file_name>.pdb\<pdb_hash>\<exe_file_name>.pdb
DBGHELP: ........ DIA E_PDB_FILE_SYSTEM error from 971
DBGHELP: ........ DIA E_PDB_FILE_SYSTEM error from 971
**DBGHELP: <symbol_cache>\<exe_file_name>.pdb\<pdb_hash>\<exe_file_name>.pdb - drive not ready** <- this is where my problem is
DBGHELP: Failed copying the file '<path_not_included_in_symbol_path>\<exe_file_name>.pdb' to the cache
DBGHELP: Failed copying the file '<path_not_included_in_symbol_path>\<exe_file_name>.pdb' to the cache
DBGHELP: <path_not_included_in_symbol_path>\<exe_file_name>.pdb - file not found
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for <exe_file_name>.exe - 
DBGHELP: <exe_file_name> - export symbols

************* Symbol Loading Error Summary **************
Module name            Error
<exe_file_name>      Drive not ready : <symbol_cache>\<exe_file_name>.pdb\<pdb_hash>\<exe_file_name>.pdb
                This error indicates a .pdb file related failure.
                The error is likely caused by a network glitch or out of disk error.
                Using a local cache (CACHE*) can work around networking issues.

有了这些-我无法装载那个符号。当它没有压缩的时候,我没有问题。

每当我尝试加载符号0字节文件时,都会在我的符号缓存中创建。我希望这能澄清正在发生的事情。

更新2

将_NT_SYMBOL_PATH更改为

代码语言:javascript
复制
cache*<symbol_cache>;srv*<symbol_cache>*<symbol_server>

帮不上忙。Visual复制了*.pd_文件,而windbg没有。两者都有相同的问题-- .pd_没有被解压缩为.pdb,但是他们试图从不存在或0字节大小的.pdb文件中读取。

EN

回答 2

Stack Overflow用户

发布于 2016-09-26 13:42:11

/p /r /f symbol_file_path /s symbol_server_path

我刚刚尝试过这样做,symstore抱怨文件路径必须是本地目录的network path or /l switch must be used

代码语言:javascript
复制
D:\>md symstotest

D:\>cd symstotest

D:\symstotest>symstore add /r /p /f e:\test\zwopenproc\*.*  /s .
SYMSTORE ERROR: Class: Syntax. Desc: /f must be followed by a network path when storing po
inters unless /l is used.

SYMSTORE: Number of pointers stored = 0
SYMSTORE: Number of errors = 0
SYMSTORE: Number of pointers ignored = 0

D:\symstotest>

你的案子是什么??

如果我使用本地目录交换机/l (比如一个名为e:\test\somedir\*.*的dir ),则必须提供/t

代码语言:javascript
复制
D:\symstotest>symstore add /r /p /l /f e:\test\zwopenproc\*.*  /s .
SYMSTORE ERROR: Class: Syntax. Desc: '/t <product>' is required with this add type.

SYMSTORE: Number of pointers stored = 0
SYMSTORE: Number of errors = 0
SYMSTORE: Number of pointers ignored = 0

D:\symstotest>

你又遵守了吗??

在遵从符号存储的过程中,似乎很高兴并创建了这个目录结构。

代码语言:javascript
复制
D:\symstotest>symstore add /r /p /l /t win7 /f e:\test\zwopenproc\*.*  /s .
Finding ID...  0000000001

SYMSTORE: Number of pointers stored = 3
SYMSTORE: Number of errors = 0
SYMSTORE: Number of pointers ignored = 3

D:\symstotest>tree /a /f

D:.
|   pingme.txt
|
+---000Admin
|       0000000001
|       history.txt
|       lastid.txt
|       server.txt
|
+---vc140.pdb
|   \---76CA8C231EF1443195D38A95A8A86958
|           file.ptr
|           refs.ptr
|
+---zwopenproc.exe
|   \---57B75BB84a000
|           file.ptr
|           refs.ptr
|
\---zwopenproc.pdb
    \---E3CA63D5CD7544E9BC90709CA8D04042a
            file.ptr
            refs.ptr

相应的*.ptr文件似乎包含手册中记录的数据。

代码语言:javascript
复制
D:\symstotest>for /F %I in ('dir /s /b *.ptr') do cat %I

D:\symstotest>cat D:\symstotest\vc140.pdb\76CA8C231EF1443195D38A95A8A86958\file.ptr
e:\test\zwopenproc\vc140.pdb
D:\symstotest>cat D:\symstotest\vc140.pdb\76CA8C231EF1443195D38A95A8A86958\refs.ptr
0000000001,ptr,"e:\test\zwopenproc\vc140.pdb",typ,"",,,
D:\symstotest>cat D:\symstotest\zwopenproc.exe\57B75BB84a000\file.ptr
e:\test\zwopenproc\zwopenproc.exe
D:\symstotest>cat D:\symstotest\zwopenproc.exe\57B75BB84a000\refs.ptr
0000000001,ptr,"e:\test\zwopenproc\zwopenproc.exe",bin,"",,,
D:\symstotest>cat D:\symstotest\zwopenproc.pdb\E3CA63D5CD7544E9BC90709CA8D04042a\file.ptr

e:\test\zwopenproc\zwopenproc.pdb
D:\symstotest>cat D:\symstotest\zwopenproc.pdb\E3CA63D5CD7544E9BC90709CA8D04042a\refs.ptr

0000000001,ptr,"e:\test\zwopenproc\zwopenproc.pdb",pri,"",,,
D:\symstotest>

我手头没有资源工具包工具compress.exe,所以我现在不能测试压缩,但我会在可能的时候更新答案。

但是,在上面的示例中,您似乎可以将实际目录中的文件压缩为"e:\test\zwopenproc\zwopenproc.pd_"。

而symsrv.dll将能够检索压缩文件。

一旦检索到,您就有责任解压缩

或者使用下游缓存让symsrv.dll为您服务。

在风车会话中使用,如手册中所引用。

代码语言:javascript
复制
Compressed Files
SymSrv is compatible with symbol stores that contain compressed files, as long as this compression has been done with the compress.exe tool, which is available here. Compressed files should have an underscore as the last character in their file extensions (for example, module1.pd_ or module2.db_). For details, see SymStore.

If the files on the store are compressed, you must use a downstream store. SymSrv will uncompress all files before caching them on the downstream store.

===============================UPDATE============================

它似乎在这里起作用

文件夹预测试内容

代码语言:javascript
复制
E:\test\zwopenproc>dir /b
zwopenproc.cpp
zwopenproc.exe
zwopenproc.pdb

创建文件夹并将符号存储事务添加到该文件夹中,

代码语言:javascript
复制
E:\test\zwopenproc>d:

D:\>md symsto

D:\>cd symsto

D:\symsto>symstore add /p /r /l /t win7 /f e:\test\zwopenproc\*.* /s .
Finding ID...  0000000001

SYMSTORE: Number of pointers stored = 2
SYMSTORE: Number of errors = 0
SYMSTORE: Number of pointers ignored = 1

D:\symsto>dir /s /b
D:\symsto\000Admin
D:\symsto\pingme.txt
D:\symsto\zwopenproc.exe
D:\symsto\zwopenproc.pdb
D:\symsto\000Admin\0000000001
D:\symsto\000Admin\history.txt
D:\symsto\000Admin\lastid.txt
D:\symsto\000Admin\server.txt
D:\symsto\zwopenproc.exe\57E9886E4a000
D:\symsto\zwopenproc.exe\57E9886E4a000\file.ptr
D:\symsto\zwopenproc.exe\57E9886E4a000\refs.ptr
D:\symsto\zwopenproc.pdb\A734669CFEA74EFB8437FE1086F559B61
D:\symsto\zwopenproc.pdb\A734669CFEA74EFB8437FE1086F559B61\file.ptr
D:\symsto\zwopenproc.pdb\A734669CFEA74EFB8437FE1086F559B61\refs.ptr

压缩删除

代码语言:javascript
复制
D:\symsto>e:

E:\test\zwopenproc>e:\rktools\compress.exe -R -S zwopenproc.pdb

Compressing zwopenproc.pdb to zwopenproc.pd_.
zwopenproc.pdb: 4960256 bytes compressed to 1903179 bytes, 62% savings.

Total savings: 1 files, 4960256 bytes compressed to 1903179 bytes, 61% savings.

E:\test\zwopenproc>del zwopenproc.pdb

E:\test\zwopenproc>dir /b
zwopenproc.cpp
zwopenproc.exe
zwopenproc.pd_

运行windbg和procmon实例

代码语言:javascript
复制
E:\test\zwopenproc>windbg zwopenproc.exe

E:\test\zwopenproc>procmon

**当windbg在初始断点停止时,将新存储添加到符号路径并重新加载模块**

代码语言:javascript
复制
Microsoft (R) Windows Debugger Version 10.0.10586.567 X86
CommandLine: zwopenproc.exe


0:000> .sympath
Symbol search path is: srv*E:\symbols*http://msdl.microsoft.com/download/symbols

0:000> .sympath srv*E:\symbols*D:\symsto*http://msdl.microsoft.com/download/symbols
Symbol search path is: srv*E:\symbols*D:\symsto*http://msdl.microsoft.com/download/symbols

0:000> .reload /f

the first time .reload doesn't seem to find the symbol file though i can see in procmon    
that the files were fethced from new symstore and written to 
downstream cache e:\symbols and     
default cache sym dir in !homedir  (windbg installation directory)

zwopenproc PDB notfound:srv*e:\symbols*d:\symsto*http://msdl.microsoft.com/download/symbols

0:000> lm
start    end        module name
00b70000 00bba000   zwopenproc   (no symbols)  

**issuing .reload /f a second time the symbol files are loaded successfully**      

0:000> .reload /f
Reloading current modules
........
0:000> lm
start    end        module name
00b70000 00bba000   zwopenproc   (private pdb symbols)   
e:\symbols\zwopenproc.pdb\A734669CFEA74EFB8437FE1086F559B61\zwopenproc.pdb
票数 3
EN

Stack Overflow用户

发布于 2016-12-16 22:30:48

*srv要求您已经在服务器计算机上安装了SymSrv.exe。你还没那么做。只需使用UNC路径到您的SymStore。并在_NT_SYMBOL_PATH开始时添加本地缓存文件夹。

要么安装服务器,要么将其从路径中删除。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/39681677

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档