[Mono-dev] runtime dbg library API proposal/impl
Martin Baulig
martin at ximian.com
Wed Dec 5 17:17:00 EST 2007
Attached is a new API which actually works.
There are two parts - an unmanaged library in mono/mini/ and a managed
API in class/Mono.Runtime.DebuggerSupport. This has the advantage that
we will already catch API changes at compilation time instead of getting
DllImport-errors or even crashes at runtime.
We can also modify the delegate if necessary, maybe store it internally
and add an `ITargetMemoryAccess' argument or something like that.
There is just one important thing to keep in mind:
> public TargetAddress MonoClassGetMonoImage (ITargetMemoryAccess memory,
> TargetAddress klass)
> {
> IntPtr image = mono_debugger_support_mono_class_get_image (
> memory.ReadMemory, klass.Address);
> return new TargetAddress (image);
> }
You have to use the `memory' instance to read memory (we may add other
methods to it if necessary) - but you do not "own" it. It is absolutely
forbidden to store this anywhere or use it after the method returned
control back to the debugger.
--
Martin Baulig - martin at novell.com
Novell GmbH, Düsseldorf
GF: Volker Smid, Djamel Souici; HRB 21108 (AG Düsseldorf)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: classlib.diff
Type: text/x-patch
Size: 3377 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20071205/e1df5c48/attachment.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: runtime.diff
Type: text/x-patch
Size: 1877 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20071205/e1df5c48/attachment-0001.bin
More information about the Mono-devel-list
mailing list