开发者

check the about-to-be-returned value in the debugger [duplicate]

开发者 https://www.devze.com 2023-04-10 02:33 出处:网络
This question already 开发者_如何转开发has answers here: Closed 11 years ago. Possible Duplicate:
This question already 开发者_如何转开发has answers here: Closed 11 years ago.

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:

check the about-to-be-returned value in the debugger [duplicate]

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号