Index: llvm/utils/gn/secondary/lldb/source/Initialization/BUILD.gn =================================================================== --- llvm/utils/gn/secondary/lldb/source/Initialization/BUILD.gn +++ llvm/utils/gn/secondary/lldb/source/Initialization/BUILD.gn @@ -8,10 +8,13 @@ # XXX: # lldbPluginProcessPOSIX on linux/android - # lldbPluginProcessWindowsCommon on win "//llvm/lib/Support", ] + if (current_os == "win") { + deps += [ "//lldb/source/Plugins/Process/Windows/Common" ] + } + # SystemInitializerCommon.cpp includes headers from Plugins/Process/.... include_dirs = [ ".." ] sources = [ Index: llvm/utils/gn/secondary/lldb/source/Plugins/BUILD.gn =================================================================== --- llvm/utils/gn/secondary/lldb/source/Plugins/BUILD.gn +++ llvm/utils/gn/secondary/lldb/source/Plugins/BUILD.gn @@ -40,6 +40,10 @@ "//lldb/source/Plugins/DynamicLoader/Static", "DynamicLoaderStatic", ], + [ + "//lldb/source/Plugins/DynamicLoader/Windows-DYLD", + "DynamicLoaderWindowsDYLD", + ], [ "//lldb/source/Plugins/Instruction/ARM", "InstructionARM", @@ -207,7 +211,7 @@ # These are in separate variables to make sure ProcessWindowsCommon is # initalized after all plugins, but before ProcessGDBRemote. if (current_os == "win") { - values += [ "LLDB_PROCESS_WINDOWS_PLUGIN=LLDB_PLUGIN(XXX)" ] + values += [ "LLDB_PROCESS_WINDOWS_PLUGIN=LLDB_PLUGIN(ProcessWindowsCommon)" ] } else { values += [ "LLDB_PROCESS_WINDOWS_PLUGIN=" ] } Index: llvm/utils/gn/secondary/lldb/source/Plugins/DynamicLoader/Windows-DYLD/BUILD.gn =================================================================== --- /dev/null +++ llvm/utils/gn/secondary/lldb/source/Plugins/DynamicLoader/Windows-DYLD/BUILD.gn @@ -0,0 +1,13 @@ +static_library("Windows-DYLD") { + output_name = "lldbPluginDynamicLoaderWindowsDYLD" + configs += [ "//llvm/utils/gn/build:lldb_code" ] + deps = [ + "//lldb/source/Core", + "//lldb/source/Target", + "//llvm/lib/Support", + ] + + # Uses source-relative includes for own headers. + include_dirs = [ "//lldb/source" ] + sources = [ "DynamicLoaderWindowsDYLD.cpp" ] +} Index: llvm/utils/gn/secondary/lldb/source/Plugins/ObjectFile/JIT/BUILD.gn =================================================================== --- llvm/utils/gn/secondary/lldb/source/Plugins/ObjectFile/JIT/BUILD.gn +++ llvm/utils/gn/secondary/lldb/source/Plugins/ObjectFile/JIT/BUILD.gn @@ -9,5 +9,7 @@ #"//lldb/source/Target", # 2-hop dependency cycle. "//llvm/lib/Support", ] + # For Utility/UuidCompatibility.h. + include_dirs = [ "//lldb/source" ] sources = [ "ObjectFileJIT.cpp" ] } Index: llvm/utils/gn/secondary/lldb/source/Plugins/ObjectFile/Mach-O/BUILD.gn =================================================================== --- llvm/utils/gn/secondary/lldb/source/Plugins/ObjectFile/Mach-O/BUILD.gn +++ llvm/utils/gn/secondary/lldb/source/Plugins/ObjectFile/Mach-O/BUILD.gn @@ -11,6 +11,10 @@ "//llvm/lib/Support", ] + if (current_os == "win") { + defines = [ "_ENABLE_EXTENDED_ALIGNED_STORAGE" ] + } + # Reaches into Plugins/Process/Utility. include_dirs = [ "//lldb/source" ] sources = [ "ObjectFileMachO.cpp" ] Index: llvm/utils/gn/secondary/lldb/source/Plugins/ObjectFile/PECOFF/BUILD.gn =================================================================== --- llvm/utils/gn/secondary/lldb/source/Plugins/ObjectFile/PECOFF/BUILD.gn +++ llvm/utils/gn/secondary/lldb/source/Plugins/ObjectFile/PECOFF/BUILD.gn @@ -20,6 +20,6 @@ if (current_os == "win") { # Dbghelp is used on windows for writing minidump files. - libs = [ "dbghelp" ] + libs = [ "dbghelp.lib" ] } } Index: llvm/utils/gn/secondary/lldb/source/Plugins/Process/Windows/Common/BUILD.gn =================================================================== --- /dev/null +++ llvm/utils/gn/secondary/lldb/source/Plugins/Process/Windows/Common/BUILD.gn @@ -0,0 +1,48 @@ +static_library("Common") { + output_name = "lldbPluginProcessWindowsCommon" + configs += [ "//llvm/utils/gn/build:lldb_code" ] + deps = [ + "//lldb/source/Core", + "//lldb/source/Host", + "//lldb/source/Interpreter", + "//lldb/source/Plugins/DynamicLoader/Windows-DYLD", + "//lldb/source/Symbol", + "//lldb/source/Target", + "//llvm/lib/Support", + ] + libs = [ + "psapi.lib", + "rpcrt4.lib", + "ws2_32.lib", + ] + + include_dirs = [ + # ../Process/Windows/Common/x64/RegisterContextWindows_x64.h uses an + # unqualified include for "RegisterContextWindows.h". + ".", + + # Reaches into Plugins/Process/Utility. + "//lldb/source", + ] + sources = [ + "DebuggerThread.cpp", + "LocalDebugDelegate.cpp", + "NativeProcessWindows.cpp", + "NativeRegisterContextWindows.cpp", + "NativeRegisterContextWindows_WoW64.cpp", + "NativeRegisterContextWindows_arm.cpp", + "NativeRegisterContextWindows_arm64.cpp", + "NativeRegisterContextWindows_i386.cpp", + "NativeRegisterContextWindows_x86_64.cpp", + "NativeThreadWindows.cpp", + "ProcessDebugger.cpp", + "ProcessWindows.cpp", + "ProcessWindowsLog.cpp", + "RegisterContextWindows.cpp", + "TargetThreadWindows.cpp", + "arm/RegisterContextWindows_arm.cpp", + "arm64/RegisterContextWindows_arm64.cpp", + "x64/RegisterContextWindows_x64.cpp", + "x86/RegisterContextWindows_x86.cpp", + ] +} Index: llvm/utils/gn/secondary/lldb/source/Utility/BUILD.gn =================================================================== --- llvm/utils/gn/secondary/lldb/source/Utility/BUILD.gn +++ llvm/utils/gn/secondary/lldb/source/Utility/BUILD.gn @@ -59,6 +59,13 @@ "XcodeSDK.cpp", ] + if (current_os == "win") { + libs = [ + "rpcrt4.lib", + "ws2_32.lib", + ] + } + # FIXME: # if (APPLE) # list(APPEND LLDB_SYSTEM_LIBS @@ -75,10 +82,6 @@ # # list(APPEND LLDB_SYSTEM_LIBS ${CMAKE_DL_LIBS}) # - # if (CMAKE_SYSTEM_NAME MATCHES "Windows") - # list(APPEND LLDB_SYSTEM_LIBS ws2_32 rpcrt4) - # endif () - # # if (NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB ) # list(APPEND LLDB_SYSTEM_LIBS atomic) # endif()