[Mono-devel-list] Assembly Manipulation Libraries

Jim Purbrick jimpurbrick at yahoo.co.uk
Thu Apr 28 07:57:16 EDT 2005


I'm currently looking at implementing thread migration
by injecting stack saving and loading code in to
methods in a similar way to the JavaGoX and
PicoThreads systems.

I want to implement the mechanism as a bytecode
translator so it will be able to work with any
language that targets the CLR. I'm currently looking
for C/C++ or C# libraries for manipulating CLR
assemblies. If you know of any, I'd really like to
hear about them.

The most promising library I've found so far is the
RAIL .NET instrumentation framework
http://rail.dei.uc.pt/ which is built on top of the
Mono.PEToolkit and Reflection.Emit and allows high
level OO manipulation of assemblies. I've got the
examples working under .NET, but get errors when
running it under Mono 1.1.4 on Windows in
System.Reflection.Assembly:GetModulesInternal. Has
anyone got RAIL running on Mono? Here's the full stack
trace:

Unhandled Exception: System.NullReferenceException:
Object reference not set to
an instance of an object
in (unmanaged) 004C5AC4
in <0x00004> (wrapper managed-to-native)
System.Reflection.Assembly:GetModulesIn
ternal ()
in [0x00001] (at
C:\cygwin\download\mono-1.1.4\mcs\class\corlib\System.Reflectio
n\Assembly.cs:582)
System.Reflection.Assembly:GetModules (bool)
in [0x0002e] (at
C:\cygwin\download\mono-1.1.4\mcs\class\corlib\System.Reflectio
n\Assembly.cs:568)
System.Reflection.Assembly:GetModule (string)
in <0x00051> Rail.Reflect.TypeResolver:ResolveRModule
(Rail.Reflect.RModuleDef,s
tring)
in <0x00636> Rail.Reflect.RAssemblyDef:ReturnAssembly
(string)
in <0x00038>
Rail.Reflect.RAssemblyDef:RunAndSaveAssembly
(object[])
in [0x0000d] (at
C:\Work\RAIL\examples\RailTester.cs:340)
AssemblyReading.RailTe
ster:RunAndSaveAssembly ()
in [0x00007] (at
C:\Work\RAIL\examples\RailTester.cs:358)
AssemblyReading.RailTe
ster:.ctor (string)
in [0x00003] (at
C:\Work\RAIL\examples\RailTester.cs:363)
AssemblyReading.RailTe
ster:Main (string[])

Send instant messages to your online friends http://uk.messenger.yahoo.com 



More information about the Mono-devel-list mailing list