简体   繁体   English

可以在调试上下文中使用Mono编译器作为服务吗?

[英]Can the Mono compiler as a service be used in a debugging context?

I'd like to know if and how I might be able to use the Mono compiler as a service (see here and here ) within a debugging context to query/modify/visualize/etc objects at runtime within the debugger. 我想知道是否以及如何在调试环境中使用Mono编译器作为服务(请参阅此处此处 ),以在调试器中的运行时查询/修改/可视化/ etc对象。 At the moment, per this SO post the Roslyn CTP does not support this feature. 目前,根据这篇SO帖子 ,Roslyn CTP不支持此功能。

Yes, thats perfectly possible. 是的,那完全可能。 I cannot tell you the exact details on how to implement this, but take a look at MonoDevelop which actually implements your idea since v2.8 (or maybe earlier). 我无法告诉你有关如何实现这一点的确切细节,但请看一下从v2.8(或者更早)开始实际实现你的想法的MonoDevelop。 In MonoDevelop, you have a REPL Pad available, which allows you to enter C# code in the very same context your application stopped because of a breakpoint. 在MonoDevelop中,您可以使用REPL Pad,它允许您在应用程序因断点而停止的相同上下文中输入C#代码。 I've attached a simple Screenshot of MD in the debugging view and the REPL pad open. 我在调试视图中附加了一个简单的MD屏幕截图,并打开了REPL pad。 Since MD is opensource, you could check out the sources how it was implemented and strip the parts that you need. 由于MD是开源的,您可以查看源的实现方式并删除所需的部件。

调试时使用Direct / REPL评估窗口的MonoDevelop的屏幕截图

I think it should be feasible because Mono Soft Debugger is part of the Mono runtime so you could use the "Debugger Agent": 我认为它应该是可行的,因为Mono Soft Debugger是Mono运行时的一部分,所以你可以使用“Debugger Agent”:

The debugger agent is a module inside the mono runtime which offers debugging services to client programs. 调试器代理是单声道运行时内部的一个模块,它为客户端程序提供调试服务。

So, one alternative could be trying to interface with the Mono Soft Debugger in your compiler as service (which runs on top of the Mono runtime). 因此,一种替代方法可能是尝试将编译器中的Mono Soft Debugger作为服务(在Mono运行时之上运行)进行交互。

As the Mono Soft Debugger is used in the MonoDevelop IDE you could also investigate if this IDE could be used for what you are looking for. 由于Mono Soft Debugger用于MonoDevelop IDE,您还可以调查此IDE是否可用于您正在寻找的内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM