Red Gate forums :: View topic - Not able to see locals while debugging into decompiled code
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
.Net Reflector 6.x and .NET Reflector 6.x Pro
.Net Reflector 6.x and .NET Reflector 6.x Pro forum

Not able to see locals while debugging into decompiled code

Search in .Net Reflector 6.x and .NET Reflector 6.x Pro forum
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.
Jump to:  
Author Message
ChristianWeyer



Joined: 08 Oct 2009
Posts: 4

PostPosted: Thu Feb 18, 2010 11:38 am    Post subject: Not able to see locals while debugging into decompiled code Reply with quote

Hi there,

what could be the problem that I can step into decompiled code, but cannot actually see the values of the locals and variables?

E.g.
Cannot obtain value of local or argument as it is not available at this instruction pointer, possibly because it has been optimized away

I mean, not seeing the values makes the debugging into third party code pretty much useless Wink

Thanks!
Back to top
View user's profile Send private message
Clive Tong



Joined: 04 Dec 2008
Posts: 283

PostPosted: Thu Feb 18, 2010 1:32 pm    Post subject: Reply with quote

This will be due to the optimization that the runtime is doing, either at JIT time or ahead of time by the ngen compiler.

Our tool provides a pdb containing mappings between IL instructions and lines of source, and scoping information for local variables. Depending on optimizations that are happening, the debugger cannot always use this information to get all of the information you may like to see.

It's possible to make the optimizations less aggressive by having a debugger attached from the start of the session and by ngening assemblies to make them debuggable.

Do you have a particular example we can look at?
Back to top
View user's profile Send private message
ChristianWeyer



Joined: 08 Oct 2009
Posts: 4

PostPosted: Thu Feb 18, 2010 2:30 pm    Post subject: Reply with quote

It is the Microsoft.IdentitModel.dll.

In the meantime I managed to get it working by using the .ini file approach mentioned below:
[.NET Framework Debugging Control]
GenerateTrackingInfo=1
AllowOptimize=0

http://msdn.microsoft.com/en-us/library/9dd8z24x.aspx


Thanks.
Back to top
View user's profile Send private message
Clive Tong



Joined: 04 Dec 2008
Posts: 283

PostPosted: Thu Feb 18, 2010 2:55 pm    Post subject: Reply with quote

Thanks - that's something I've done before to get less optimization.
Back to top
View user's profile Send private message
Clive Tong



Joined: 04 Dec 2008
Posts: 283

PostPosted: Fri Feb 04, 2011 10:51 am    Post subject: Reply with quote

I should also point to the following post
http://blogs.msdn.com/b/kirillosenkov/archive/2009/01/27/how-to-disable-optimizations-during-debugging.aspx which shows how setting the COMPLUS_ZapDisable environment variable can turn off some of the optimisation.
Back to top
View user's profile Send private message
Display posts from previous:   
This topic is locked: you cannot edit posts or make replies. All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group