[Mono-list] Debugger installation tips

fd fd0h1440@yahoo.co.uk
08 Apr 2003 22:03:16 +0100

First off, congratulations to Martin on the recent debugger release.
It's shaping up as a genuinely useful tool for Mono development.

I hit a few bumps during the install so I'm going to share my findings
in the hope of helping others. These bumps can mostly be attributed to
RedHat 9, which introduces some new components.


To install the debugger, you first need libgc-mono, a modified version
of the Boehm GC. The release tarball (libgc-mono-6.1.tar.gz) won't build
with automake 1.6, but a fix has now been incorporated into CVS. Either
check out the libgc module or revert to an older version of automake to
build libgc-mono.


The debugger needs jay to be installed. I copied the version used
internally during the mcs build into $PATH.


RedHat 9 ships with an apparently broken binutils configuration devoid
of an appropriate build environment for applications like the Mono
debugger. To work around this:

ln -s /usr/lib/libbfd- /usr/lib/libbfd.so
ln -s /usr/lib/libopcodes- /usr/lib/libopcodes.so

With these symlinks created, you can proceed with the debugger build.


RedHat 9 ships with the Native POSIX Thread Library, a new
implementation of pthreads for Linux with extensive modifications to
both the kernel and userspace (libc).

       This thread library is designed to be binary compatible with the old
       LinuxThreads implementation; however, applications that rely on the
       places where the LinuxThreads implementation deviates from the POSIX
       standard will need to be fixed. Notable differences include:
       - Signal handling has changed from per-thread signal handling to POSIX
       process signal handling.
       - getpid() returns the same value in all threads.
       - Thread handlers registered with pthread_atfork are not run if
       vfork() is used - no manager thread

Unfortunately, the debugger (or perhaps the changes made to libgc) is
vulnerable to these changes. Trying to debug a program will result in:

** (Interpreter.exe:29424): WARNING **: i386-ptrace.c:241: Cannot attach
to process 29429: Operation not permitted

This can be worked around with an environment variable that tells libc
to mimic the behaviour of older kernels:

export LD_ASSUME_KERNEL=2.4.1

(Hopefully this quirk will be ironed out in a future release.)

You can then start mono-debug (GUI) or Interpreter.exe (console UI) to
start use the debugger.