Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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. At the moment, per this SO post the Roslyn CTP does not support this feature.

like image 531
lightw8 Avatar asked Nov 22 '11 18:11

lightw8


1 Answers

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). 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. I've attached a simple Screenshot of MD in the debugging view and the REPL pad open. Since MD is opensource, you could check out the sources how it was implemented and strip the parts that you need.

Screenshot of MonoDevelop using Direct/REPL evaluation window while debugging

like image 56
Dynalon Avatar answered Sep 22 '22 23:09

Dynalon