[Mono-dev] runtime dbg library API proposal/impl

Paolo Molaro lupus at ximian.com
Thu Dec 6 05:53:39 EST 2007


On 12/05/07 Martin Baulig wrote:
> 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.

Can you elaborate why you have this requirement?
When you're debugging a target process it's either alive and you can use
ptrace or access /proc/pid/mem or it's dead and you access the core
file: why would you want to switch to one mechanism or the other on the
fly?

lupus

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



More information about the Mono-devel-list mailing list