[Lldb-commits] Windows command-line driver - PlatformWindows patch

Deepak Panickal deepak at codeplay.com
Fri Sep 27 09:22:29 PDT 2013


Hi,

We would like to submit our first patch which will add PlatformWindows 
(based on the PlatformWindows plugin from the previous Windows branch 
with minor modifications). A Windows compatible command-line driver 
which we'll provide another patch for today depends on the presence of 
PlatformWindows to function properly.

We have ran the test suite on Linux, and it passes succesfully.
In developing this patch for Windows, we used Visual Studio 2013 RC as 
the compiler.

The patch is based on trunk revision, 
https://llvm.org/svn/llvm-project/lldb/trunk@191399

( Additionally we also have successfully backported LLDB to build 
cleanly on Visual Studio 2012. Would this support be of interest to 
anyone? )

Thanks,
Deepak Panickal
-------------- next part --------------
diff --git CMakeLists.txt CMakeLists.txt
index b73f876..d49d2a3 100644
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -1,272 +1,272 @@
-# If we are not building as a part of LLVM, build LLDB as an
-# standalone project, using LLVM as an external library:
-if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
-  project(lldb)
-  cmake_minimum_required(VERSION 2.8)
-
-  set(LLDB_PATH_TO_LLVM_SOURCE "" CACHE PATH
-    "Path to LLVM source code. Not necessary if using an installed LLVM.")
-  set(LLDB_PATH_TO_LLVM_BUILD "" CACHE PATH
-    "Path to the directory where LLVM was built or installed.")
-    
-  set(LLDB_PATH_TO_CLANG_SOURCE "" CACHE PATH
-    "Path to Clang source code. Not necessary if using an installed Clang.")
-  set(LLDB_PATH_TO_CLANG_BUILD "" CACHE PATH
-    "Path to the directory where Clang was built or installed.")    
-
-  set(LLDB_DISABLE_PYTHON 1 BOOL "Disables the Python scripting integration.")
-
-  if (LLDB_PATH_TO_LLVM_SOURCE)
-    if (NOT EXISTS "${LLDB_PATH_TO_LLVM_SOURCE}/cmake/config-ix.cmake")
-      message(FATAL_ERROR "Please set LLDB_PATH_TO_LLVM_SOURCE to the root "
-              "directory of LLVM source code.")
-    else()
-      get_filename_component(LLVM_MAIN_SRC_DIR ${LLDB_PATH_TO_LLVM_SOURCE}
-                             ABSOLUTE)
-      list(APPEND CMAKE_MODULE_PATH "${LLVM_MAIN_SRC_DIR}/cmake/modules")
-    endif()
-  endif()
-  
-  if (LLDB_PATH_TO_CLANG_SOURCE)
-      get_filename_component(CLANG_MAIN_SRC_DIR ${LLDB_PATH_TO_CLANG_SOURCE}
-                             ABSOLUTE)
-  endif()  
-
-  list(APPEND CMAKE_MODULE_PATH "${LLDB_PATH_TO_LLVM_BUILD}/share/llvm/cmake")
-
-  get_filename_component(PATH_TO_LLVM_BUILD ${LLDB_PATH_TO_LLVM_BUILD}
-                         ABSOLUTE)
-                         
-  get_filename_component(PATH_TO_CLANG_BUILD ${LLDB_PATH_TO_CLANG_BUILD}
-                         ABSOLUTE)                         
-                         
-  include(AddLLVM)
-  include("${LLDB_PATH_TO_LLVM_BUILD}/share/llvm/cmake/LLVMConfig.cmake")
-  include(HandleLLVMOptions)
-
-  set(PACKAGE_VERSION "${LLVM_PACKAGE_VERSION}")
-
-  set(LLVM_MAIN_INCLUDE_DIR "${LLVM_MAIN_SRC_DIR}/include")
-  set(LLVM_BINARY_DIR ${CMAKE_BINARY_DIR})
-  
-  set(CLANG_MAIN_INCLUDE_DIR "${CLANG_MAIN_SRC_DIR}/include")
-
-  set(CMAKE_INCLUDE_CURRENT_DIR ON)
-  include_directories("${PATH_TO_LLVM_BUILD}/include"
-                      "${LLVM_MAIN_INCLUDE_DIR}"
-                      "${PATH_TO_CLANG_BUILD}/include"
-                      "${CLANG_MAIN_INCLUDE_DIR}"
-                      "${CMAKE_CURRENT_SOURCE_DIR}/source")
-  link_directories("${PATH_TO_LLVM_BUILD}/lib"
-                   "${PATH_TO_CLANG_BUILD}/lib")
-
-  set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
-  set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
-  set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
-
-  set(LLDB_BUILT_STANDALONE 1)
-  
-  if (LLDB_DISABLE_PYTHON)
-    add_definitions( -DLLDB_DISABLE_PYTHON )
-  endif() 
-endif()
-
-if ( CMAKE_SYSTEM_NAME MATCHES "Windows" )
-  add_definitions( -DLLDB_DISABLE_PYTHON )
-endif ()
-
-macro(add_lldb_definitions)
-  # We don't want no semicolons on LLDB_DEFINITIONS:
-  foreach(arg ${ARGN})
-    set(LLDB_DEFINITIONS "${LLVM_DEFINITIONS} ${arg}")
-  endforeach(arg)
-  add_definitions( ${ARGN} )
-endmacro(add_lldb_definitions)
-
-include_directories(/usr/include/python2.7)
-include_directories(../clang/include)
-include_directories("${CMAKE_CURRENT_BINARY_DIR}/../clang/include")
-
-# lldb requires c++11 to build. Make sure that we have a compiler and standard
-# library combination that can do that.
-if (MSVC11 OR MSVC12)
-  # Do nothing, we're good.
-elseif (NOT MSVC)
-  # gcc and clang require the -std=c++0x or -std=c++11 flag.
-  if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU" OR
-      "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
-    if (NOT ("${CMAKE_CXX_FLAGS}" MATCHES "-std=c\\+\\+0x" OR
-             "${CMAKE_CXX_FLAGS}" MATCHES "-std=gnu\\+\\+0x" OR
-             "${CMAKE_CXX_FLAGS}" MATCHES "-std=c\\+\\+11" OR
-             "${CMAKE_CXX_FLAGS}" MATCHES "-std=gnu\\+\\+11"))
-      if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
-        if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.7")
-          set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
-        else()
-          set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
-        endif()
-      else()
-        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
-      endif()
-    endif()
-  endif()
-else()
-  message(FATAL_ERROR "The selected compiler does not support c++11 which is "
-          "required to build lldb.")
-endif()
-
-# Disable Clang warnings
-if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
-  add_lldb_definitions(
-    -Wno-deprecated-declarations # Suppress "deprecated auto_ptr" warnings
-  )
-endif()
-
-if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang"
-    AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "3.3")
-  add_lldb_definitions(
-    -Wno-deprecated-register # Suppress "deprecated register keyword" warnings
-  )
-endif()
-
-# Disable MSVC warnings
-if( MSVC )
-  add_lldb_definitions(
-    -wd4018 # Suppress 'warning C4018: '>=' : signed/unsigned mismatch'
-    -wd4068 # Suppress 'warning C4068: unknown pragma'
-    -wd4150 # Suppress 'warning C4150: deletion of pointer to incomplete type'
-    -wd4521 # Suppress 'warning C4521: 'type' : multiple copy constructors specified'
-  )
-endif() 
-
-# If building on a 32-bit system, make sure off_t can store offsets > 2GB
-if( CMAKE_SIZEOF_VOID_P EQUAL 4 )
-  add_lldb_definitions(
-    -D_LARGEFILE_SOURCE
-    -D_FILE_OFFSET_BITS=64
-    )
-endif()
-
-set(LLDB_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
-set(LLDB_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
-
-if (CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
-  message(FATAL_ERROR "In-source builds are not allowed. CMake would overwrite "
-"the makefiles distributed with LLDB. Please create a directory and run cmake "
-"from there, passing the path to this source directory as the last argument. "
-"This process created the file `CMakeCache.txt' and the directory "
-"`CMakeFiles'. Please delete them.")
-endif()
-
-# Compute the LLDB version from the LLVM version.
-string(REGEX MATCH "[0-9]+\\.[0-9]+(\\.[0-9]+)?" LLDB_VERSION
-  ${PACKAGE_VERSION})
-message(STATUS "LLDB version: ${LLDB_VERSION}")
-
-macro(add_lldb_library name)
-  llvm_process_sources(srcs ${ARGN})
-  if (MSVC_IDE OR XCODE)
-    string(REGEX MATCHALL "/[^/]+" split_path ${CMAKE_CURRENT_SOURCE_DIR})
-    list(GET split_path -1 dir)
-    file(GLOB_RECURSE headers
-      ../../include/lldb${dir}/*.h)
-    set(srcs ${srcs} ${headers})
-  endif()
-  if (MODULE)
-    set(libkind MODULE)
-  elseif (SHARED_LIBRARY)
-    set(libkind SHARED)
-  else()
-    set(libkind STATIC)
-  endif()
-  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
-  add_library(${name} ${libkind} ${srcs})
-  #if (LLVM_COMMON_DEPENDS)
-  ##add_dependencies(${name} ${LLVM_COMMON_DEPENDS})
-  #endif()
-
-  if(LLDB_USED_LIBS)
-    if (CMAKE_SYSTEM_NAME MATCHES "Linux" OR CMAKE_SYSTEM_NAME MATCHES "FreeBSD" OR CMAKE_SYSTEM_NAME MATCHES "Windows")
-      target_link_libraries(${name} -Wl,--start-group ${LLDB_USED_LIBS} -Wl,--end-group)
-    else()
-      target_link_libraries(${name} ${LLDB_USED_LIBS})
-    endif()
-  endif()
-  target_link_libraries(${name} ${CLANG_USED_LIBS})
-  target_link_libraries(${name} ${LLVM_USED_LIBS})
-  llvm_config(${name} ${LLVM_LINK_COMPONENTS})
-  target_link_libraries(${name} ${LLVM_COMMON_LIBS})
-  link_system_libs(${name})
-  if (LLVM_COMMON_DEPENDS)
-    add_dependencies(${name} ${LLVM_COMMON_DEPENDS})
-  endif()
-
-  # Hack: only some LLDB libraries depend on the clang autogenerated headers,
-  # but it is simple enough to make all of LLDB depend on some of those
-  # headers without negatively impacting much of anything.
-  set (LLDB_DEPENDENCIES
-    libclang
-    )
-  add_dependencies(${name} ${LLDB_DEPENDENCIES})
-
-  install(TARGETS ${name}
-    LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
-    ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX})
-  set_target_properties(${name} PROPERTIES FOLDER "lldb libraries")
-endmacro(add_lldb_library)
-
-macro(add_lldb_executable name)
-  #add_llvm_executable(${name} ${ARGN})
-  llvm_process_sources( ALL_FILES ${ARGN} )
-  add_executable(${name} ${ALL_FILES})
-  #target_link_libraries(${name} ${CLANG_USED_LIBS})
-  #llvm_config( ${name} ${LLVM_LINK_COMPONENTS} )
-  #link_system_libs( ${name} )
-  #if (LLVM_COMMON_DEPENDS)
-  #add_dependencies(${name} ${LLVM_COMMON_DEPENDS})
-  #endif()
-  set_target_properties(${name} PROPERTIES FOLDER "lldb executables")
-endmacro(add_lldb_executable)
-
-include_directories(BEFORE
-  ${CMAKE_CURRENT_BINARY_DIR}/include
-  ${CMAKE_CURRENT_SOURCE_DIR}/include
-  )
-
-install(DIRECTORY include/
-  DESTINATION include
-  FILES_MATCHING
-  PATTERN "*.h"
-  PATTERN ".svn" EXCLUDE
-  )
-
-
-# Find libraries or frameworks that may be needed
-if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
-  find_library(CARBON_LIBRARY Carbon)
-  find_library(FOUNDATION_LIBRARY Foundation)
-  find_library(CORE_FOUNDATION_LIBRARY CoreFoundation)
-  find_library(CORE_SERVICES_LIBRARY CoreServices)
-  find_library(SECURITY_LIBRARY Security)
-  find_library(DEBUG_SYMBOLS_LIBRARY DebugSymbols PATHS "/System/Library/PrivateFrameworks")
-
-  set(LIBXML2_INCLUDE_DIR "/usr/include/libxml2")
-  list(APPEND system_libs xml2)
-  list(APPEND system_libs ${CARBON_LIBRARY} ${FOUNDATION_LIBRARY}
-  ${CORE_FOUNDATION_LIBRARY} ${CORE_SERVICES_LIBRARY} ${SECURITY_LIBRARY}
-  ${DEBUG_SYMBOLS_LIBRARY})
-endif()
-
-# On FreeBSD, link libexecinfo because libc is missing  backtrace()
-if (CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
-  list(APPEND system_libs execinfo)
-endif()
-
-#add_subdirectory(include)
-add_subdirectory(docs)
-if (NOT CMAKE_SYSTEM_NAME MATCHES "Windows")
-  add_subdirectory(scripts)
-endif()
-add_subdirectory(source)
-add_subdirectory(test)
-add_subdirectory(tools)
+# If we are not building as a part of LLVM, build LLDB as an
+# standalone project, using LLVM as an external library:
+if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
+  project(lldb)
+  cmake_minimum_required(VERSION 2.8)
+
+  set(LLDB_PATH_TO_LLVM_SOURCE "" CACHE PATH
+    "Path to LLVM source code. Not necessary if using an installed LLVM.")
+  set(LLDB_PATH_TO_LLVM_BUILD "" CACHE PATH
+    "Path to the directory where LLVM was built or installed.")
+    
+  set(LLDB_PATH_TO_CLANG_SOURCE "" CACHE PATH
+    "Path to Clang source code. Not necessary if using an installed Clang.")
+  set(LLDB_PATH_TO_CLANG_BUILD "" CACHE PATH
+    "Path to the directory where Clang was built or installed.")    
+
+  set(LLDB_DISABLE_PYTHON 1 BOOL "Disables the Python scripting integration.")
+
+  if (LLDB_PATH_TO_LLVM_SOURCE)
+    if (NOT EXISTS "${LLDB_PATH_TO_LLVM_SOURCE}/cmake/config-ix.cmake")
+      message(FATAL_ERROR "Please set LLDB_PATH_TO_LLVM_SOURCE to the root "
+              "directory of LLVM source code.")
+    else()
+      get_filename_component(LLVM_MAIN_SRC_DIR ${LLDB_PATH_TO_LLVM_SOURCE}
+                             ABSOLUTE)
+      list(APPEND CMAKE_MODULE_PATH "${LLVM_MAIN_SRC_DIR}/cmake/modules")
+    endif()
+  endif()
+  
+  if (LLDB_PATH_TO_CLANG_SOURCE)
+      get_filename_component(CLANG_MAIN_SRC_DIR ${LLDB_PATH_TO_CLANG_SOURCE}
+                             ABSOLUTE)
+  endif()  
+
+  list(APPEND CMAKE_MODULE_PATH "${LLDB_PATH_TO_LLVM_BUILD}/share/llvm/cmake")
+
+  get_filename_component(PATH_TO_LLVM_BUILD ${LLDB_PATH_TO_LLVM_BUILD}
+                         ABSOLUTE)
+                         
+  get_filename_component(PATH_TO_CLANG_BUILD ${LLDB_PATH_TO_CLANG_BUILD}
+                         ABSOLUTE)                         
+                         
+  include(AddLLVM)
+  include("${LLDB_PATH_TO_LLVM_BUILD}/share/llvm/cmake/LLVMConfig.cmake")
+  include(HandleLLVMOptions)
+
+  set(PACKAGE_VERSION "${LLVM_PACKAGE_VERSION}")
+
+  set(LLVM_MAIN_INCLUDE_DIR "${LLVM_MAIN_SRC_DIR}/include")
+  set(LLVM_BINARY_DIR ${CMAKE_BINARY_DIR})
+  
+  set(CLANG_MAIN_INCLUDE_DIR "${CLANG_MAIN_SRC_DIR}/include")
+
+  set(CMAKE_INCLUDE_CURRENT_DIR ON)
+  include_directories("${PATH_TO_LLVM_BUILD}/include"
+                      "${LLVM_MAIN_INCLUDE_DIR}"
+                      "${PATH_TO_CLANG_BUILD}/include"
+                      "${CLANG_MAIN_INCLUDE_DIR}"
+                      "${CMAKE_CURRENT_SOURCE_DIR}/source")
+  link_directories("${PATH_TO_LLVM_BUILD}/lib"
+                   "${PATH_TO_CLANG_BUILD}/lib")
+
+  set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
+  set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
+  set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
+
+  set(LLDB_BUILT_STANDALONE 1)
+  
+  if (LLDB_DISABLE_PYTHON)
+    add_definitions( -DLLDB_DISABLE_PYTHON )
+  endif() 
+endif()
+
+if ( CMAKE_SYSTEM_NAME MATCHES "Windows" )
+  add_definitions( -DLLDB_DISABLE_PYTHON )
+endif ()
+
+macro(add_lldb_definitions)
+  # We don't want no semicolons on LLDB_DEFINITIONS:
+  foreach(arg ${ARGN})
+    set(LLDB_DEFINITIONS "${LLVM_DEFINITIONS} ${arg}")
+  endforeach(arg)
+  add_definitions( ${ARGN} )
+endmacro(add_lldb_definitions)
+
+include_directories(/usr/include/python2.7)
+include_directories(../clang/include)
+include_directories("${CMAKE_CURRENT_BINARY_DIR}/../clang/include")
+
+# lldb requires c++11 to build. Make sure that we have a compiler and standard
+# library combination that can do that.
+if (MSVC11 OR MSVC12)
+  # Do nothing, we're good.
+elseif (NOT MSVC)
+  # gcc and clang require the -std=c++0x or -std=c++11 flag.
+  if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU" OR
+      "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
+    if (NOT ("${CMAKE_CXX_FLAGS}" MATCHES "-std=c\\+\\+0x" OR
+             "${CMAKE_CXX_FLAGS}" MATCHES "-std=gnu\\+\\+0x" OR
+             "${CMAKE_CXX_FLAGS}" MATCHES "-std=c\\+\\+11" OR
+             "${CMAKE_CXX_FLAGS}" MATCHES "-std=gnu\\+\\+11"))
+      if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+        if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.7")
+          set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
+        else()
+          set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
+        endif()
+      else()
+        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
+      endif()
+    endif()
+  endif()
+else()
+  message(FATAL_ERROR "The selected compiler does not support c++11 which is "
+          "required to build lldb.")
+endif()
+
+# Disable Clang warnings
+if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+  add_lldb_definitions(
+    -Wno-deprecated-declarations # Suppress "deprecated auto_ptr" warnings
+  )
+endif()
+
+if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang"
+    AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "3.3")
+  add_lldb_definitions(
+    -Wno-deprecated-register # Suppress "deprecated register keyword" warnings
+  )
+endif()
+
+# Disable MSVC warnings
+if( MSVC )
+  add_lldb_definitions(
+    -wd4018 # Suppress 'warning C4018: '>=' : signed/unsigned mismatch'
+    -wd4068 # Suppress 'warning C4068: unknown pragma'
+    -wd4150 # Suppress 'warning C4150: deletion of pointer to incomplete type'
+    -wd4521 # Suppress 'warning C4521: 'type' : multiple copy constructors specified'
+  )
+endif() 
+
+# If building on a 32-bit system, make sure off_t can store offsets > 2GB
+if( CMAKE_SIZEOF_VOID_P EQUAL 4 )
+  add_lldb_definitions(
+    -D_LARGEFILE_SOURCE
+    -D_FILE_OFFSET_BITS=64
+    )
+endif()
+
+set(LLDB_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
+set(LLDB_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
+
+if (CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
+  message(FATAL_ERROR "In-source builds are not allowed. CMake would overwrite "
+"the makefiles distributed with LLDB. Please create a directory and run cmake "
+"from there, passing the path to this source directory as the last argument. "
+"This process created the file `CMakeCache.txt' and the directory "
+"`CMakeFiles'. Please delete them.")
+endif()
+
+# Compute the LLDB version from the LLVM version.
+string(REGEX MATCH "[0-9]+\\.[0-9]+(\\.[0-9]+)?" LLDB_VERSION
+  ${PACKAGE_VERSION})
+message(STATUS "LLDB version: ${LLDB_VERSION}")
+
+macro(add_lldb_library name)
+  llvm_process_sources(srcs ${ARGN})
+  if (MSVC_IDE OR XCODE)
+    string(REGEX MATCHALL "/[^/]+" split_path ${CMAKE_CURRENT_SOURCE_DIR})
+    list(GET split_path -1 dir)
+    file(GLOB_RECURSE headers
+      ../../include/lldb${dir}/*.h)
+    set(srcs ${srcs} ${headers})
+  endif()
+  if (MODULE)
+    set(libkind MODULE)
+  elseif (SHARED_LIBRARY)
+    set(libkind SHARED)
+  else()
+    set(libkind STATIC)
+  endif()
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
+  add_library(${name} ${libkind} ${srcs})
+  #if (LLVM_COMMON_DEPENDS)
+  ##add_dependencies(${name} ${LLVM_COMMON_DEPENDS})
+  #endif()
+
+  if(LLDB_USED_LIBS)
+    if (CMAKE_SYSTEM_NAME MATCHES "Linux" OR CMAKE_SYSTEM_NAME MATCHES "FreeBSD" OR CMAKE_SYSTEM_NAME MATCHES "Windows")
+      target_link_libraries(${name} -Wl,--start-group ${LLDB_USED_LIBS} -Wl,--end-group)
+    else()
+      target_link_libraries(${name} ${LLDB_USED_LIBS})
+    endif()
+  endif()
+  target_link_libraries(${name} ${CLANG_USED_LIBS})
+  target_link_libraries(${name} ${LLVM_USED_LIBS})
+  llvm_config(${name} ${LLVM_LINK_COMPONENTS})
+  target_link_libraries(${name} ${LLVM_COMMON_LIBS})
+  link_system_libs(${name})
+  if (LLVM_COMMON_DEPENDS)
+    add_dependencies(${name} ${LLVM_COMMON_DEPENDS})
+  endif()
+
+  # Hack: only some LLDB libraries depend on the clang autogenerated headers,
+  # but it is simple enough to make all of LLDB depend on some of those
+  # headers without negatively impacting much of anything.
+  set (LLDB_DEPENDENCIES
+    libclang
+    )
+  add_dependencies(${name} ${LLDB_DEPENDENCIES})
+
+  install(TARGETS ${name}
+    LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
+    ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX})
+  set_target_properties(${name} PROPERTIES FOLDER "lldb libraries")
+endmacro(add_lldb_library)
+
+macro(add_lldb_executable name)
+  #add_llvm_executable(${name} ${ARGN})
+  llvm_process_sources( ALL_FILES ${ARGN} )
+  add_executable(${name} ${ALL_FILES})
+  #target_link_libraries(${name} ${CLANG_USED_LIBS})
+  #llvm_config( ${name} ${LLVM_LINK_COMPONENTS} )
+  #link_system_libs( ${name} )
+  #if (LLVM_COMMON_DEPENDS)
+  #add_dependencies(${name} ${LLVM_COMMON_DEPENDS})
+  #endif()
+  set_target_properties(${name} PROPERTIES FOLDER "lldb executables")
+endmacro(add_lldb_executable)
+
+include_directories(BEFORE
+  ${CMAKE_CURRENT_BINARY_DIR}/include
+  ${CMAKE_CURRENT_SOURCE_DIR}/include
+  )
+
+install(DIRECTORY include/
+  DESTINATION include
+  FILES_MATCHING
+  PATTERN "*.h"
+  PATTERN ".svn" EXCLUDE
+  )
+
+
+# Find libraries or frameworks that may be needed
+if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
+  find_library(CARBON_LIBRARY Carbon)
+  find_library(FOUNDATION_LIBRARY Foundation)
+  find_library(CORE_FOUNDATION_LIBRARY CoreFoundation)
+  find_library(CORE_SERVICES_LIBRARY CoreServices)
+  find_library(SECURITY_LIBRARY Security)
+  find_library(DEBUG_SYMBOLS_LIBRARY DebugSymbols PATHS "/System/Library/PrivateFrameworks")
+
+  set(LIBXML2_INCLUDE_DIR "/usr/include/libxml2")
+  list(APPEND system_libs xml2)
+  list(APPEND system_libs ${CARBON_LIBRARY} ${FOUNDATION_LIBRARY}
+  ${CORE_FOUNDATION_LIBRARY} ${CORE_SERVICES_LIBRARY} ${SECURITY_LIBRARY}
+  ${DEBUG_SYMBOLS_LIBRARY})
+endif()
+
+# On FreeBSD, link libexecinfo because libc is missing  backtrace()
+if (CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
+  list(APPEND system_libs execinfo)
+endif()
+
+#add_subdirectory(include)
+add_subdirectory(docs)
+if (NOT CMAKE_SYSTEM_NAME MATCHES "Windows")
+  add_subdirectory(scripts)
+endif()
+add_subdirectory(source)
+add_subdirectory(test)
+add_subdirectory(tools)
diff --git source/CMakeLists.txt source/CMakeLists.txt
index 2a1292a..6a66c31 100644
--- source/CMakeLists.txt
+++ source/CMakeLists.txt
@@ -1,222 +1,226 @@
-include_directories(.)
-
-if ( CMAKE_SYSTEM_NAME MATCHES "Linux" )
-include_directories(
-  Plugins/Process/Linux
-  Plugins/Process/POSIX
-  )
-endif ()
-
-if ( CMAKE_SYSTEM_NAME MATCHES "FreeBSD" )
-include_directories(
-  Plugins/Process/FreeBSD
-  Plugins/Process/POSIX
-  )
-endif ()
-
-add_subdirectory(API)
-add_subdirectory(Breakpoint)
-add_subdirectory(Commands)
-add_subdirectory(Core)
-add_subdirectory(DataFormatters)
-add_subdirectory(Expression)
-add_subdirectory(Host)
-add_subdirectory(Interpreter)
-add_subdirectory(Plugins)
-add_subdirectory(Symbol)
-add_subdirectory(Target)
-add_subdirectory(Utility)
-
-set( LLDB_USED_LIBS
-  lldbAPI
-  lldbBreakpoint
-  lldbCommands
-  lldbDataFormatters
-  lldbHostCommon
-  lldbCore
-  lldbExpression
-  lldbInterpreter
-  lldbSymbol
-  lldbTarget  
-  lldbUtility
-  
-  # Plugins
-  lldbPluginDisassemblerLLVM
-  lldbPluginSymbolFileDWARF
-  lldbPluginSymbolFileSymtab
-  lldbPluginDynamicLoaderStatic
-  lldbPluginDynamicLoaderPosixDYLD
-  
-  lldbPluginObjectFileMachO
-  lldbPluginObjectFileELF
-  lldbPluginSymbolVendorELF
-  lldbPluginObjectContainerBSDArchive
-  lldbPluginObjectContainerMachOArchive
-  lldbPluginProcessGDBRemote  
-  lldbPluginProcessMachCore
-  lldbPluginProcessUtility
-  lldbPluginPlatformGDB
-  lldbPluginPlatformFreeBSD
-  lldbPluginPlatformLinux
-  lldbPluginPlatformPOSIX
-  lldbPluginObjectFileMachO
-  lldbPluginObjectContainerMachOArchive
-  lldbPluginObjectContainerBSDArchive
-  lldbPluginPlatformMacOSX
-  lldbPluginDynamicLoaderMacOSXDYLD
-  lldbPluginUnwindAssemblyInstEmulation
-  lldbPluginUnwindAssemblyX86
-  lldbPluginAppleObjCRuntime
-  lldbPluginCXXItaniumABI
-  lldbPluginABIMacOSX_arm
-  lldbPluginABIMacOSX_i386
-  lldbPluginABISysV_x86_64
-  lldbPluginInstructionARM
-  lldbPluginObjectFilePECOFF
-  lldbPluginOSPython
-  )
-
-# Windows-only libraries
-if ( CMAKE_SYSTEM_NAME MATCHES "Windows" )
-  list(APPEND LLDB_USED_LIBS
-    lldbHostWindows
-    #lldbPluginPlatformWindows
-    Ws2_32
-    )
-endif ()
-
-# Linux-only libraries
-if ( CMAKE_SYSTEM_NAME MATCHES "Linux" )
-  list(APPEND LLDB_USED_LIBS
-    lldbHostLinux
-    lldbPluginProcessLinux
-    lldbPluginProcessPOSIX
-    lldbPluginProcessElfCore
-    )
-endif ()
-
-# FreeBSD-only libraries
-if ( CMAKE_SYSTEM_NAME MATCHES "FreeBSD" )
-  list(APPEND LLDB_USED_LIBS
-    lldbHostFreeBSD
-    lldbPluginProcessFreeBSD
-    lldbPluginProcessPOSIX
-    lldbPluginProcessElfCore
-    )
-endif ()
-
-# Darwin-only libraries
-if ( CMAKE_SYSTEM_NAME MATCHES "Darwin" )
-  set(LLDB_VERS_GENERATED_FILE ${LLDB_BINARY_DIR}/source/LLDB_vers.c)
-  add_custom_command(OUTPUT ${LLDB_VERS_GENERATED_FILE}
-    COMMAND ${LLDB_SOURCE_DIR}/scripts/generate-vers.pl
-            ${LLDB_SOURCE_DIR}/lldb.xcodeproj/project.pbxproj
-            > ${LLDB_VERS_GENERATED_FILE})
-
-  set_source_files_properties(${LLDB_VERS_GENERATED_FILE} PROPERTIES GENERATED 1)
-  list(APPEND LLDB_USED_LIBS
-    lldbHostMacOSX
-    lldbPluginDynamicLoaderDarwinKernel
-    lldbPluginProcessMacOSXKernel
-    lldbPluginSymbolVendorMacOSX
-    )
-endif()
-
-set( CLANG_USED_LIBS
-  clangAnalysis
-  clangAST
-  clangBasic
-  clangCodeGen
-  clangDriver
-  clangEdit
-  clangFrontend
-  clangLex
-  clangParse
-  clangRewriteCore
-  clangRewriteFrontend
-  clangSema
-  clangSerialization
-  )  
-  
-if (NOT CMAKE_SYSTEM_NAME MATCHES "Windows")
-  set( LLDB_SYSTEM_LIBS
-    edit
-    python2.7
-    )
-endif()
-
-set( LLVM_LINK_COMPONENTS
-  ${LLVM_TARGETS_TO_BUILD}
-  jit
-  interpreter
-  nativecodegen
-  asmparser
-  bitreader
-  bitwriter
-  codegen
-  ipo
-  selectiondag
-  bitreader
-  mc
-  mcjit
-  core
-  mcdisassembler
-  executionengine
-  )
-
-set_source_files_properties(${LLDB_BINARY_DIR}/scripts/LLDBWrapPython.cpp PROPERTIES GENERATED 1)
-set(SHARED_LIBRARY 1)
-
-if(NOT CMAKE_SYSTEM_NAME MATCHES "Windows")
-  set(LLDB_WRAP_PYTHON ${LLDB_BINARY_DIR}/scripts/LLDBWrapPython.cpp)
-endif()
-
-add_lldb_library(liblldb
-  lldb.cpp
-  lldb-log.cpp
-  ${LLDB_WRAP_PYTHON}
-  ${LLDB_VERS_GENERATED_FILE}
-  )
-set_target_properties(liblldb
-  PROPERTIES
-  OUTPUT_NAME lldb
-  VERSION ${LLDB_VERSION}
-  )
-if (LLDB_WRAP_PYTHON OR LLDB_VERS_GENERATED_FILE)
-  add_dependencies(liblldb
-    ${LLDB_WRAP_PYTHON}
-    ${LLDB_VERS_GENERATED_FILE}
-    )
-endif()
-target_link_libraries(liblldb ${LLDB_SYSTEM_LIBS})
-
-# Determine LLDB revision and repository. GetSourceVersion and GetRepositoryPath are shell-scripts, and as
-# such will not work on Windows.
-if ( NOT CMAKE_SYSTEM_NAME MATCHES "Windows" )
-  execute_process(COMMAND ${CMAKE_SOURCE_DIR}/utils/GetSourceVersion ${LLDB_SOURCE_DIR}
-                  OUTPUT_VARIABLE LLDB_REVISION)
-  if ( LLDB_REVISION )
-    string(REGEX REPLACE "(\r?\n)+$" "" LLDB_REVISION ${LLDB_REVISION})
-  endif()
-
-  execute_process(COMMAND ${CMAKE_SOURCE_DIR}/utils/GetRepositoryPath ${LLDB_SOURCE_DIR}
-                  OUTPUT_VARIABLE LLDB_REPOSITORY)
-  if ( LLDB_REPOSITORY )
-    # Replace newline characters with spaces
-    string(REGEX REPLACE "(\r?\n)+" " " LLDB_REPOSITORY ${LLDB_REPOSITORY})
-
-    # Remove trailing spaces
-    string(REGEX REPLACE "(\ )+$" "" LLDB_REPOSITORY ${LLDB_REPOSITORY})
-  endif()
-
-  set_property(
-    SOURCE lldb.cpp
-    PROPERTY COMPILE_DEFINITIONS "LLDB_REVISION=\"${LLDB_REVISION}\"" "LLDB_REPOSITORY=\"${LLDB_REPOSITORY}\"")
-endif ()
-# FIXME: implement svn/git revision and repository parsing solution on Windows. There is an SVN-only
-#        revision parsing solution in tools/clang/lib/Basic/CMakelists.txt.
-
-
-install(TARGETS liblldb
-  RUNTIME DESTINATION bin
-  LIBRARY DESTINATION lib)
+include_directories(.)
+
+if ( CMAKE_SYSTEM_NAME MATCHES "Linux" )
+include_directories(
+  Plugins/Process/Linux
+  Plugins/Process/POSIX
+  )
+endif ()
+
+if ( CMAKE_SYSTEM_NAME MATCHES "FreeBSD" )
+include_directories(
+  Plugins/Process/FreeBSD
+  Plugins/Process/POSIX
+  )
+endif ()
+
+add_subdirectory(API)
+add_subdirectory(Breakpoint)
+add_subdirectory(Commands)
+add_subdirectory(Core)
+add_subdirectory(DataFormatters)
+add_subdirectory(Expression)
+add_subdirectory(Host)
+add_subdirectory(Interpreter)
+add_subdirectory(Plugins)
+add_subdirectory(Symbol)
+add_subdirectory(Target)
+add_subdirectory(Utility)
+
+set( LLDB_USED_LIBS
+  lldbAPI
+  lldbBreakpoint
+  lldbCommands
+  lldbDataFormatters
+  lldbHostCommon
+  lldbCore
+  lldbExpression
+  lldbInterpreter
+  lldbSymbol
+  lldbTarget  
+  lldbUtility
+  
+  # Plugins
+  lldbPluginDisassemblerLLVM
+  lldbPluginSymbolFileDWARF
+  lldbPluginSymbolFileSymtab
+  lldbPluginDynamicLoaderStatic
+  lldbPluginDynamicLoaderPosixDYLD
+  
+  lldbPluginObjectFileMachO
+  lldbPluginObjectFileELF
+  lldbPluginSymbolVendorELF
+  lldbPluginObjectContainerBSDArchive
+  lldbPluginObjectContainerMachOArchive
+  lldbPluginProcessGDBRemote  
+  lldbPluginProcessMachCore
+  lldbPluginProcessUtility
+  lldbPluginPlatformGDB
+  lldbPluginPlatformFreeBSD
+  lldbPluginPlatformLinux
+  lldbPluginPlatformPOSIX
+  lldbPluginObjectFileMachO
+  lldbPluginObjectContainerMachOArchive
+  lldbPluginObjectContainerBSDArchive
+  lldbPluginPlatformMacOSX
+  lldbPluginDynamicLoaderMacOSXDYLD
+  lldbPluginUnwindAssemblyInstEmulation
+  lldbPluginUnwindAssemblyX86
+  lldbPluginAppleObjCRuntime
+  lldbPluginCXXItaniumABI
+  lldbPluginABIMacOSX_arm
+  lldbPluginABIMacOSX_i386
+  lldbPluginABISysV_x86_64
+  lldbPluginInstructionARM
+  lldbPluginObjectFilePECOFF
+  lldbPluginOSPython
+  )
+
+# Windows-only libraries
+if ( CMAKE_SYSTEM_NAME MATCHES "Windows" )
+  list(APPEND LLDB_USED_LIBS
+    lldbHostWindows
+    lldbPluginPlatformWindows
+    Ws2_32
+    )
+endif ()
+
+# Linux-only libraries
+if ( CMAKE_SYSTEM_NAME MATCHES "Linux" )
+  list(APPEND LLDB_USED_LIBS
+    lldbHostLinux
+    lldbPluginProcessLinux
+    lldbPluginProcessPOSIX
+    lldbPluginProcessElfCore
+    )
+endif ()
+
+# FreeBSD-only libraries
+if ( CMAKE_SYSTEM_NAME MATCHES "FreeBSD" )
+  list(APPEND LLDB_USED_LIBS
+    lldbHostFreeBSD
+    lldbPluginProcessFreeBSD
+    lldbPluginProcessPOSIX
+    lldbPluginProcessElfCore
+    )
+endif ()
+
+# Darwin-only libraries
+if ( CMAKE_SYSTEM_NAME MATCHES "Darwin" )
+  set(LLDB_VERS_GENERATED_FILE ${LLDB_BINARY_DIR}/source/LLDB_vers.c)
+  add_custom_command(OUTPUT ${LLDB_VERS_GENERATED_FILE}
+    COMMAND ${LLDB_SOURCE_DIR}/scripts/generate-vers.pl
+            ${LLDB_SOURCE_DIR}/lldb.xcodeproj/project.pbxproj
+            > ${LLDB_VERS_GENERATED_FILE})
+
+  set_source_files_properties(${LLDB_VERS_GENERATED_FILE} PROPERTIES GENERATED 1)
+  list(APPEND LLDB_USED_LIBS
+    lldbHostMacOSX
+    lldbPluginDynamicLoaderDarwinKernel
+    lldbPluginProcessMacOSXKernel
+    lldbPluginSymbolVendorMacOSX
+    )
+endif()
+
+set( CLANG_USED_LIBS
+  clangAnalysis
+  clangAST
+  clangBasic
+  clangCodeGen
+  clangDriver
+  clangEdit
+  clangFrontend
+  clangLex
+  clangParse
+  clangRewriteCore
+  clangRewriteFrontend
+  clangSema
+  clangSerialization
+  )  
+  
+if (NOT CMAKE_SYSTEM_NAME MATCHES "Windows")
+  set( LLDB_SYSTEM_LIBS
+    edit
+    python2.7
+    )
+endif()
+
+set( LLVM_LINK_COMPONENTS
+  ${LLVM_TARGETS_TO_BUILD}
+  jit
+  interpreter
+  nativecodegen
+  asmparser
+  bitreader
+  bitwriter
+  codegen
+  ipo
+  selectiondag
+  bitreader
+  mc
+  mcjit
+  core
+  mcdisassembler
+  executionengine
+  )
+
+set_source_files_properties(${LLDB_BINARY_DIR}/scripts/LLDBWrapPython.cpp PROPERTIES GENERATED 1)
+
+if(NOT CMAKE_SYSTEM_NAME MATCHES "Windows")
+  set(SHARED_LIBRARY 1)
+endif()
+
+if(NOT CMAKE_SYSTEM_NAME MATCHES "Windows")
+  set(LLDB_WRAP_PYTHON ${LLDB_BINARY_DIR}/scripts/LLDBWrapPython.cpp)
+endif()
+
+add_lldb_library(liblldb
+  lldb.cpp
+  lldb-log.cpp
+  ${LLDB_WRAP_PYTHON}
+  ${LLDB_VERS_GENERATED_FILE}
+  )
+set_target_properties(liblldb
+  PROPERTIES
+  OUTPUT_NAME lldb
+  VERSION ${LLDB_VERSION}
+  )
+if (LLDB_WRAP_PYTHON OR LLDB_VERS_GENERATED_FILE)
+  add_dependencies(liblldb
+    ${LLDB_WRAP_PYTHON}
+    ${LLDB_VERS_GENERATED_FILE}
+    )
+endif()
+target_link_libraries(liblldb ${LLDB_SYSTEM_LIBS})
+
+# Determine LLDB revision and repository. GetSourceVersion and GetRepositoryPath are shell-scripts, and as
+# such will not work on Windows.
+if ( NOT CMAKE_SYSTEM_NAME MATCHES "Windows" )
+  execute_process(COMMAND ${CMAKE_SOURCE_DIR}/utils/GetSourceVersion ${LLDB_SOURCE_DIR}
+                  OUTPUT_VARIABLE LLDB_REVISION)
+  if ( LLDB_REVISION )
+    string(REGEX REPLACE "(\r?\n)+$" "" LLDB_REVISION ${LLDB_REVISION})
+  endif()
+
+  execute_process(COMMAND ${CMAKE_SOURCE_DIR}/utils/GetRepositoryPath ${LLDB_SOURCE_DIR}
+                  OUTPUT_VARIABLE LLDB_REPOSITORY)
+  if ( LLDB_REPOSITORY )
+    # Replace newline characters with spaces
+    string(REGEX REPLACE "(\r?\n)+" " " LLDB_REPOSITORY ${LLDB_REPOSITORY})
+
+    # Remove trailing spaces
+    string(REGEX REPLACE "(\ )+$" "" LLDB_REPOSITORY ${LLDB_REPOSITORY})
+  endif()
+
+  set_property(
+    SOURCE lldb.cpp
+    PROPERTY COMPILE_DEFINITIONS "LLDB_REVISION=\"${LLDB_REVISION}\"" "LLDB_REPOSITORY=\"${LLDB_REPOSITORY}\"")
+endif ()
+# FIXME: implement svn/git revision and repository parsing solution on Windows. There is an SVN-only
+#        revision parsing solution in tools/clang/lib/Basic/CMakelists.txt.
+
+
+install(TARGETS liblldb
+  RUNTIME DESTINATION bin
+  LIBRARY DESTINATION lib
+  ARCHIVE DESTINATION lib)
diff --git source/Plugins/CMakeLists.txt source/Plugins/CMakeLists.txt
index 7e19b3f..a1b515a 100644
--- source/Plugins/CMakeLists.txt
+++ source/Plugins/CMakeLists.txt
@@ -1,13 +1,13 @@
-add_subdirectory(ABI)
-add_subdirectory(Disassembler)
-add_subdirectory(DynamicLoader)
-add_subdirectory(Instruction)
-add_subdirectory(LanguageRuntime)
-add_subdirectory(ObjectContainer)
-add_subdirectory(ObjectFile)
-add_subdirectory(OperatingSystem)
-add_subdirectory(Platform)
-add_subdirectory(Process)
-add_subdirectory(SymbolFile)
-add_subdirectory(SymbolVendor)
-add_subdirectory(UnwindAssembly)
+add_subdirectory(ABI)
+add_subdirectory(Disassembler)
+add_subdirectory(DynamicLoader)
+add_subdirectory(Instruction)
+add_subdirectory(LanguageRuntime)
+add_subdirectory(ObjectContainer)
+add_subdirectory(ObjectFile)
+add_subdirectory(OperatingSystem)
+add_subdirectory(Platform)
+add_subdirectory(Process)
+add_subdirectory(SymbolFile)
+add_subdirectory(SymbolVendor)
+add_subdirectory(UnwindAssembly)
diff --git source/Plugins/Platform/CMakeLists.txt source/Plugins/Platform/CMakeLists.txt
index 3576d86..ce7c64e 100644
--- source/Plugins/Platform/CMakeLists.txt
+++ source/Plugins/Platform/CMakeLists.txt
@@ -1,12 +1,12 @@
-#if (CMAKE_SYSTEM_NAME MATCHES "Linux")
-  add_subdirectory(Linux)
-#elseif (CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
-  add_subdirectory(FreeBSD)
-#elseif (CMAKE_SYSTEM_NAME MATCHES "Darwin")
-  add_subdirectory(MacOSX)
-#elseif (CMAKE_SYSTEM_NAME MATCHES "Windows")
-#  add_subdirectory(Windows)
-#endif()
-
-add_subdirectory(POSIX)
-add_subdirectory(gdb-server)
+#if (CMAKE_SYSTEM_NAME MATCHES "Linux")
+  add_subdirectory(Linux)
+#elseif (CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
+  add_subdirectory(FreeBSD)
+#elseif (CMAKE_SYSTEM_NAME MATCHES "Darwin")
+  add_subdirectory(MacOSX)
+#elseif (CMAKE_SYSTEM_NAME MATCHES "Windows")
+  add_subdirectory(Windows)
+#endif()
+
+add_subdirectory(POSIX)
+add_subdirectory(gdb-server)
diff --git source/Plugins/Platform/Windows/CMakeLists.txt source/Plugins/Platform/Windows/CMakeLists.txt
new file mode 100644
index 0000000..4430da6
--- /dev/null
+++ source/Plugins/Platform/Windows/CMakeLists.txt
@@ -0,0 +1,9 @@
+if ( CMAKE_SYSTEM_NAME MATCHES "Windows" )
+
+set(LLVM_NO_RTTI 1)
+
+add_lldb_library(lldbPluginPlatformWindows
+  PlatformWindows.cpp
+  )
+
+endif()
\ No newline at end of file
diff --git source/Plugins/Platform/Windows/PlatformWindows.cpp source/Plugins/Platform/Windows/PlatformWindows.cpp
new file mode 100644
index 0000000..0e1cd52
--- /dev/null
+++ source/Plugins/Platform/Windows/PlatformWindows.cpp
@@ -0,0 +1,666 @@
+//===-- PlatformWindows.cpp ---------------------------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "PlatformWindows.h"
+
+// C Includes
+#include <stdio.h>
+#include "lldb/Host/windows/Windows.h"
+#include <winsock2.h>
+
+
+// C++ Includes
+// Other libraries and framework includes
+// Project includes
+#include "lldb/Core/Error.h"
+#include "lldb/Core/Debugger.h"
+#include "lldb/Core/PluginManager.h"
+#include "lldb/Host/Host.h"
+#include "lldb/Core/ModuleSpec.h"
+#include "lldb/Core/Module.h"
+#include "lldb/Breakpoint/BreakpointLocation.h"
+
+
+using namespace lldb;
+using namespace lldb_private;
+
+Platform *
+PlatformWindows::CreateInstance (bool force, const lldb_private::ArchSpec *arch)
+{
+    // The only time we create an instance is when we are creating a remote
+    // windows platform
+    const bool is_host = false;
+
+    bool create = force;
+    if (create == false && arch && arch->IsValid())
+    {
+        const llvm::Triple &triple = arch->GetTriple();
+        switch (triple.getVendor())
+        {
+            case llvm::Triple::PC:
+                create = true;
+                break;
+
+            case llvm::Triple::UnknownArch:
+                create = !arch->TripleVendorWasSpecified();
+                break;
+
+            default:
+                break;
+        }
+
+        if (create)
+        {
+            switch (triple.getOS())
+            {
+                case llvm::Triple::Win32:
+                case llvm::Triple::MinGW32:
+                    break;
+
+                case llvm::Triple::UnknownOS:
+                    create = arch->TripleOSWasSpecified();
+                    break;
+
+                default:
+                    create = false;
+                    break;
+            }
+        }
+    }
+    if (create)
+        return new PlatformWindows (is_host);
+    return NULL;
+
+}
+
+lldb_private::ConstString
+PlatformWindows::GetPluginNameStatic(bool is_host)
+{
+    if (is_host)
+    {
+        static ConstString g_host_name(Platform::GetHostPlatformName ());
+        return g_host_name;
+    }
+    else
+    {
+        static ConstString g_remote_name("remote-windows");
+        return g_remote_name;
+    }
+}
+
+const char *
+PlatformWindows::GetPluginDescriptionStatic(bool is_host)
+{
+    if (is_host)
+        return "Local Windows user platform plug-in.";
+    else
+        return "Remote Windows user platform plug-in.";
+}
+
+lldb_private::ConstString
+PlatformWindows::GetPluginName()
+{
+    return GetPluginNameStatic(IsHost());
+}
+
+static uint32_t g_initialize_count = 0;
+
+void
+PlatformWindows::Initialize( void )
+{
+    if (g_initialize_count++ == 0)
+    {
+#if defined (_WIN32)
+        WSADATA dummy;
+        WSAStartup(0x202, &dummy);
+        // Force a host flag to true for the default platform object.
+        PlatformSP default_platform_sp (new PlatformWindows(true));
+        default_platform_sp->SetSystemArchitecture (Host::GetArchitecture());
+        Platform::SetDefaultPlatform (default_platform_sp);
+#endif
+        PluginManager::RegisterPlugin(PlatformWindows::GetPluginNameStatic(false),
+                                      PlatformWindows::GetPluginDescriptionStatic(false),
+                                      PlatformWindows::CreateInstance);
+    }
+}
+
+void
+PlatformWindows::Terminate( void )
+{
+    if (g_initialize_count > 0 && --g_initialize_count == 0) {
+#ifdef _WIN32
+        WSACleanup();
+#endif
+        PluginManager::UnregisterPlugin (PlatformWindows::CreateInstance);
+    }
+}
+
+//------------------------------------------------------------------
+/// Default Constructor
+//------------------------------------------------------------------
+PlatformWindows::PlatformWindows (bool is_host) :
+Platform(is_host)
+{
+}
+
+//------------------------------------------------------------------
+/// Destructor.
+///
+/// The destructor is virtual since this class is designed to be
+/// inherited from by the plug-in instance.
+//------------------------------------------------------------------
+PlatformWindows::~PlatformWindows()
+{
+}
+
+
+Error
+PlatformWindows::ResolveExecutable (const FileSpec &exe_file,
+                                    const ArchSpec &exe_arch,
+                                    lldb::ModuleSP &exe_module_sp,
+                                    const FileSpecList *module_search_paths_ptr)
+{
+    Error error;
+    // Nothing special to do here, just use the actual file and architecture
+
+    char exe_path[PATH_MAX];
+    FileSpec resolved_exe_file (exe_file);
+
+    if (IsHost())
+    {
+        // If we have "ls" as the exe_file, resolve the executable loation based on
+        // the current path variables
+        if (!resolved_exe_file.Exists())
+        {
+            exe_file.GetPath(exe_path, sizeof(exe_path));
+            resolved_exe_file.SetFile(exe_path, true);
+        }
+
+        if (!resolved_exe_file.Exists())
+            resolved_exe_file.ResolveExecutableLocation ();
+
+        if (resolved_exe_file.Exists())
+            error.Clear();
+        else
+        {
+            exe_file.GetPath(exe_path, sizeof(exe_path));
+            error.SetErrorStringWithFormat("unable to find executable for '%s'", exe_path);
+        }
+    }
+    else
+    {
+        if (m_remote_platform_sp)
+        {
+            error = m_remote_platform_sp->ResolveExecutable (exe_file,
+                                                             exe_arch,
+                                                             exe_module_sp,
+                                                             module_search_paths_ptr);
+        }
+        else
+        {
+            // We may connect to a process and use the provided executable (Don't use local $PATH).
+
+            // Resolve any executable within a bundle on MacOSX
+            Host::ResolveExecutableInBundle (resolved_exe_file);
+
+            if (resolved_exe_file.Exists()) {
+                error.Clear();
+            }
+            else
+            {
+                exe_file.GetPath(exe_path, sizeof(exe_path));
+                error.SetErrorStringWithFormat("the platform is not currently connected, and '%s' doesn't exist in the system root.", exe_path);
+            }
+        }
+    }
+
+
+    if (error.Success())
+    {
+        ModuleSpec module_spec (resolved_exe_file, exe_arch);
+        if (module_spec.GetArchitecture().IsValid())
+        {
+            error = ModuleList::GetSharedModule (module_spec,
+                                                 exe_module_sp,
+                                                 module_search_paths_ptr,
+                                                 NULL,
+                                                 NULL);
+
+            if (exe_module_sp == NULL && exe_module_sp->GetObjectFile() == NULL)
+            {
+                exe_module_sp.reset();
+                error.SetErrorStringWithFormat ("'%s%s%s' doesn't contain the architecture %s",
+                                                exe_file.GetDirectory().AsCString(""),
+                                                exe_file.GetDirectory() ? "/" : "",
+                                                exe_file.GetFilename().AsCString(""),
+                                                exe_arch.GetArchitectureName());
+            }
+        }
+        else
+        {
+            // No valid architecture was specified, ask the platform for
+            // the architectures that we should be using (in the correct order)
+            // and see if we can find a match that way
+            StreamString arch_names;
+            ArchSpec platform_arch;
+            for (uint32_t idx = 0; GetSupportedArchitectureAtIndex (idx, platform_arch); ++idx)
+            {
+                error = ModuleList::GetSharedModule (module_spec,
+                                                     exe_module_sp,
+                                                     module_search_paths_ptr,
+                                                     NULL,
+                                                     NULL);
+                // Did we find an executable using one of the
+                if (error.Success())
+                {
+                    if (exe_module_sp && exe_module_sp->GetObjectFile())
+                        break;
+                    else
+                        error.SetErrorToGenericError();
+                }
+
+                if (idx > 0)
+                    arch_names.PutCString (", ");
+                arch_names.PutCString (platform_arch.GetArchitectureName());
+            }
+
+            if (error.Fail() || !exe_module_sp)
+            {
+                error.SetErrorStringWithFormat ("'%s%s%s' doesn't contain any '%s' platform architectures: %s",
+                                                exe_file.GetDirectory().AsCString(""),
+                                                exe_file.GetDirectory() ? "/" : "",
+                                                exe_file.GetFilename().AsCString(""),
+                                                GetPluginName().AsCString(),
+                                                arch_names.GetString().c_str());
+            }
+        }
+    }
+    else
+    {
+        error.SetErrorStringWithFormat ("'%s%s%s' does not exist",
+                                        exe_file.GetDirectory().AsCString(""),
+                                        exe_file.GetDirectory() ? "/" : "",
+                                        exe_file.GetFilename().AsCString(""));
+    }
+
+    return error;
+}
+
+size_t
+PlatformWindows::GetSoftwareBreakpointTrapOpcode (Target &target, BreakpointSite *bp_site)
+{
+    ArchSpec arch = target.GetArchitecture();
+    const uint8_t *trap_opcode = NULL;
+    size_t trap_opcode_size = 0;
+
+	switch (arch.GetCore())
+	{
+	case ArchSpec::eCore_x86_32_i386:
+	case ArchSpec::eCore_x86_64_x86_64:
+		{
+			static const uint8_t g_i386_opcode[] = { 0xCC };
+			trap_opcode = g_i386_opcode;
+			trap_opcode_size = sizeof(g_i386_opcode);
+		}
+		break;
+
+	default:
+		assert(false && "Unhandled architecture in PlatformWindows::GetSoftwareBreakpointTrapOpcode()");
+		break;
+
+	}
+
+    if (bp_site->SetTrapOpcode(trap_opcode, trap_opcode_size))
+        return trap_opcode_size;
+
+    return 0;
+}
+
+bool
+PlatformWindows::GetRemoteOSVersion ()
+{
+    if (m_remote_platform_sp)
+        return m_remote_platform_sp->GetOSVersion (m_major_os_version,
+                                                   m_minor_os_version,
+                                                   m_update_os_version);
+    return false;
+}
+
+bool
+PlatformWindows::GetRemoteOSBuildString (std::string &s)
+{
+    if (m_remote_platform_sp)
+        return m_remote_platform_sp->GetRemoteOSBuildString (s);
+    s.clear();
+    return false;
+}
+
+bool
+PlatformWindows::GetRemoteOSKernelDescription (std::string &s)
+{
+    if (m_remote_platform_sp)
+        return m_remote_platform_sp->GetRemoteOSKernelDescription (s);
+    s.clear();
+    return false;
+}
+
+// Remote Platform subclasses need to override this function
+ArchSpec
+PlatformWindows::GetRemoteSystemArchitecture ()
+{
+    if (m_remote_platform_sp)
+        return m_remote_platform_sp->GetRemoteSystemArchitecture ();
+    return ArchSpec();
+}
+
+
+const char *
+PlatformWindows::GetHostname ()
+{
+    if (IsHost())
+        return Platform::GetHostname();
+
+    if (m_remote_platform_sp)
+        return m_remote_platform_sp->GetHostname ();
+    return NULL;
+}
+
+bool
+PlatformWindows::IsConnected () const
+{
+    if (IsHost())
+        return true;
+    else if (m_remote_platform_sp)
+        return m_remote_platform_sp->IsConnected();
+    return false;
+}
+
+Error
+PlatformWindows::ConnectRemote (Args& args)
+{
+    Error error;
+    if (IsHost())
+    {
+        error.SetErrorStringWithFormat ("can't connect to the host platform '%s', always connected", GetPluginName().AsCString() );
+    }
+    else
+    {
+        if (!m_remote_platform_sp)
+            m_remote_platform_sp = Platform::Create ("remote-gdb-server", error);
+
+        if (m_remote_platform_sp)
+        {
+            if (error.Success())
+            {
+                if (m_remote_platform_sp)
+                {
+                    error = m_remote_platform_sp->ConnectRemote (args);
+                }
+                else
+                {
+                    error.SetErrorString ("\"platform connect\" takes a single argument: <connect-url>");
+                }
+            }
+        }
+        else
+            error.SetErrorString ("failed to create a 'remote-gdb-server' platform");
+
+        if (error.Fail())
+            m_remote_platform_sp.reset();
+    }
+
+    return error;
+}
+
+Error
+PlatformWindows::DisconnectRemote ()
+{
+    Error error;
+
+    if (IsHost())
+    {
+        error.SetErrorStringWithFormat ("can't disconnect from the host platform '%s', always connected", GetPluginName().AsCString() );
+    }
+    else
+    {
+        if (m_remote_platform_sp)
+            error = m_remote_platform_sp->DisconnectRemote ();
+        else
+            error.SetErrorString ("the platform is not currently connected");
+    }
+    return error;
+}
+
+bool
+PlatformWindows::GetProcessInfo (lldb::pid_t pid, ProcessInstanceInfo &process_info)
+{
+    bool success = false;
+    if (IsHost())
+    {
+        success = Platform::GetProcessInfo (pid, process_info);
+    }
+    else if (m_remote_platform_sp)
+    {
+        success = m_remote_platform_sp->GetProcessInfo (pid, process_info);
+    }
+    return success;
+}
+
+
+
+uint32_t
+PlatformWindows::FindProcesses (const ProcessInstanceInfoMatch &match_info,
+                               ProcessInstanceInfoList &process_infos)
+{
+    uint32_t match_count = 0;
+    if (IsHost())
+    {
+        // Let the base class figure out the host details
+        match_count = Platform::FindProcesses (match_info, process_infos);
+    }
+    else
+    {
+        // If we are remote, we can only return results if we are connected
+        if (m_remote_platform_sp)
+            match_count = m_remote_platform_sp->FindProcesses (match_info, process_infos);
+    }
+    return match_count;
+}
+
+Error
+PlatformWindows::LaunchProcess (ProcessLaunchInfo &launch_info)
+{
+    Error error;
+    if (IsHost())
+    {
+        error = Platform::LaunchProcess (launch_info);
+    }
+    else
+    {
+        if (m_remote_platform_sp)
+            error = m_remote_platform_sp->LaunchProcess (launch_info);
+        else
+            error.SetErrorString ("the platform is not currently connected");
+    }
+    return error;
+}
+
+lldb::ProcessSP
+PlatformWindows::Attach(ProcessAttachInfo &attach_info,
+                        Debugger &debugger,
+                        Target *target,
+                        Listener &listener,
+                        Error &error)
+{
+    lldb::ProcessSP process_sp;
+    if (IsHost())
+    {
+        if (target == NULL)
+        {
+            TargetSP new_target_sp;
+            FileSpec emptyFileSpec;
+            ArchSpec emptyArchSpec;
+
+            error = debugger.GetTargetList().CreateTarget (debugger,
+                                                           NULL,
+                                                           NULL,
+                                                           false,
+                                                           NULL,
+                                                           new_target_sp);
+            target = new_target_sp.get();
+        }
+        else
+            error.Clear();
+
+        if (target && error.Success())
+        {
+            debugger.GetTargetList().SetSelectedTarget(target);
+            // The freebsd always currently uses the GDB remote debugger plug-in
+            // so even when debugging locally we are debugging remotely!
+            // Just like the darwin plugin.
+            process_sp = target->CreateProcess (listener, "gdb-remote", NULL);
+
+            if (process_sp)
+                error = process_sp->Attach (attach_info);
+        }
+    }
+    else
+    {
+        if (m_remote_platform_sp)
+            process_sp = m_remote_platform_sp->Attach (attach_info, debugger, target, listener, error);
+        else
+            error.SetErrorString ("the platform is not currently connected");
+    }
+    return process_sp;
+}
+
+const char *
+PlatformWindows::GetUserName (uint32_t uid)
+{
+    // Check the cache in Platform in case we have already looked this uid up
+    const char *user_name = Platform::GetUserName(uid);
+    if (user_name)
+        return user_name;
+
+    if (IsRemote() && m_remote_platform_sp)
+        return m_remote_platform_sp->GetUserName(uid);
+    return NULL;
+}
+
+const char *
+PlatformWindows::GetGroupName (uint32_t gid)
+{
+    const char *group_name = Platform::GetGroupName(gid);
+    if (group_name)
+        return group_name;
+
+    if (IsRemote() && m_remote_platform_sp)
+        return m_remote_platform_sp->GetGroupName(gid);
+    return NULL;
+}
+
+Error
+PlatformWindows::GetFile (const FileSpec &platform_file,
+                          const UUID *uuid_ptr,
+                          FileSpec &local_file)
+{
+    if (IsRemote())
+    {
+        if (m_remote_platform_sp)
+            return m_remote_platform_sp->GetFile (platform_file, uuid_ptr, local_file);
+    }
+
+    // Default to the local case
+    local_file = platform_file;
+    return Error();
+}
+
+Error
+PlatformWindows::GetSharedModule (const ModuleSpec &module_spec,
+                                  ModuleSP &module_sp,
+                                  const FileSpecList *module_search_paths_ptr,
+                                  ModuleSP *old_module_sp_ptr,
+                                  bool *did_create_ptr)
+{
+    Error error;
+    module_sp.reset();
+
+    if (IsRemote())
+    {
+        // If we have a remote platform always, let it try and locate
+        // the shared module first.
+        if (m_remote_platform_sp)
+        {
+            error = m_remote_platform_sp->GetSharedModule (module_spec,
+                                                           module_sp,
+                                                           module_search_paths_ptr,
+                                                           old_module_sp_ptr,
+                                                           did_create_ptr);
+        }
+    }
+
+    if (!module_sp)
+    {
+        // Fall back to the local platform and find the file locally
+        error = Platform::GetSharedModule (module_spec,
+                                           module_sp,
+                                           module_search_paths_ptr,
+                                           old_module_sp_ptr,
+                                           did_create_ptr);
+    }
+    if (module_sp)
+        module_sp->SetPlatformFileSpec(module_spec.GetFileSpec());
+    return error;
+}
+
+
+bool
+PlatformWindows::GetSupportedArchitectureAtIndex (uint32_t idx, ArchSpec &arch)
+{
+    // From macosx;s plugin code. For FreeBSD we may want to support more archs.
+    if (idx == 0)
+    {
+        arch = Host::GetArchitecture (Host::eSystemDefaultArchitecture);
+        return arch.IsValid();
+    }
+    else if (idx == 1)
+    {
+        ArchSpec platform_arch (Host::GetArchitecture (Host::eSystemDefaultArchitecture));
+        ArchSpec platform_arch64 (Host::GetArchitecture (Host::eSystemDefaultArchitecture64));
+        if (platform_arch.IsExactMatch(platform_arch64))
+        {
+            // This freebsd platform supports both 32 and 64 bit. Since we already
+            // returned the 64 bit arch for idx == 0, return the 32 bit arch
+            // for idx == 1
+            arch = Host::GetArchitecture (Host::eSystemDefaultArchitecture32);
+            return arch.IsValid();
+        }
+    }
+    return false;
+}
+
+void
+PlatformWindows::GetStatus (Stream &strm)
+{
+    OSVERSIONINFO info;
+
+    ZeroMemory(&info, sizeof(OSVERSIONINFO));
+    info.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+
+    if (GetVersionEx(&info) == 0) {
+        strm << "Windows";
+        return;
+    }
+
+    strm << "Host: Windows " << (int) info.dwMajorVersion
+        << '.' << (int) info.dwMinorVersion
+        << " Build: " << (int) info.dwBuildNumber << '\n';
+
+    Platform::GetStatus(strm);
+}
diff --git source/Plugins/Platform/Windows/PlatformWindows.h source/Plugins/Platform/Windows/PlatformWindows.h
new file mode 100644
index 0000000..7ddd983
--- /dev/null
+++ source/Plugins/Platform/Windows/PlatformWindows.h
@@ -0,0 +1,160 @@
+//===-- PlatformWindows.h --------------------------------------/*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_PlatformWindows_h_
+#define liblldb_PlatformWindows_h_
+
+// C Includes
+// C++ Includes
+// Other libraries and framework includes
+// Project includes
+#include "lldb/Target/Platform.h"
+
+namespace lldb_private
+{
+    class PlatformWindows : public Platform
+    {
+    public:
+
+        static void
+        Initialize ();
+
+        static void
+        Terminate ();
+
+        PlatformWindows (bool is_host);
+
+        virtual
+        ~PlatformWindows();
+
+        //------------------------------------------------------------
+        // lldb_private::PluginInterface functions
+        //------------------------------------------------------------
+        static lldb_private::Platform*
+        CreateInstance (bool force, const lldb_private::ArchSpec *arch);
+
+
+        static lldb_private::ConstString
+        GetPluginNameStatic (bool is_host);
+
+        static const char *
+        GetPluginDescriptionStatic (bool is_host);
+
+        virtual lldb_private::ConstString
+        GetPluginName();
+
+        virtual uint32_t
+        GetPluginVersion()
+        {
+            return 1;
+        }
+
+        //------------------------------------------------------------
+        // lldb_private::Platform functions
+        //------------------------------------------------------------
+        virtual Error
+        ResolveExecutable (const FileSpec &exe_file,
+                           const ArchSpec &arch,
+                           lldb::ModuleSP &module_sp,
+                           const FileSpecList *module_search_paths_ptr);
+
+        virtual const char *
+        GetDescription ()
+        {
+            return GetPluginDescriptionStatic(IsHost());
+        }
+
+    virtual size_t
+    GetSoftwareBreakpointTrapOpcode (lldb_private::Target &target,
+                                     lldb_private::BreakpointSite *bp_site);
+
+    virtual bool
+    GetRemoteOSVersion ();
+
+    virtual bool
+    GetRemoteOSBuildString (std::string &s);
+
+    virtual bool
+    GetRemoteOSKernelDescription (std::string &s);
+
+    // Remote Platform subclasses need to override this function
+    virtual lldb_private::ArchSpec
+    GetRemoteSystemArchitecture ();
+
+    virtual bool
+    IsConnected () const;
+
+    virtual lldb_private::Error
+    ConnectRemote (lldb_private::Args& args);
+
+    virtual lldb_private::Error
+    DisconnectRemote ();
+
+    virtual const char *
+    GetHostname ();
+
+    virtual const char *
+    GetUserName (uint32_t uid);
+
+    virtual const char *
+    GetGroupName (uint32_t gid);
+
+    virtual bool
+    GetProcessInfo (lldb::pid_t pid,
+                    lldb_private::ProcessInstanceInfo &proc_info);
+
+    virtual uint32_t
+    FindProcesses (const lldb_private::ProcessInstanceInfoMatch &match_info,
+                   lldb_private::ProcessInstanceInfoList &process_infos);
+
+    virtual lldb_private::Error
+    LaunchProcess (lldb_private::ProcessLaunchInfo &launch_info);
+
+    virtual lldb::ProcessSP
+    Attach(lldb_private::ProcessAttachInfo &attach_info,
+           lldb_private::Debugger &debugger,
+           lldb_private::Target *target,
+           lldb_private::Listener &listener,
+           lldb_private::Error &error);
+
+    // FIXME: Only on PlatformMacOSX:
+    virtual lldb_private::Error
+    GetFile (const lldb_private::FileSpec &platform_file,
+             const lldb_private::UUID* uuid, lldb_private::FileSpec &local_file);
+
+    lldb_private::Error
+    GetSharedModule (const lldb_private::ModuleSpec &module_spec,
+                     lldb::ModuleSP &module_sp,
+                     const lldb_private::FileSpecList *module_search_paths_ptr,
+                     lldb::ModuleSP *old_module_sp_ptr,
+                     bool *did_create_ptr);
+
+    virtual bool
+    GetSupportedArchitectureAtIndex (uint32_t idx, lldb_private::ArchSpec &arch);
+
+    virtual void
+    GetStatus (lldb_private::Stream &strm);
+
+    // Disable launching Windows processes by spawning and attaching.
+    virtual bool
+    CanDebugProcess ()
+    {
+        return false;
+    }
+
+protected:
+    lldb::PlatformSP m_remote_platform_sp; // Allow multiple ways to connect to a remote freebsd OS
+
+private:
+    DISALLOW_COPY_AND_ASSIGN (PlatformWindows);
+};
+
+};
+
+#endif  // liblldb_PlatformWindows_h_
diff --git source/lldb.cpp source/lldb.cpp
index aefa551..156a2d6 100644
--- source/lldb.cpp
+++ source/lldb.cpp
@@ -63,7 +63,7 @@
 
 #include "Plugins/Process/mach-core/ProcessMachCore.h"
 
-#if defined(__linux__) or defined(__FreeBSD__)
+#if defined(__linux__) || defined(__FreeBSD__)
 #include "Plugins/Process/elf-core/ProcessElfCore.h"
 #endif
 
@@ -76,6 +76,10 @@
 #include "Plugins/Process/FreeBSD/ProcessFreeBSD.h"
 #endif
 
+#if defined (_MSC_VER)
+#include "Plugins/Platform/Windows/PlatformWindows.h"
+#endif
+
 #include "Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h"
 #include "Plugins/Process/gdb-remote/ProcessGDBRemote.h"
 #include "Plugins/DynamicLoader/Static/DynamicLoaderStatic.h"
@@ -116,6 +120,9 @@ lldb_private::Initialize ()
         PlatformLinux::Initialize();
         SymbolFileDWARFDebugMap::Initialize();
         ItaniumABILanguageRuntime::Initialize();
+#if defined( _WIN32 )
+        PlatformWindows::Initialize();
+#endif
 #ifndef LLDB_DISABLE_PYTHON
         OperatingSystemPython::Initialize();
 #endif
@@ -148,7 +155,7 @@ lldb_private::Initialize ()
         ProcessFreeBSD::Initialize();
 #endif
 
-#if defined(__linux__) or defined(__FreeBSD__)
+#if defined(__linux__) || defined(__FreeBSD__)
         ProcessElfCore::Initialize();
 #endif
         //----------------------------------------------------------------------
@@ -181,7 +188,9 @@ lldb_private::Terminate ()
     
     // Terminate and unload and loaded system or user LLDB plug-ins
     PluginManager::Terminate();
-
+#if defined( _WIN32 )
+    PlatformWindows::Terminate();
+#endif
     ABIMacOSX_i386::Terminate();
     ABIMacOSX_arm::Terminate();
     ABISysV_x86_64::Terminate();
@@ -230,7 +239,7 @@ lldb_private::Terminate ()
     ProcessFreeBSD::Terminate();
 #endif
 
-#if defined(__linux__) or defined(__FreeBSD__)
+#if defined(__linux__) || defined(__FreeBSD__)
     ProcessElfCore::Terminate();
 #endif
     ProcessGDBRemote::Terminate();


More information about the lldb-commits mailing list