Say I have this C# method:
public bool GetVal()
{
return a1 == b1 || c1 == d1 || GetE1() == GetF1(); // Illustrating complicated logic here..
}
I don’t want to modify the content of the variables / return values of methods in the statement above, but want to return false to the method that’s calling GetVal().
Is it possible to use the VS2010 debugger to somehow modify the return value in the same way that I can modify variable values on the fly? Perhaps modifying the call stack somehow?
It’s not possible to modify the return value directly in this manner. Managed code has very limited / no support for seeing the return value of a function call as compared to C++.
But what you can do is go to the call site and modify the variable which is assigned the value of function call.