I suggest you ...

Function return value in debugger

I want to able to see function return value in managed debugger just like unmanaged debuger (it has this feature from Visual Studio 6.0!).

1,096 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    Rail SabirovRail Sabirov shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    13 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...
      • Anonymous commented  ·   ·  Flag as inappropriate

        Currently, this feature doesn't work as well in the Watch and Immediate Windows as it does in the Auto Window.

        Can this be worked on?

      • gzakgzak commented  ·   ·  Flag as inappropriate

        Actually, a simple compromise which can potentially satisfy a large percentage of users is to make the "return" keyword mouse-overable like any other local variable in the function, assuming the line has already been executed.

        Currently, you can always step to the closing brace after any given return statement, so essentially you'd step over the return statement to the following closing brace, and at that point you'd be able to mouse over the "return" keyword to see what was about to be returned.

      • AnonymousAnonymous commented  ·   ·  Flag as inappropriate

        If implemented, this would be so handy and useful!!! Please, please make it true.

        cateyes

      • Visual Studio UV Site AdminAdminVisual Studio UV Site Admin (Admin, Microsoft) commented  ·   ·  Flag as inappropriate

        For those out there who have experience debugging native C++ or VB6 code, you may have used a feature where function return values are provided for you in the Autos window. Unfortunately, this functionality does not exist for managed code. While you can work around this issue by assigning the return values to a local variable, this is not as convenient because it requires modifying your code.
        In managed code, it’s a lot trickier to determine what the return value of a function you’ve stepped over. We realized that we couldn’t do the right thing consistently here and so we removed the feature rather than give you incorrect results in the debugger. However, we want to bring this back for you and our CLR and Debugger teams are looking at a number potential solutions to this problem. Unfortunately this is will not be part of Visual Studio 11.

      • Omer RavivOmer Raviv commented  ·   ·  Flag as inappropriate

        I implemented this feature as part of a commercial extension to Visual Studio called "BugAid", currently in beta.
        Not only does it support seeing the return value of the method before stepping out of it, but also seeing the return value of the method calls you stepped over. Please see my blog post on the subject: http://www.bugaidsoftware.com/2011/11/tips-for-using-statement-visualization/ and try it out for yourself!

      • DeonHe - MSFTDeonHe - MSFT commented  ·   ·  Flag as inappropriate

        Thank you all for voting on this idea. I have moved it to the team that can better address this issue.

        -Deon (MSFT)

      • Timo BoehmeTimo Boehme commented  ·   ·  Flag as inappropriate

        Just open the "Auto" Tab in window menu and you will get more than the VB6 informations.

      • james.manningjames.manning commented  ·   ·  Flag as inappropriate

        Jared blogged about this, kind of. I don't like that he 'throws the baby out with the bathwater' by including the case of stepped-over functions (I'd rather have an option that makes me set a breakpoint at the end of a function than no option at all!), but it's on topic for this suggestion at least. :)

        http://blogs.msdn.com/b/jaredpar/archive/2011/01/12/why-the-debugging-difference-between-c-and-vb-net-return-values.aspx

      Feedback and Knowledge Base