Cannot load symbols created with Ngen for Native Image DLLs
Asked Answered
A

0

9

I am investigating a crashing program but cannot load symbols for native image DLLs in Visual Studio 2013. The application is 32-bit and uses .NET 4.0.30319. I confirmed this by checking what version of clr.dll is loaded into process from the modules window. Also from the modules window, I checked where mscorlib.ni.dll was loaded from:

clr.dll C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
mscorlib.ni.dll C:\Windows\assembly\NativeImages_v4.0.30319_32\mscorlib\ce5f61c5754789df97be8dc991c47d07\mscorlib.ni.dll    

I was able to successfully generate the PDB for mscorlib.ni.dll:

Ngen mscorlib.ni.dll output

but when I try to load it into VS 2013 by right clicking on the stack frame for mscorlib.ni.dll and selecting Load Symbols, I get a messaged that says "A matching symbol file was not found in this folder."

I have looked through:

Creating Ngen Pdbs for Profiling Reports/ And followed the simple instructions for generating the PDB because I just want to see function calls at this point,

Get the right .net native symols for Windbg

How to get the PDB file for mscorlib.ni.lib (.Net Framework 3.5)

It looks like the most common source of error is choosing the correct bitness. I know from the modules tab that I am loading the 32-bit variant of mscorlib.ni.dll and again from my screenshot, you can see that I am using the same version of the the .NET framework and the 32-bit version of Ngen.exe. I tried this for WindowsBase.ni.dll and saw the same behavior where I was successfully able to generate the PDB but could not load it.

I have the debugger enabled to Just-in-time debug Managed and Native code.

Questions:

  1. Am I using the wrong version of ngen.exe on to create this PDB?
  2. What does Visual Studio check when it tries to load a PDB?
  3. Is there some other setting I need to enable in VS to debug this type of code?

Thanks!

Andrea answered 11/2, 2016 at 14:28 Comment(1)
It looks like you generated the PDB file, so provided the PDB is at your symbol path, you should be able to load it into windbg with .reload /f.Aarika

© 2022 - 2024 — McMap. All rights reserved.