Symbol issue when debugging C# code
Asked Answered
K

1

0

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)?

Kizzie answered 12/10, 2009 at 5:52 Comment(0)
G
1

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.

Ginsburg answered 12/10, 2009 at 5:57 Comment(3)
"recreate the application path locally and put the PDB files with the assemblies" -- could you describe in more details what do you mean recreate the application path locally? And "put the PDB files with the assemblies"? In my scenario, what kinds of directory do I need to create?Kizzie
I made some study, and do you mean adding a local symbol folder to symbol path? Something like this? f:\LocalSymbolPath;SRVC:\mysymbolsmsdl.microsoft.com/download/symbolsKizzie
I have a related question here, appreciated if you could take a look. #1553541Kizzie

© 2022 - 2024 — McMap. All rights reserved.