[Mono-dev] Porting Mono Debugger to OSX
jonas at unity3d.com
Tue Apr 14 14:21:23 EDT 2009
On Apr 14, 2009, at 3:02 PM, Martin Baulig wrote:
>> 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.
> PTRACE_EVENT_CLONE etc. are extended notifications which need to be
> explicitly enabled via ptrace (PTRACE_SETOPTIONS) - but they may not
> be supported in all ptrace implementations. This is done in
> server_ptrace_initialize_process() in x86-linux-ptrace.c.
> But even without these extended notifications, you should still be
> able to get the "normal" ptrace events.
right. These extended notifications are not supported on OS X.
I got it to start up now without crashing, I will just have to find a
way to detect new threads (currently starting a new thread will not
stop execution), and to follow forks. That can wait for now.
But, now I'm wondering, how setting of breakpoints should work. When I
launch mdb, set some breakpoints like "b Y.Test", and then run, that
causes OperationActivateBreakpoints and OperationInsertBreakpoint
operations to be executed, which call the function
debugger_insert_source_breakpoint inside mono. But, the breakpoints
never seem to be actually set (no calls to
server_ptrace_insert_breakpoint). How is this supposed to be invoked?
Thanks for any help,
More information about the Mono-devel-list