[lldb-dev] lldb patches for OpenBSD

Matthew Dempsky matthew at dempsky.org
Fri Apr 1 09:34:20 PDT 2011

On Fri, Apr 1, 2011 at 8:39 AM, Stephen Wilson <wilsons at start.ca> wrote:
> For linux we use 32-bit pids on all platforms I think.

OpenBSD pid_t's are 32-bit as well.

> But I have no
> big worries about growing lldb::tid_t to 64-bits if a platform needs to
> stuff a pointer in there.

Yes, that's what I had initially recommended to Amit for how to fix
this error.  Unless he discovered a reason not to do that, that's what
I'd still recommend.

> Out of curiosity, how does OpenBSD enumerate threads?

The currently supported threading library on OpenBSD still uses
userspace threading, and so the pthread_t identifiers are just
pointers to the thread control blocks that get allocated using
malloc(3), and hence might be arbitrary 64-bit pointer values.

There's also a second threading library still undergoing (slow)
development that uses kernel thread scheduling.  pthread_t identifiers
here are still pointers to the userspace thread control blocks, but
there's also a newly added system call getthrid() that returns a pid_t
that enumerates the kernel thread id directly.  (Obviously this system
call is only useful if the kernel thread library is in use.)

More information about the lldb-dev mailing list