Debugging decompiled code problem: <this> optimized away

6 posts, 0 answers
  1. Tommi
    Tommi avatar
    1 posts
    Member since:
    Jul 2013

    Posted 04 Nov 2013 Link to this post

    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
  2. Zdravko
    Admin
    Zdravko avatar
    657 posts

    Posted 06 Nov 2013 Link to this post

    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.
  3. DevCraft banner
  4. Bart Plasmeijer
    Bart Plasmeijer avatar
    1 posts
    Member since:
    Aug 2009

    Posted 03 Sep 2014 Link to this post

    @Telerk - can you explain why this happens?

    Thanks
    Bart
  5. Ivan
    Admin
    Ivan avatar
    106 posts

    Posted 05 Sep 2014 Link to this post

    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.

     
  6. kittykitty
    kittykitty avatar
    5 posts
    Member since:
    Oct 2014

    Posted 10 Nov 2014 in reply to Ivan Link to this post

    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.
  7. Lorenzo
    Lorenzo avatar
    42 posts
    Member since:
    Jul 2009

    Posted 21 Nov 2014 in reply to kittykitty Link to this post

    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
Back to Top
DevCraft banner