lldb patches for FreeBSD


I installed FreeBSD 8.2 amd64 and trying to see how far lldb compiles,
seeing as OpenBSD lacks shm_open/shm_unlink and some posix shared
memory functionality right now. Note: FreeBSD 8.2 amd64 has system gcc
of 4.2.1, the last GPLv2 gcc with some patches before the switch to
GPLv3, if I am not mistaken.

It seems FreeBSD is also affected like OpenBSD about the thread id
issue discussed a month before in this thread. I am cc'ing matthew@
just to keep him in the loop.

and it was resolved to fix it like so

I don't know what should be the replacement for FreeBSD, as that
particular piece of code in lldb/source/Host/common/Host.cpp is a
dirty hack to allow compile to proceed.

This is not okay to include otherwise.
Can somebody from freebsd-hackers speak up? Or just give the correct
diff for FreeBSD?

I am stuck in this for now. I will take it up later.
/stuff/llvm/tools/lldb/source/Symbol/ClangASTContext.cpp:1471: error:
ISO C++ forbids variable-size array 'params'

Here's what I got so far, small things all related to compile.


Index: include/lldb/Host/Host.h

lldb.diff (7.34 KB)

Check out this code from FreeBSD's OpenJDK6 port:

#if __FreeBSD_version > 900030
  return pthread_getthreadid_np();
  long tid;
  return (pid_t)tid;

The underlying type of a tid (lwpid_t in kernel) is an int.