开发者

Viewing the return value of a method in the watch window

2 parts really;

// C# code
bool IsTrue()
{
  return true;
} // HERE
  1. Is the return value from the above method stored in the AX register when the instruction pointer is HERE
  2. Simply for convenience h开发者_高级运维ow can I get that register in the watch window (in addition to the register window), I tried AX, $AX, &AX, {AX} and used EAX or RAX with these tokens to no avail

EDIT: An objective is that I don't have to alter the code to see the results so adding a temp variable is out, the method above is a vast simplification and in the real code, as is common, these kinds of calls are nested, or in lambda expressions or multi element logical expressions


If I want to know the return value of a function, I assign the value to a variable and return that variable instead. Old habits of Console.WriteLine()-debugging.. but it works.


Apparently this feature will be available in VS2013 http://blogs.msdn.com/b/visualstudioalm/archive/2013/06/27/seeing-function-return-values-in-the-debugger-in-visual-studio-2013.aspx

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜