[Mono-devel-list] Edit and Continue

David Srbecky dsrbecky at post.cz
Wed Aug 3 09:08:49 EDT 2005


Hello,

My name is David Srbecky and I am working on SharpDevelop 2.0 debugger.
The debugger is getting nearly finished, but it is still missing one
'cool' feature - edit and continue. The support for Edit and Continue
(EnC) from the side of Microsoft runtime is good enough, but there is no
support at all from the compiler side - all the functionality is private
and mostly part of VS. This effectively means that to support EnC, I
must write my own compiler. I would never try to that, but fortunately
there is mono to save the day. I would like to use the mono compiler to
produce the necessary deltas, which I must feed to MS runtime. The
problem is the I know neither the internals of mono compiler nor the
internals of System.Reflection.Emit and implementing support of EnC
would be a tedious or impossible task for me.

I have already contacted Marek Safar and after some long discussions we
have concluded that it might be technically possible.

.NET Framework 2.0 really does not support many 'edits' - adding private
methods/fields to classes and modifying bodies of existing methods more
or less sum it up and I would like to make work only the second one.

All I need is probably just one function 'RecompileFunction' in the mono
compiler, which would be used like that:

Driver.Main(new string[] {"MyProgram.cs"});
// I run the program
byte[] deltaIL, deltaMetadata;
Driver.RecompileFunction(
                           "MyClass.MyMethod",    // Function name
                           "return \"Hello\"; ",  // New body of function
                           out deltaIL,           // Produced IL code
                           out deltaMetadata      // Changed metadata
                           );
// I send the deltas to the runtime

The deltaIL is really nothing more then just the IL code of the compiled
function. deltaMetadata is a bit more complicated but it seems to me
that it has the same format as metadata saved in an assembly.

We had *long* discussions with Marek relating to that mono compiler will
not run on MS runtime and SharpDevelop will not run on mono runtime, but
I think we got the solution: everyone runs in its own runtime and .NET
Remoting connects the programs. I have written a little "Hello,
compiler!" application and it seems to work.

Are there any developers that are willing to help me please?

Regards,
David Srbecky







More information about the Mono-devel-list mailing list