[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mono-list
Subject:    Re: [Mono-list] Re: Questions in Interop
From:       Paolo Molaro <lupus () ximian ! com>
Date:       2005-10-04 14:26:50
Message-ID: 20051004142650.GQ10115 () debian ! org
[Download RAW message or body]

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@debian.org                                     debian/rules
lupus@ximian.com                             Monkeys do it better
_______________________________________________
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic