[Mono-dev] Edit and Continue / Function body rewrite

Brian Crowell mono-devel at fluggo.com
Fri Jul 7 14:41:55 EDT 2006


David Srbecky wrote:
> The idea is that I will emit disk assembly using System.Reflection.Emit 
> as usually, but later on I will re-emit body of some function and fetch 
> changed data into memory. Once I got the data I can feed it to the .NET 
> runtime - that should not be a problem.

Er, I don't know the full internals of the Mono runtime, but I suspect this is 
not that easy to do. Correct me if I'm wrong, but I think one of the main 
reasons assemblies cannot be unloaded is that it allows you to make some very 
nice assumptions about the immutability of code-- for example, that function 
pointers will not change. It may require patching previously JITted code to 
reference a new function.

Of course, I'd be happy to be wrong about this. Obviously, since Microsoft did 
it, there must be a way.

--Brian



More information about the Mono-devel-list mailing list