Author: compnerd Date: Sun Jul 7 10:58:11 2019 New Revision: 365282 URL: http://llvm.org/viewvc/llvm-project?rev=365282&view=rev Log: Process: generalise Windows thread setup
The Windows build currently cannot support debugging foreign targets or debugging Windows ARM NT and Windows ARM64 targets. Do not assume a x64/x86 host. This enables building lldb for Windows ARM64. Modified: lldb/trunk/source/Plugins/Process/Windows/Common/TargetThreadWindows.cpp Modified: lldb/trunk/source/Plugins/Process/Windows/Common/TargetThreadWindows.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Windows/Common/TargetThreadWindows.cpp?rev=365282&r1=365281&r2=365282&view=diff ============================================================================== --- lldb/trunk/source/Plugins/Process/Windows/Common/TargetThreadWindows.cpp (original) +++ lldb/trunk/source/Plugins/Process/Windows/Common/TargetThreadWindows.cpp Sun Jul 7 10:58:11 2019 @@ -20,9 +20,10 @@ #include "ProcessWindowsLog.h" #include "TargetThreadWindows.h" -#if defined(_WIN64) +// TODO support _M_ARM and _M_ARM64 +#if defined(_M_AMD64) #include "x64/RegisterContextWindows_x64.h" -#else +#elif defined(_M_IX86) #include "x86/RegisterContextWindows_x86.h" #endif @@ -66,24 +67,33 @@ TargetThreadWindows::CreateRegisterConte if (!m_thread_reg_ctx_sp) { ArchSpec arch = HostInfo::GetArchitecture(); switch (arch.GetMachine()) { + case llvm::Triple::arm: + case llvm::Triple::thumb: + LLDB_LOG(log, "debugging ARM (NT) targets is currently unsupported"); + break; + + case llvm::Triple::aarch64: + LLDB_LOG(log, "debugging ARM64 targets is currently unsupported"); + break; + case llvm::Triple::x86: -#if defined(_WIN64) - // FIXME: This is a Wow64 process, create a RegisterContextWindows_Wow64 - LLDB_LOG(log, "This is a Wow64 process, we should create a " - "RegisterContextWindows_Wow64, but we don't."); -#else +#if defined(_M_IX86) m_thread_reg_ctx_sp.reset( new RegisterContextWindows_x86(*this, concrete_frame_idx)); +#else + LLDB_LOG(log, "debugging foreign targets is currently unsupported"); #endif break; + case llvm::Triple::x86_64: -#if defined(_WIN64) +#if defined(_M_AMD64) m_thread_reg_ctx_sp.reset( new RegisterContextWindows_x64(*this, concrete_frame_idx)); #else - LLDB_LOG(log, "LLDB is 32-bit, but the target process is 64-bit."); + LLDB_LOG(log, "debugging foreign targets is currently unsupported"); #endif - LLVM_FALLTHROUGH; + break; + default: break; } _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits