다음을 통해 공유


Public Symbols for Beta 2 Now Posted

When I was in Atlanta debugging a customer application, I noticed that the Symbol Server didn't have the Beta 2 public pdb's posted. It took a little while, but the Release team has confirmed they are now available. The easy way to verify this is to install the Windows Debuggers and run "symchk %windir%\Microsoft.Net\Framework\v2.0.50215\mscorwks.dll /v".

The symbols posted are what we call "Public Symbols". They contain the function names and offset inside of the DLL's, but no line number or local variable mapping information. To see the difference, check out these two call stacks I did on regasm first without and then with symbols:

Without Symbols

0:000> k
ChildEBP RetAddr
0012f1c8 7c90dc61 ntdll!KiFastSystemCallRet
0012f1cc 7c91c3da ntdll!NtMapViewOfSection+0xc
0012f2c0 7c916071 ntdll!LdrpMapDll+0x330
0012f580 7c9162da ntdll!LdrpLoadDll+0x1e9
*** ERROR: Symbol file could not be found. Defaulted to export symbols for C:\W
INDOWS\system32\KERNEL32.dll -
0012f828 7c801bb9 ntdll!LdrLoadDll+0x230
*** ERROR: Symbol file could not be found. Defaulted to export symbols for C:\W
INDOWS\system32\mscoree.dll -
WARNING: Stack unwind information not available. Following frames may be wrong.
0012f890 788059eb KERNEL32!LoadLibraryExW+0xc8
0012f8b4 78805995 mscoree!CreateConfigStream+0x62e
0012fb44 00000000 mscoree!CreateConfigStream+0x5d8

With Symbols

0:000> k
ChildEBP RetAddr
0012f1c8 7c90dc61 ntdll!KiFastSystemCallRet
0012f1cc 7c91c3da ntdll!NtMapViewOfSection+0xc
0012f2c0 7c916071 ntdll!LdrpMapDll+0x330
0012f580 7c9162da ntdll!LdrpLoadDll+0x1e9
0012f828 7c801bb9 ntdll!LdrLoadDll+0x230
0012f890 788059eb KERNEL32!LoadLibraryExW+0x18e
0012f8b4 78805995 mscoree!WszLoadLibraryEx+0x75
0012f8c8 7880592e mscoree!LoadLibraryWrapperForEE+0xe
0012ffa4 788110b3 mscoree!GetInstallation+0x1ae
0012ffc0 7c816d4f mscoree!_CorExeMain+0x12
0012fff0 00000000 KERNEL32!BaseProcessStart+0x23

Without symbols, the debugger is forced to try and guess which method you were in based on all the data it can. It can tell the insruction pointer (IP) is inside mscoree.dll given the load address and size of the image. It then looks at the exported function table (functions that are published outside of an unmanaged image) and looks for the closest method that comes before the IP. In this example, that method is CreateConfigStream + 0x62e bytes (1582 bytes). As you can tell by the correct stack trace, it is far easier to understand what is going on when you can see the actual methods that live in that 1582 bytes.

Cheat sheet:

  1. You can install the Windows debuggers here. I install mine to c:\debuggers
  2. You should create a local directory to cache down loaded symbols for faster lookup. I use c:\websymbols.
  3. You'll want to set your _NT_SYMBOL_PATH environment variable to use the symbol server by default:

set _NT_SYMBOL_PATH=SRV*c:\websymbols*https://msdl.microsoft.com/download/symbols

If you are already running, you can use '.sympath' to add the right path and do a '.reload' to force symbols to be fetched.

For Visual Studio 2005 users, this is even simpler. Go under the Tools, Options, Debugger, Symbols settings to set your local path. VS will automatically hook you up with the right EULA and symbol down loads. Here is an image I took from my machine showing the dialog and the results in the background.

Comments

  • Anonymous
    May 27, 2005
    CLR PUM Jason Zander has posted information about the availability of debug symbols for Beta 2. If you...
  • Anonymous
    May 29, 2005
    BTW, the latest "Debugging Tools for Windows" even include an IISAPI extension which allows to set up a http symbol proxy server. It usually lives between msdl.microsoft.com and your local hardisk cache, i.e. it caches all symbols downloaded from msdl.microsoft.com. It comes quite handy if your internet link is slow and several team members need the same symbols. It currently lacks proper setup program and documentation, but it works.