VS得到返回在C#代码的价值? [英] VS get returned value in C# code?

查看:222
本文介绍了VS得到返回在C#代码的价值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在调试C / C在VS ++(?非托管)代码,走出一个函数后,你可以在'汽车'窗口中看到的返回值:

When debugging C/C++ (unmanaged?) code in VS, after stepping out of a function, you can see the returned value in the 'autos' window:

然而,这

如何让其他的返回值比临时变量弄乱代码的任何建议?

Any suggestion on how to get the return value other than cluttering the code with temporary variables?

推荐答案

这实际上是可见的。调试+其他的Windows +寄存器。看看EAX的值(RAX在64位)。简单的整型值EAX寄存器返回。龙在EDX:EAX。浮点在STX(报XMM00在64)。

It is actually visible. Debug + Other Windows + Registers. Look at the value of EAX (RAX in x64). The value of simple integral types are returned in the EAX register. Long in EDX:EAX. Floating point in STx (XMM00 in x64).

这已经很难实现,抖动确定方法是如何返回价值和不同的抖动会做出不同的选择。尤其所以当返回值的类型并不简单,就像一个结构。如果是大则抖动将保留在调用方法堆栈空间和一个指针传递给了空间,以便调用的方法可以复制有返回值。尽管如此,VS2013的终于将其提​​供,目前在预览可用。可见在汽车窗口,并通过在立即窗口中使用 $返回值内在变量并观看表达式。

This has been hard to implement, the jitter determines how methods return a value and different jitters will make different choices. Particularly so when the return value type isn't simple, like a struct. If it is large then the jitter will reserve stack space on the calling method and pass a pointer to that space so the called method can copy the return value there. Nevertheless, VS2013 finally made it available, currently available in preview. Visible in the Autos window and by using the $ReturnValue intrinsic variable in the Immediate window and watch expressions.

这篇关于VS得到返回在C#代码的价值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆