调试托管代码:查看返回值

时间:2022-12-23 07:30:33

On Win32, with unmanaged code, the return value is usually stored in the EAX register. This is useful when the program doesn't save the return value in a variable. This can easily be seen in the Visual Studio debugger.

在Win32上,使用非托管代码,返回值通常存储在EAX寄存器中。当程序不将返回值保存在变量中时,这很有用。这可以在Visual Studio调试器中轻松看到。

Is there an equivalent for managed code?

托管代码是否相同?

1 个解决方案

#1


It is true that the JIT compiler will still use the EAX register for simple value types, that trick requires enabling mixed native and managed debugging. The truth is, there's no simple way to do this in Visual Studio at the moment. This is something being considered for a future release. Shall I consider this an official request? :-)

确实,JIT编译器仍将EAX寄存器用于简单的值类型,该技巧需要启用混合本机和托管调试。事实是,目前在Visual Studio中没有简单的方法可以做到这一点。这是未来发布的考虑因素。我认为这是官方要求吗? :-)

#1


It is true that the JIT compiler will still use the EAX register for simple value types, that trick requires enabling mixed native and managed debugging. The truth is, there's no simple way to do this in Visual Studio at the moment. This is something being considered for a future release. Shall I consider this an official request? :-)

确实,JIT编译器仍将EAX寄存器用于简单的值类型,该技巧需要启用混合本机和托管调试。事实是,目前在Visual Studio中没有简单的方法可以做到这一点。这是未来发布的考虑因素。我认为这是官方要求吗? :-)