check the about-to-be-returned value in the debugger [duplicate]
Possible Duplicate:
Can I find out the return value before returning while debugging in Visual Studio VS get returned value in C# code?
In Visual Studio 2010, is there a way to check the value that a method is about to return? I often find myself changing code like:
return myComplexOp(someOtherComplexOp(foo));
to
var ret = myComplexOp(someOtherComplexOp(foo));
return ret;
just to make it easier to debug? Is there an easier way?
With C++ code I am stepping out of the function (Shift + F11) and open Autos window (Debug, Windows, Autos). At this point it shows recently returned value like this:
It's not the most convenient thing, but it's still something. At least you can see the returned value without altering code as mentioned in original post.
If you enable the Registers
Windows, you can check EAX which should hold the return value.
精彩评论