[Mono-list] Re: [Mono-cvs-list] Mono CVS: mono martin
18 Jan 2003 14:51:48 +0100
Paolo Molaro <email@example.com> writes:
> > > Log message:
> > > 2003-01-16 Martin Baulig <firstname.lastname@example.org>
> > >
> > > * jit.c (mono_runtime_install_handlers): Use SYS_sigaction() for
> > > the mono_thread_get_abort_signal () - this is SIGUSR1 on FreeBSD
> > > and the LinuxThreads port doesn't allow you to override the handler.
> Why should we use the LinuxThreads port on FreeBSD?
> There must be a very compelling reason not to use the native thread
> library on FreeBSD (like, it's impossible to make it work).
You can only debug multi-threaded applications if they're using LinuxThreads. The problem
is that the debugger needs kernel-level threads, not user-space threads.
The native thread library uses user-space threads and it'd be an extremely huge task to
support this in the debugger - and it'd need to be done for each platform. If you're
using user-space threads, they're just one single process for the kernel.
On the other hand, LinuxThreads is already ported to FreeBSD and OpenBSD and it'll
probably also work on NetBSD and other flavors of BSD, so we get the debugger easily
ported to these platforms. It's using rfork() to create a new kernel process for each
thread, so the debugger can ptrace(PT_ATTACH) to them.