调试 C# 代码时的符号问题
我正在使用 WinDbg 从托管代码(C#,一个为任何 CPU),并且在 x64 平台上创建故障转储。我正在 x64 平台上进行调试。我已将相关的 PDB 文件放入符号路径中。
但WinDbg总是从一个奇怪的文件夹中找到该符号。下面是一个示例(当我使用 !sym 噪音时):
SYMSRV: c:\MySymbols\FooService.pdb\4311207E2E2D442CB7473828D2488F941\FooService.pdb not found
我的应用程序名为 FooService.exe
,相关的 PDB 文件名为 FooService.pdb
。我已将 C:\MySymbols
设置为符号路径,并将 FooService.pdb
复制到目录 C:\MySymbols
中。但为什么 WinDbg 在 C:\MySymbols
中找不到 FooService.pdb
,而是从一个奇怪的子文件夹“FooService.pdb\4311207E2E2D442CB7473828D2488F941”中找到?
在我的场景中,为了加载PDB符号文件,最好的解决方案是什么(我是否必须自己手动创建子文件夹FooService.pdb\4311207E2E2D442CB7473828D2488F941
)?
I am using WinDbg to load a crash dump from managed code (C#, a console application built for Any CPU), and a crash dump is created on a x64 platform. I am debugging on a x64 platform. I have put the related PDB file into the symbol path.
But WinDbg always find the symbol from a strange folder. Here is an example (when I got from using !sym noisy):
SYMSRV: c:\MySymbols\FooService.pdb\4311207E2E2D442CB7473828D2488F941\FooService.pdb not found
My application is called FooService.exe
and the related PDB file is named FooService.pdb
. I have set C:\MySymbols
as the symbol path and copied FooService.pdb
to the directory C:\MySymbols
. But why does WinDbg not find FooService.pdb
in C:\MySymbols
, but from a strange sub-folder, "FooService.pdb\4311207E2E2D442CB7473828D2488F941"?
In my scenario, in order to load the PDB symbol file, what is the best solution (do I have to create the sub-folder FooService.pdb\4311207E2E2D442CB7473828D2488F941
by myself manually)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我相信路径的奇怪部分用于对符号缓存中的 PDB 进行版本控制。由于缓存可用于许多应用程序,包括同一应用程序的不同版本,因此符号下载器需要采取一些措施将它们分开。
您可以使用
.reload /fo
命令强制符号加载器忽略任何缓存的副本。结合.sympath
选项,您应该能够设置加载。将本地路径添加到符号路径的简单方法是.sympath+
。之后执行.reload /fo
以忽略任何先前缓存的 PDB。编辑:我稍微改变了我的答案,因为我相信我最初误读了你的问题。我希望这次更新更有用。
I believe the strange part of the path is used for versioning the PDBs in the symbol cache. As the cache can be used for many applications including different versions of the same application the symbol downloader needs to do something to keep them apart.
You can force the symbol loader to disregard any cached copy by using the
.reload /fo
command. Combined with the.sympath
option you should be able to set up loading. An easy way to add your local path to the symbol path is.sympath+ <PATH>
. After that do a.reload /fo
to disregard any previously cached PDBs.EDIT: I changed my answer quiet a bit as I believe I initially misread your question. I hope this update is more useful.