[patches] Windows support

Hi.

I just saw a new branch for Windows has been created, and since I’ve had this work sitting here on the hard drive, waiting for me to have more time to work on it, I might as well contribute them now, and see if they can help the current effort to port LLDB to Windows.

Right now they add a new CMake-based build system, I’ve only tested it on Windows, so I’m sure it needs some work to properly support other platforms. The existing code is pretty POSIX-specific and this gives a lot of trouble on Windows, so I’ve replaced what I could with replacements. From what I remember, the main ones were LLVM regex support and Win32 native threads / concurrency stuff. Some non-portable POSIX functions were added to a Windows-only file that eases out porting the codebase and some stuff that has no equivalent on Windows was stubbed out (POSIX terminal functions).

The driver is also pretty messy, using a lot of non-portable, in the last patch you can see I started a refactoring of it, but it still needs work.

At the current state it can run on Windows, but nothing debug-related was added, that was my next step, but I’ve been busy doing other LLVM / Clang-related Windows work.

I’ve tried to keep the patches contained and small, but since I just split them up from a big soup of changes, it’s probably messy in a couple of places. Nonetheless, I think this could be helpful to the new Windows branch.

Note: Had to send patches as a 7-Zip archive since they reach the size limit of the list, even as a zip.

Here’s a link to a regular zip archive if that’s more convenient: https://dl.dropbox.com/u/194502/dev/lldb-windows-patches.zip

(The previous email to the list seems to be corrupted on the web interface, sending this again.)

patches.7z (58.3 KB)