How to see Return Values

When debugging, I have been unable to get Rider to show me values returned from functions.

I have clicked on the 3 dots → Debugger settings and have picked “Show Function return values”, as you can see in the attached  screenshot.
.
However, while executing, I never see any returned values in the variables tab.  Does anyone know what I need to do?

0
5 comments

Hello,

Thank you for contacting Rider support and for your question.

Due to native debugger limitations used by Rider (lldb), this feature works different in Unreal Engine/C++ projects. Unfortunately, the return value is reported only on Step Out of the method. In other words: it works in two following scenarios:

  • Breakpoint inside a method is hit, press the Step Out button;
  • Execution is stopped on sample method invocation: press Step In, then Step Out; 

Hope that helps. Should you have any other questions or difficulties, please let me know.

Have a nice day!

0

Hi!
In my case, that context menue is not shown on a standard C# .net web application as well.
Is there any workaround for that?

0

Hello Mostafa,

Thank you for contacting Rider support.

Would you mind elaborating on the problem and sharing an extra screenshot that demonstrates the issue? I am afraid I didn't get the problem. Do you mean this context menu by chance?

0

Sorry for the confusion! 
I meant the “Show Method Return Values context” option under the Debugger Settings menu. (similar to this in WebStorm)
I want to simply look into the return value of a method with an expression body. e.g.

public int Sum(int x, int y) => x + y;

While debugging, I want to see what Sum returns in place. 
Currently what I do is to assign the result on an auxiliary variable and put a breakpoint on that which is not practical. e.g.

public static int Sum(int x, int y)
{
    var z = x + y;
    return z;
}

0

Hello Mostafa,

Please ensure the option “Settings | Build, Execution, Deployment | Debugger | Show return values” is turned on.

Can you see the return value after “Step Over” on Sum method invocation? Look at the screenshots below:

0

Please sign in to leave a comment.