This is a migrated thread and some comments may be shown as answers.

Debugging decompiled code problem: <this> optimized away

5 Answers 239 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Tommi
Top achievements
Rank 1
Tommi asked on 04 Nov 2013, 11:31 AM
Hello!

I am using Visual Studio 2013 and I just downloaded JustCode and tried to debug decompiled code (.NET System.Web.dll). Breakpoints work, but I cannot see the values of the variables. Immediate window reports as follows:

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

Also, when I try to set a break point condition with this, the debugger says:

Could not evaluate expression

Sometimes the error message is as follows:

Cannot evaluate expression because the code of the current method is optimized.

Is this normal behaviour, or is there a trick how to see variable values, since without them debugging is quite useless.

Thanks,
Tommi

5 Answers, 1 is accepted

Sort by
0
Zdravko
Telerik team
answered on 06 Nov 2013, 01:28 PM
Hello Tommi,

 Thanks for contacting us.
This is an expected behavior. In some cases the value can not be provided and we are aware of this. Unfortunately, there is nothing we can do to improve it.
Thank you.

Regards,
Zdravko
Telerik
Share what you think about JustCode with us, so we can help you even better! You can use the built-in feedback tool inside JustCode, our forum, or our JustCode feedback portal.
0
Bart Plasmeijer
Top achievements
Rank 1
answered on 03 Sep 2014, 09:26 AM
@Telerk - can you explain why this happens?

Thanks
Bart
0
Ivan
Telerik team
answered on 05 Sep 2014, 01:58 PM
Hello,

This behavior occurs because the part of code that is being debugged was optimized by the compiler during compilation.
Because of compiler optimizations it is possible that you may not be able to add breakpoints at specific places or watch the value of a given member or variable.
If you have any more questions or remarks, please do not hesitate to contact us again!

Regards,
Ivan
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
kittykitty
Top achievements
Rank 1
answered on 10 Nov 2014, 08:00 AM
This actions happens because the aspect of rule that is being debugged was enhanced by the compiler during collection.
Because of compiler optimizations it is possible that you may not be able to add breakpoints at particular locations or observe the value of a given participant or varying.
0
Lorenzo
Top achievements
Rank 1
answered on 21 Nov 2014, 12:32 PM
Hi, just in case.....

I faced the same problem and to me turned out to be just the fact that VS was in Release mode instead of DEBUG !

I understand the problem might be much more complex than so, but my mistake produced the same kind of error message, so I thought to report it.

Lorenzo
Tags
General Discussions
Asked by
Tommi
Top achievements
Rank 1
Answers by
Zdravko
Telerik team
Bart Plasmeijer
Top achievements
Rank 1
Ivan
Telerik team
kittykitty
Top achievements
Rank 1
Lorenzo
Top achievements
Rank 1
Share this question
or