diff --git a/llvm/utils/gn/secondary/lldb/source/Initialization/BUILD.gn b/llvm/utils/gn/secondary/lldb/source/Initialization/BUILD.gn --- a/llvm/utils/gn/secondary/lldb/source/Initialization/BUILD.gn +++ b/llvm/utils/gn/secondary/lldb/source/Initialization/BUILD.gn @@ -5,13 +5,13 @@ "//lldb/source/Core", "//lldb/source/Host", "//lldb/source/Plugins/Process/gdb-remote", - - # XXX: - # lldbPluginProcessWindowsCommon on win "//llvm/lib/Support", ] + if (current_os == "linux" || current_os == "android") { deps += [ "//lldb/source/Plugins/Process/POSIX" ] + } else if (current_os == "win") { + deps += [ "//lldb/source/Plugins/Process/Windows/Common" ] } # SystemInitializerCommon.cpp includes headers from Plugins/Process/.... diff --git a/llvm/utils/gn/secondary/lldb/source/Plugins/BUILD.gn b/llvm/utils/gn/secondary/lldb/source/Plugins/BUILD.gn --- a/llvm/utils/gn/secondary/lldb/source/Plugins/BUILD.gn +++ b/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", @@ -211,7 +215,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=" ] } diff --git a/llvm/utils/gn/secondary/lldb/source/Plugins/DynamicLoader/Windows-DYLD/BUILD.gn b/llvm/utils/gn/secondary/lldb/source/Plugins/DynamicLoader/Windows-DYLD/BUILD.gn new file mode 100644 --- /dev/null +++ b/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" ] +} diff --git a/llvm/utils/gn/secondary/lldb/source/Plugins/ObjectFile/JIT/BUILD.gn b/llvm/utils/gn/secondary/lldb/source/Plugins/ObjectFile/JIT/BUILD.gn --- a/llvm/utils/gn/secondary/lldb/source/Plugins/ObjectFile/JIT/BUILD.gn +++ b/llvm/utils/gn/secondary/lldb/source/Plugins/ObjectFile/JIT/BUILD.gn @@ -9,7 +9,7 @@ #"//lldb/source/Target", # 2-hop dependency cycle. "//llvm/lib/Support", ] - sources = [ "ObjectFileJIT.cpp" ] # For Utility/UuidCompatibility.h. include_dirs = [ "//lldb/source" ] + sources = [ "ObjectFileJIT.cpp" ] } diff --git a/llvm/utils/gn/secondary/lldb/source/Plugins/ObjectFile/Mach-O/BUILD.gn b/llvm/utils/gn/secondary/lldb/source/Plugins/ObjectFile/Mach-O/BUILD.gn --- a/llvm/utils/gn/secondary/lldb/source/Plugins/ObjectFile/Mach-O/BUILD.gn +++ b/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" ] diff --git a/llvm/utils/gn/secondary/lldb/source/Plugins/ObjectFile/PECOFF/BUILD.gn b/llvm/utils/gn/secondary/lldb/source/Plugins/ObjectFile/PECOFF/BUILD.gn --- a/llvm/utils/gn/secondary/lldb/source/Plugins/ObjectFile/PECOFF/BUILD.gn +++ b/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" ] } } diff --git a/llvm/utils/gn/secondary/lldb/source/Plugins/Process/Windows/Common/BUILD.gn b/llvm/utils/gn/secondary/lldb/source/Plugins/Process/Windows/Common/BUILD.gn new file mode 100644 --- /dev/null +++ b/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", + ] +} diff --git a/llvm/utils/gn/secondary/lldb/source/Utility/BUILD.gn b/llvm/utils/gn/secondary/lldb/source/Utility/BUILD.gn --- a/llvm/utils/gn/secondary/lldb/source/Utility/BUILD.gn +++ b/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()