开发者

Getting the return value of a method via DTE.Debugger without evaluating the method?

开发者 https://www.devze.com 2023-01-14 20:16 出处:网络
I\'m looking for a way to get the return value of a method via the Visual Studio Debugger (using DTE). Is it possible to obtain it if I\'m at the closing brace of the metho开发者_StackOverflowd, but n

I'm looking for a way to get the return value of a method via the Visual Studio Debugger (using DTE). Is it possible to obtain it if I'm at the closing brace of the metho开发者_StackOverflowd, but not yet exited? Also, it would be best if this could be possible without evaluating the function again via the immediate window.


Nope. The debugger doesn't have enough information about the exact way the JIT compiler generated the code to return the value. It is a heavy duty implementation detail of the jitter and the specific architecture it generates code for.

Simple types like objects and integral types are not much of a problem, usually the EAX/RAX register, FPU stack or XMM0 register. It gets convoluted when the method returns a struct. That gets mapped to registers it the struct fits, but needs to spill over in a temporary stack buffer when the struct is too large.

I suspect they'll need to do a lot of work on the metadata that the jitter generates to get that working. You'll know when that work is complete, it will become visible in the Autos window. Like it used to be, back in the simple days.

0

精彩评论

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