[Mono-list] Re: Questions in Interop

Paolo Molaro lupus at ximian.com
Tue Oct 4 10:26:50 EDT 2005


On 10/03/05 Shankari wrote:
> I want to know information like Details of CLR data
> structures, Domain information like
> System Domain: 793e9d58, LowFrequencyHeap: 793e9dbc, 
> HighFrequencyHeap: 793e9e14, StubHeap: 793e9e6c,
> Assembly: 0015aa68 [mscorlib], ClassLoader: 0015ab40

The mono runtime is implemented differently from the MS one, so you
should not expect the same kind of results.
When you run mono inside gdb, you can easily access similar info,
for example, on startup we currently have a single domain, called
mono_root_domain and you can print it's contents with:
	print *mono_root_domain
Info about corlib is accessible by inspecting mono_get_corlib():
	print *mono_get_corlib()
and so on.
For GC info, there are a few debug functions you can call there as well:
GC_dump() for example.

> and class related information like
> 
> Name: SimpleClass
> MethodTable 0x00955124
> EEClass 0x02ca33b0
> Size 36(0x24) bytes
> FieldDesc*: 00955064
>       MT    Field   Offset                 Type      
> Attr    Value Name
> 00955124  400000a        4         System.Int64  
> instance      31 l1

This could be easily implemented in a runtime function that can be
called from inside gdb: anyone willing to contribute it?

> Also, can I assume that the runtime object layout
> would be similar to windows as described in the msdn
> document 
> http://msdn.microsoft.com/msdnmag/issues/05/05/JITCompiler/default.aspx.

Currently Mono objects have a two word header, followed by the fields.
the first word in the header is a MonoVTable pointer. Inside the
MonoVTable you can find a pointer to the MonoClass describing the
object. I guess basically all the java, .net etc runtimes have a very
similar layout as this.

lupus

-- 
-----------------------------------------------------------------
lupus at debian.org                                     debian/rules
lupus at ximian.com                             Monkeys do it better


More information about the Mono-list mailing list