[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, and I didn’t review them heavily. Nonetheless, I think this could help kickstart the new Windows branch and a lot of changes should be easy to review and include.

(Had to send patches as a zip archive since they reach the size limit of the list)

patches.zip (97.8 KB)

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, and I didn’t review them heavily. Nonetheless, I think this could help kickstart the new Windows branch and a lot of changes should be easy to review and include.

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

patches.7z (58.3 KB)