Symbol Load Issue

Explore, browse and analyze .NET assemblies

Moderators: Luke Jefferson, Charles Brown, StephenC, Alex.Davies, Greg.Tillman, melvyn.harbour

Symbol Load Issue

Postby bdesmond » Fri Sep 24, 2010 10:35 pm

I'm currently using VS2010 to debug a process on a remote machine. The assembly I'm trying to step in to is GAC'ed on the remote machine. I'm using Reflector 6.5.0.135.

When I hit a breakpoint, I get this error:

Code: Select all
---------------------------
.NET Reflector
---------------------------
The loaded PDB file for the assembly "Microsoft.ResourceManagement" is not the one .NET Reflector expected.



Expected version: “C:\\Users\\BrianDesmond\\AppData\\Local\\Red Gate\\.NET Reflector 6\\Cache\\V2\\x86\\CS\\V35\\Microsoft.ResourceManagement.pdb”



Loaded version: "C:\\Windows\\assembly\\GAC_MSIL\\Microsoft.ResourceManagement\\4.0.3531.2__31bf3856ad364e35\\Microsoft.ResourceManagement.pdb"



If the correct PDB file is not loaded, debugging may not work.
---------------------------
OK   
---------------------------


I've found that everything works if I click OK and step through (e.g. line info is correct, etc.), but no locals are resolved. I'm quite certain that I've copied the symbol file in question from the "expected" path to the "loaded" path.

Here is the error when I try and resolve a local:

Code: Select all
Cannot obtain value of local or argument 'value' as it is not available at this instruction pointer, possibly because it has been optimized away.


Is this a supported scenario? If I really need to I can load VS on the box being debugged but I'd prefer not to.
bdesmond
 
Posts: 2
Joined: Fri Sep 24, 2010 10:31 pm

Postby Clive Tong » Mon Sep 27, 2010 9:25 am

The first warning is not a problem. The system is trying to warn you (correctly) that the pdb it generated isn't loaded into the process being debugged. However, as you say, you've manually copied this pdb to the target machine and it has been loaded correctly.

The inability to see the local variables is most likely due to the optimization the clr is doing - we supply the pdb file and then the debugger works with the clr to get the values without any intervention on our part. If you view Debug/Modules you'll probably see that the module is optimized. You can re-ngen a module with an ini file present to make it more debuggable - see, for example, http://msdn.microsoft.com/en-us/library/9dd8z24x.aspx
Clive Tong
 
Posts: 283
Joined: Thu Dec 04, 2008 5:42 pm

Re:

Postby bdesmond » Wed Sep 29, 2010 5:37 pm

Clive Tong wrote:The first warning is not a problem. The system is trying to warn you (correctly) that the pdb it generated isn't loaded into the process being debugged. However, as you say, you've manually copied this pdb to the target machine and it has been loaded correctly.

The inability to see the local variables is most likely due to the optimization the clr is doing - we supply the pdb file and then the debugger works with the clr to get the values without any intervention on our part. If you view Debug/Modules you'll probably see that the module is optimized. You can re-ngen a module with an ini file present to make it more debuggable - see, for example, http://msdn.microsoft.com/en-us/library/9dd8z24x.aspx


Hi-

Thanks for the reply - and sorry for the delay in following up. I didn't get an email alert for some reason.

As far as the alert box, is there any way to disable it? I get it constantly now when debugging in this app and it's more of a nuisance now.

I'll givehte NI file a shot. Since I've actually backed out a couple DLLs and the example is for an EXE, do I just create the INI file for the EXE hosting the DLLs and it will apply to the DLLs as well? What if the app's installer ngen'ed the assemblies at install time?
bdesmond
 
Posts: 2
Joined: Fri Sep 24, 2010 10:31 pm

Postby Clive Tong » Thu Sep 30, 2010 10:04 am

There's no way to turn off the alert in the current version.

To make a particular ngen'ed assembly less optimized, you have to re-ngen that assembly. For example, recently I had cause to step through System.Core using Reflector Pro. In order to re-ngen System.Core to make it more debuggable, I

(i) uninstalled the current ngen version

Code: Select all
ngen.exe uninstall System.Core.dll


(ii) created an ini file named System.Core.ini in the same directory which contained

Code: Select all
[.NET Framework Debugging Control]
GenerateTrackingInfo=1
AllowOptimize=0


(iii) re-ngened it using

Code: Select all
ngen.exe install System.Core.dll


Does that help?
Clive Tong
 
Posts: 283
Joined: Thu Dec 04, 2008 5:42 pm


Return to .Net Reflector 6.x and .NET Reflector 6.x Pro

Who is online

Users browsing this forum: No registered users and 0 guests