[Mono-dev] ptrace events in mono debugger

jonas echterhoff jonas at unity3d.com
Mon Apr 13 13:49:33 EDT 2009


(Cross-posting this to mono-devel as suggested by Joachim.)

Begin forwarded message:

> From: jonas echterhoff <jonas at unity3d.com>
> Date: April 10, 2009 1:38:29 PM GMT+02:00
> To: martin at ximian.com
> Cc: Joachim Ante <joe at unity3d.com>
> Subject: Porting Mono Debugger to OSX
>
> Hey Martin,
>
> I'm currently working on porting the mono debugger to Mac OS X. The  
> biggest issue here is that ptrace is only partially implemented, and  
> a lot of it's functionality needs to be replaced by mach-o code. At  
> this point, a lot of that actually works, reading/writing memory,  
> reading registers, reading the executable format, etc.
>
> Still, I don't get mdb to properly run an executable yet. I believe  
> the problem may be that in OS X, i don't get any events from ptrace,  
> which seem to be used to initialize the debugger (like  
> PTRACE_EVENT_CLONE, etc..). When ptrace stops, it always just gives  
> a normal SIGTRAP signal.
>
> Now, I don't have a Linux machine to see how this code should  
> actually work, so I'm wondering, when I start an executable in mdb,  
> which events needs to be sent to the debugger to properly initialize  
> it? Will ptrace stop multiple times on Linux before starting  
> execution (once when execd, once when the first thread is created,  
> etc)? On OS X, ptrace won't stop on thread creation.
>
> Regards,
> jonas
>



More information about the Mono-devel-list mailing list