Details

Add basic OpenBSD support. This is enough to be able to analyze core dumps for OpenBSD/amd64, OpenBSD/arm, OpenBSD/arm64 and OpenBSD/i386.

Note that part of the changes to source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp fix a bug that probably affects other platforms as well. The GetProgramHeaderByIndex() interface use 1-based indices, but in some case when looping over the headers the, the loop starts at 0 and misses the last header. This caused problems on OpenBSD since OpenBSD core dumps have the PT_NOTE segment as the last program header.

Looks like a great start. If you want to continue and get live process debugging working as well, you should definitely sync up with kamil (i.e. don't start from ProcessFreeBSD, his process plugin should be a much better starting point).

In terms of this patch, I have a couple of comments over the supported architectures. Also, please make sure you run clang-format over your diff, as some odd formatting has crept in.

I am not going to block this change over it, but it would be great (for the sake of your own platform) if you could try to generate a tiny core file to check in, to make sure that any further lldb changes to not break you. For linux, we've gotten these down to ~30k, but we've had some problems doing the same on FreeBSD (https://reviews.llvm.org/D26617), and unfortunately I haven't yet found time to investigate this.

That wouldn't work. The notes describing the registers have the thread ID attached to this name, i.e. "OpenBSD@250037". I'll need to parse that string to make core dumps of multi-threaded processes work later.