通过 DTE.Debugger 获取方法的返回值而不评估该方法?
我正在寻找一种通过 Visual Studio 调试器(使用 DTE)获取方法的返回值的方法。如果我位于方法的右大括号但尚未退出,是否可以获得它?此外,如果无需通过立即窗口再次评估该函数,这也是可能的,那就最好了。
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 method, but not yet exited? Also, it would be best if this could be possible without evaluating the function again via the immediate window.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
没有。调试器没有足够的信息来了解 JIT 编译器生成代码以返回值的确切方式。它是抖动及其生成代码的特定架构的重载实现细节。
像对象和整型这样的简单类型并不是什么大问题,通常是 EAX/RAX 寄存器、FPU 堆栈或 XMM0 寄存器。当该方法返回一个结构时,它会变得复杂。它被映射到结构适合的寄存器,但当结构太大时需要溢出到临时堆栈缓冲区中。
我怀疑他们需要对抖动生成的元数据做大量工作才能使其正常工作。您会知道该工作完成后,它将在“自动”窗口中可见。就像以前一样,回到简单的日子。
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.